当前位置: 首页>>代码示例>>C++>>正文


C++ Q3VBoxLayout::setMargin方法代码示例

本文整理汇总了C++中Q3VBoxLayout::setMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3VBoxLayout::setMargin方法的具体用法?C++ Q3VBoxLayout::setMargin怎么用?C++ Q3VBoxLayout::setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Q3VBoxLayout的用法示例。


在下文中一共展示了Q3VBoxLayout::setMargin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

TesterRulePage::TesterRulePage (QWidget *p) : QWidget (p)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
    vbox->setMargin(5);
    vbox->setSpacing(5);

    Q3GridLayout *grid = new Q3GridLayout(vbox, 2, 2);

    Q3VGroupBox *gbox = new Q3VGroupBox(tr("Enter Long"), this);
    grid->addWidget(gbox, 0, 0);

    enterLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Long"), this);
    grid->addWidget(gbox, 0, 1);

    exitLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Enter Short"), this);
    grid->addWidget(gbox, 1, 0);

    enterShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Short"), this);
    grid->addWidget(gbox, 1, 1);

    exitShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:28,代码来源:TesterRulePage.cpp

示例2: createDataPage

void StocksDialog::createDataPage ()
{
    QWidget *w = new QWidget(this);

    Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
    vbox->setMargin(5);
    vbox->setSpacing(0);

    barEdit = new BarEdit(w);
    QString s = tr("Open");
    QString s2 = "Open";
    barEdit->createField(s, s2, FALSE);
    s = tr("High");
    s2 = "High";
    barEdit->createField(s, s2, FALSE);
    s = tr("Low");
    s2 = "Low";
    barEdit->createField(s, s2, FALSE);
    s = tr("Close");
    s2 = "Close";
    barEdit->createField(s, s2, FALSE);
    s = tr("Volume");
    s2 = "Volume";
    barEdit->createField(s, s2, FALSE);
    connect(barEdit, SIGNAL(signalDeleteRecord()), this, SLOT(deleteRecord()));
    connect(barEdit, SIGNAL(signalSaveRecord()), this, SLOT(saveRecord()));
    connect(barEdit, SIGNAL(signalSearch(QDateTime)), this, SLOT(slotDateSearch(QDateTime)));
    connect(barEdit, SIGNAL(signalFirstRecord()), this, SLOT(slotFirstRecord()));
    connect(barEdit, SIGNAL(signalLastRecord()), this, SLOT(slotLastRecord()));
    connect(barEdit, SIGNAL(signalPrevRecord()), this, SLOT(slotPrevRecord()));
    connect(barEdit, SIGNAL(signalNextRecord()), this, SLOT(slotNextRecord()));
    vbox->addWidget(barEdit);

    addTab(w, tr("Data"));
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:35,代码来源:StocksDialog.cpp

示例3: QDialog

ConstraintDialog::ConstraintDialog(ConstraintCanvas * c)
    : QDialog(0, "ConstraintVisibilityDialog", TRUE, 0), constraint(c)
{
    setCaption(TR("Constraints visibility dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    table = new ConstraintTable(this, constraint);
    vbox->addWidget(table);
    vbox->addWidget(new QLabel(this));

    Q3HBoxLayout * hbox;

    hbox = new Q3HBoxLayout(vbox);

    cb_visible = new QCheckBox(TR("Specify visible elements rather than hidden ones"), this);
    cb_visible->setChecked(constraint->indicate_visible);
    hbox->addWidget(cb_visible);

    QPushButton * showall = new QPushButton(TR("Show all"), this);
    QPushButton * hideall = new QPushButton(TR("Hide all"), this);
    QPushButton * hideinherited = new QPushButton(TR("Hide inherited"), this);
    QSize bs = hideinherited->sizeHint();

    showall->setFixedSize(bs);
    hideall->setFixedSize(bs);
    hideinherited->setFixedSize(bs);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(showall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideinherited);
    hbox->addWidget(new QLabel(this));

    connect(showall, SIGNAL(clicked()), this, SLOT(show_all()));
    connect(hideall, SIGNAL(clicked()), this, SLOT(hide_all()));
    connect(hideinherited, SIGNAL(clicked()), this, SLOT(hide_inherited()));

    vbox->addWidget(new QLabel(this));
    hbox = new Q3HBoxLayout(vbox);

    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);

    ok->setDefault(TRUE);
    bs = cancel->sizeHint();
    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(ok);
    hbox->addWidget(cancel);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:harmegnies,项目名称:douml,代码行数:60,代码来源:ConstraintDialog.cpp

示例4: QLabel

Dialog::Dialog(BooL & rec, char & lang) : QDialog(0, 0, TRUE), _rec(rec), _lang(lang) {
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBox * htab;
  
  vbox->setMargin(5);
  
  // recursive checkbox
  if (rec) {
    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);
    
    rec_cb = new QCheckBox("Do recursively", htab);
  }
  else
    rec_cb = 0;

  // langs + cancel buttons
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  QPushButton * cpp = new QPushButton("&C++", htab);
  new QLabel(htab);
  QPushButton * java = new QPushButton("&Java", htab);
  new QLabel(htab);
  QPushButton * idl = new QPushButton("&Idl", htab);
  new QLabel(htab);
  QPushButton * php = new QPushButton("P&hp", htab);
  new QLabel(htab);
  QPushButton * python = new QPushButton("P&ython", htab);
  new QLabel(htab);
  QPushButton * cancel = new QPushButton("&Cancel", htab);
  new QLabel(htab);
  QSize bs(cancel->sizeHint());
  
  cpp->setFixedSize(bs);
  java->setFixedSize(bs);
  
  connect(cpp, SIGNAL(clicked()), this, SLOT(accept_cpp()));
  connect(java, SIGNAL(clicked()), this, SLOT(accept_java()));
  connect(idl, SIGNAL(clicked()), this, SLOT(accept_idl()));
  connect(php, SIGNAL(clicked()), this, SLOT(accept_php()));
  connect(python, SIGNAL(clicked()), this, SLOT(accept_python()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));

  // help
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  new QLabel(htab);
  new QLabel("Warning : reset the declarations/definitions to\n"
	     "their default value from the 'generation settings'", htab);
  new QLabel(htab);
}
开发者ID:SciBoy,项目名称:douml,代码行数:58,代码来源:Dialog.cpp

示例5: bp

AboutDialog::AboutDialog() : QDialog(0, "About DoUML", TRUE)
{
    setCaption(TR("About DoUML"));
    //move(p);

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);

    QPixmap bp((const char **) bp_xpm);
    // QLabel * lbp = new QLabel(this);

    // lbp->setPixmap(bp);
    //  hbox->addWidget(lbp);
    hbox->addWidget(new QLabel("  ", this));
    // Replacing about to bouml-ng
    const char htmltext[] = "<p>DoUML</p>\n"
                            "<p>This project is a fork of\n"
                            "Bruno Pages's work, BoUML:\n"
                            "<i>http://sourceforge.net/projects/douml/</i></p>\n"
                            "<p>DoUML focus is to port BoUML to Qt4\n"
                            "and to maintain it as a community</p>\n"
                            "<p>Join us at:<br>\n"
                            "https://github.com/leonardo2d/douml/<br>\n"
                            "#[email protected]</p>\n\n\n";

    Q3TextView * tx =
        new Q3TextView(htmltext, QString(), this);
    QFont fnt = tx->font();

    fnt.setItalic(TRUE);

    QFontMetrics fm(fnt);

    tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
    tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
    tx->setMinimumSize(fm.size(0, htmltext));
    hbox->addWidget(tx);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);

    ok->setDefault(TRUE);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(ok);
    hbox->addWidget(new QLabel(this));

    if (UmlDesktop::fixed())
        UmlDesktop::tocenter(this);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
开发者ID:harmegnies,项目名称:douml,代码行数:58,代码来源:About.cpp

示例6: bp

AboutDialog::AboutDialog() : QDialog(0, "About " PROJECT_NAME, TRUE) {
  setCaption(TR("About " PROJECT_NAME));
  //move(p);
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  Q3HBoxLayout * hbox; 
  
  vbox->setMargin(5);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);

  QPixmap bp((const char **) bp_xpm);
  QLabel * lbp = new QLabel(this);
  
 // lbp->setPixmap(bp);
//  hbox->addWidget(lbp);
  hbox->addWidget(new QLabel("  ", this));

  QString htmltext;
  htmltext.sprintf("%s <b>%d.%d-%d</b> release <b>%s</b><br>\n"
                   "<br>\n"
                   "<i>%s</i><br>\n"
                   "<br>\n"
                   "%s (<i>%s</i>)",
    PROJECT_NAME, PROJECT_MAJOR, PROJECT_MINOR, PROJECT_REVISION, PROJECT_RELEASE,
    PROJECT_HOME, PROJECT_ADMIN, PROJECT_CONTACT);
                            
  Q3TextView * tx =
    new Q3TextView(htmltext, QString::null, this);
  QFont fnt = tx->font();
  
  fnt.setItalic(TRUE);
  
  QFontMetrics fm(fnt);
  
  tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
  tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
  tx->setMinimumSize(fm.size(0, htmltext));
  hbox->addWidget(tx);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  
  ok->setDefault( TRUE );
  
  hbox->addWidget(new QLabel(this));
  hbox->addWidget(ok);
  hbox->addWidget(new QLabel(this));
  
  if (UmlDesktop::fixed())
    UmlDesktop::tocenter(this);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
开发者ID:kralf,项目名称:bouml,代码行数:56,代码来源:About.cpp

示例7: QDialog

ReferenceDialog::ReferenceDialog(BrowserNode * bn)
    : QDialog(0, "Referenced By dialog", FALSE, Qt::WDestructiveClose)
{
    the = this;
    target = bn;

    setCaption(TR("Referenced By dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    QString s = target->get_name();

    s += TR(" is referenced by :");

    vbox->addWidget(new QLabel(s, this));

    results = new Q3ComboBox(FALSE, this);
    vbox->addWidget(results);

    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * search_b = new QPushButton(TR("Recompute"), this);
    QPushButton * close_b = new QPushButton(TR("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(TR("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(compute()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    compute();

    open_dialog(this);
}
开发者ID:harmegnies,项目名称:douml,代码行数:47,代码来源:ReferenceDialog.cpp

示例8: QDialog

BrowserSearchDialog::BrowserSearchDialog(const QPoint & p)
    : QDialog(0, "Browser search", TRUE) {
  setCaption("Browser search");
  move(p);
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  
  vbox->setMargin(5);
  
  Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/);

  ed = new QLineEdit(this);
  ed->setText(saved_ed);
  gl->addWidget(new QLabel("Containing", this), 1, 0, Qt::AlignLeft);
  gl->addWidget(ed, 1, 1);
  
  Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, this);

  case_sensitive = new QCheckBox("case sensitive", gb);
  case_sensitive->setChecked(saved_case_sensitive);
  
  gl->addWidget(gb, 2, 1);

  gl->addWidget(new QLabel("Result", this), 3, 0, Qt::AlignLeft);
  results = new Q3ComboBox(FALSE, this);
  gl->addWidget(results, 3, 1);

  Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * search_b = new QPushButton("Search", this);
  QPushButton * select_b = new QPushButton("Select", this);
  QPushButton * close_b = new QPushButton("Close", this);
  
  search_b->setDefault(TRUE);
  
  hbox->addWidget(search_b);
  hbox->addWidget(select_b);
  hbox->addWidget(close_b);
  
  connect(search_b, SIGNAL(clicked()), this, SLOT(search()));
  connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
  connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
  
  setMaximumHeight(sizeHint().height());
}
开发者ID:SciBoy,项目名称:douml,代码行数:45,代码来源:BrowserSearchDialog.cpp

示例9: createFundamentalsPage

void StocksDialog::createFundamentalsPage ()
{
    QWidget *w = new QWidget(this);

    Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
    vbox->setMargin(5);
    vbox->setSpacing(5);

    Setting fund;
    QString s, s2;
    index->getFundamentals(symbol, s2);
    fund.parse(s2);

    s = tr("Fundamentals: last updated ");
    s2 = "updateDate";
    QString s3;
    fund.getData(s2, s3);
    s.append(s3);
    fund.remove(s2);
    QStringList key;
    fund.getKeyList(key);
    key.sort();

    vbox->addSpacing(10);
    QLabel *label = new QLabel(s, w);
    vbox->addWidget(label);

    fundView = new Q3ListView(w);
    fundView->addColumn(tr("Description"));
    fundView->addColumn(tr("Value"));
    vbox->addWidget(fundView);

    int loop;
    for (loop = 0; loop < (int) key.count(); loop++)
    {
        fund.getData(key[loop], s);
        new Q3ListViewItem(fundView, key[loop], s);
    }

    if (! key.count())
        new Q3ListViewItem(fundView, tr("No data available."));

    addTab(w, tr("Fundamentals"));
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:44,代码来源:StocksDialog.cpp

示例10: bs

ClassSettingsDialog::ClassSettingsDialog(ClassSettings * se, bool nodefault)
    : QDialog(0, "Class Settings dialog", TRUE), settings(se) {
  setCaption(TR("Class Settings dialog"));
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  Q3HBoxLayout * hbox;
  QString s;
  
  vbox->setMargin(5);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default attributes visibility : "), this), 1000);
  cbattribute = new ComboVisibility(this, settings->attribute_visibility, nodefault);
  hbox->addWidget(cbattribute);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default relations visibility : "), this), 1000);
  cbrelation = new ComboVisibility(this, settings->relation_visibility, nodefault);
  hbox->addWidget(cbrelation);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default operations visibility : "), this), 1000);
  cboperation = new ComboVisibility(this, settings->operation_visibility, nodefault);
  hbox->addWidget(cboperation);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * accept = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  accept->setDefault(TRUE);  
  accept->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(accept);
  hbox->addWidget(cancel);
    
  connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:SciBoy,项目名称:douml,代码行数:44,代码来源:ClassSettingsDialog.cpp

示例11: QWidget

ScannerPage::ScannerPage (QWidget *w, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  idir.setFilter(QDir::Files);

  Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
  vbox->setMargin(0);
  vbox->setSpacing(5);

  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new Q3ListBox(this);
  connect(list, SIGNAL(contextMenuRequested(Q3ListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(Q3ListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(scannerSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(Q3ListBoxItem *)), this, SLOT(doubleClick(Q3ListBoxItem *)));
  vbox->addWidget(list);

  menu = new QMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Scanner		Ctrl+N"), this, SLOT(newScanner()));
  menu->insertItem(QPixmap(openitem), tr("&Open Scanner		Ctrl+O"), this, SLOT(openScanner()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Scanner	Ctrl+D"), this, SLOT(deleteScanner()));
  menu->insertItem(QPixmap(renameitem), tr("&Rename Scanner		Ctrl+R"), this, SLOT(renameScanner()));
  menu->insertItem(QPixmap(macro), tr("R&un Scanner		Ctrl+U"), this, SLOT(runScanner()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  Q3Accel *a = new Q3Accel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(Qt::CTRL+Qt::Key_N, NewScanner);
  a->insertItem(Qt::CTRL+Qt::Key_O, OpenScanner);
  a->insertItem(Qt::CTRL+Qt::Key_D, DeleteScanner);
  a->insertItem(Qt::CTRL+Qt::Key_R, RenameScanner);
  a->insertItem(Qt::CTRL+Qt::Key_U, RunScanner);
  a->insertItem(Qt::CTRL+Qt::Key_H, Help);

  refreshList();
  scannerSelected(QString());
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:43,代码来源:ScannerPage.cpp

示例12: bs

OperationListDialog::OperationListDialog(const char * m,
					 Q3PtrList<BrowserOperation> & l)
    : QDialog(0, m, TRUE) {
  setCaption(m);
  move(QCursor::pos());
 
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
 
  vbox->setMargin(5);
 
  cb = new Q3ComboBox(FALSE, this);
  vbox->addWidget(cb);
  
  for (BrowserOperation * oper = l.first(); oper; oper = l.next()) {
    QString s = ((BrowserNode *) oper->parent())->get_name() +
      QString("::") + oper->get_data()->definition(TRUE, FALSE);
    
    if (((OperationData *) oper->get_data())->get_is_abstract())
      cb->insertItem("[a] " + s);
    else
      cb->insertItem(s);
  }
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  ok->setDefault(TRUE);
  ok->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(ok);
  hbox->addWidget(cancel);

  UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:SciBoy,项目名称:douml,代码行数:42,代码来源:OperationListDialog.cpp

示例13: createSplitPage

void StocksDialog::createSplitPage ()
{
    QWidget *w = new QWidget(this);

    Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
    vbox->setMargin(5);
    vbox->setSpacing(5);

    Q3GridLayout *grid = new Q3GridLayout(vbox);
    grid->setMargin(0);
    grid->setSpacing(5);

    QLabel *label = new QLabel(tr("Split Date"), w);
    grid->addWidget(label, 0, 0);

    Bar bar;
    db->getLastBar(bar);
    QDateTime dt;
    bar.getDate(dt);
    if (! bar.getEmptyFlag())
        splitDate = new Q3DateEdit(dt.date(), w);
    else
        splitDate = new Q3DateEdit(QDate::currentDate(), w);
    splitDate->setOrder(Q3DateEdit::YMD);
    grid->addWidget(splitDate, 0, 1);

    label = new QLabel(tr("Split Ratio"), w);
    grid->addWidget(label, 1, 0);

    splitRatio = new QLineEdit("2:1", w);
    grid->addWidget(splitRatio, 1, 1);

    QPushButton *button = new QPushButton(tr("Perform Split"), w);
    connect(button, SIGNAL(clicked()), this, SLOT(split()));
    vbox->addWidget(button);

    vbox->addStretch(1);

    addTab(w, tr("Split"));
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:40,代码来源:StocksDialog.cpp

示例14: bs

ClassListDialog::ClassListDialog(const char * m,
				 const Q3ValueList<BrowserClass *> & l)
    : QDialog(0, m, TRUE) {
  setCaption(m);
  move(QCursor::pos());
 
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
 
  vbox->setMargin(5);
 
  cb = new Q3ComboBox(FALSE, this);
  vbox->addWidget(cb);
  
  Q3ValueList<BrowserClass *>::ConstIterator end = l.end();
  Q3ValueList<BrowserClass *>::ConstIterator it;
  
    for (it = l.begin(); it != end; ++it)
      if (!(*it)->deletedp())
	cb->insertItem((*it)->full_name(TRUE));
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  ok->setDefault(TRUE);  
  ok->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(ok);
  hbox->addWidget(cancel);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
  
  UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
}
开发者ID:SciBoy,项目名称:douml,代码行数:39,代码来源:ClassListDialog.cpp

示例15: QLabel

CodAddMsgDialog::CodAddMsgDialog(CodObjCanvas * from, CodObjCanvas * to,
                                 CodMsgSupport * i, ColDiagramView * v,
                                 bool fo)
    : QDialog(0, "add msg dialog", TRUE), in(i), view(v), forward(fo)
{
    setCaption(TR("Add message dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(10);
    QLabel * label1 = new QLabel(TR("Add message to %1", to->get_full_name()), this);
    label1->setAlignment(Qt::AlignCenter);
    hbox->addWidget(label1);

    Q3Grid * grid = new Q3Grid(2, this);

    vbox->addWidget(grid);
    new QLabel(TR("rank : "), grid);
    cbrank = new Q3ComboBox(FALSE, grid);

    ColMsgList all_in;
    ColMsgList all_out;

    from->get_all_in_all_out(all_in, all_out);

    QStringList new_ones;
    foreach (ColMsg *m, all_out) {
        QString s = m->next_hierarchical_rank();

        if ((s.find('.') != - 1) && (ColMsg::find(s, all_out) == 0)) {
            cbrank->insertItem(QString::number(m->get_rank() + 1) + " : " + s);
            new_ones.append(s);
        }
    }
开发者ID:jeremysalwen,项目名称:douml,代码行数:38,代码来源:CodAddMsgDialog.cpp


注:本文中的Q3VBoxLayout::setMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。