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


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

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


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

示例1: createETPage

void  Preferences::createETPage()
{
  // extra tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Recent charts"), w);
  grid->addWidget(label, i, j);
  recentComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowRecentCharts, tb);
  recentComboBoxCheck->setChecked(tb);
  connect(recentComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(recentComboBoxCheck, i++, j + 1);

  addTab(w, tr("ExtraToolbar"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:29,代码来源:Preferences.cpp

示例2: createFontPage

void Preferences::createFontPage()
{
  // font parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // plot font
  QLabel *label = new QLabel(tr("Plot Font"), w);
  grid->addWidget(label, 0, 0);

  plotFontButton = new FontButton(w, plotFont);
  grid->addWidget(plotFontButton, 0, 1);
  connect(plotFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // app font
  label = new QLabel(tr("App Font"), w);
  grid->addWidget(label, 1, 0);

  appFontButton = new FontButton(w, appFont);
  grid->addWidget(appFontButton, 1, 1);
  connect(appFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  addTab(w, tr("Fonts"));

}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:34,代码来源:Preferences.cpp

示例3: createColorPage

void Preferences::createColorPage()
{
  // colors parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // background color
  QLabel *label = new QLabel(tr("Chart Background"), w);
  grid->addWidget(label, 0, 0);

  backgroundColorButton = new ColorButton(w, backgroundColor);
  grid->addWidget(backgroundColorButton, 0, 1);
  backgroundColorButton->setColorButton();
  connect(backgroundColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // border color
  label = new QLabel(tr("Chart Border"), w);
  grid->addWidget(label, 1, 0);

  borderColorButton = new ColorButton(w, borderColor);
  grid->addWidget(borderColorButton, 1, 1);
  borderColorButton->setColorButton();
  connect(borderColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // grid color
  label = new QLabel(tr("Chart Grid"), w);
  grid->addWidget(label, 2, 0);

  gridColorButton = new ColorButton(w, gridColor);
  grid->addWidget(gridColorButton, 2, 1);
  gridColorButton->setColorButton();
  connect(gridColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  //FIXME: add adjustment possibility for prefered CO-colors.
  // in this way to add a spinbox to set the amount of colors too

  addTab(w, tr("Colors"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:47,代码来源:Preferences.cpp

示例4: 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

示例5: createDetailsPage

void StocksDialog::createDetailsPage ()
{
    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("Symbol"), w);
    grid->addWidget(label, 0, 0);

    QString s;
    DBIndexItem item;
    index->getIndexItem(symbol, item);
    item.getSymbol(s);
    label = new QLabel(s, w);
    label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
    grid->addWidget(label, 0, 1);

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

    item.getTitle(s);
    title = new QLineEdit(s, w);
    grid->addWidget(title, 1, 1);

    label = new QLabel(tr("Exchange"), w);
    grid->addWidget(label, 2, 0);

    item.getExchange(s);
    Exchange ex;
    ex.getExchange(s.toInt(), s);
    label = new QLabel(s, w);
    label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
    grid->addWidget(label, 2, 1);

    label = new QLabel(tr("Type"), w);
    grid->addWidget(label, 3, 0);

    item.getType(s);
    label = new QLabel(s, w);
    label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
    grid->addWidget(label, 3, 1);

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

    Bar bar;
    db->getFirstBar(bar);
    if (! bar.getEmptyFlag())
    {
        bar.getDateTimeString(TRUE, s);
        label = new QLabel(s, w);
        label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
        grid->addWidget(label, 4, 1);
    }

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

    Bar bar2;
    db->getLastBar(bar2);
    if (! bar2.getEmptyFlag())
    {
        bar2.getDateTimeString(TRUE, s);
        label = new QLabel(s, w);
        label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
        grid->addWidget(label, 5, 1);
    }

    grid->expand(grid->numRows() + 1, grid->numCols());
    grid->setColStretch(1, 1);

    vbox->addStretch(1);

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

示例6: createGeneralPage

void Preferences::createGeneralPage()
{
  // general parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1); // stretch 2nd col a little
  grid->setColStretch(2, 2); // stretch outer right col more

  vbox->insertStretch(-1, 1);

  // menubar checkbox
  QLabel *label = new QLabel(tr("Main Menubar"), w);
  grid->addWidget(label, 0, 0);

  menubarCheck = new QCheckBox(w);
  menubarCheck->setChecked(menubar);
  connect(menubarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(menubarCheck, 0, 1);

  // extraToolbar checkbox
  label = new QLabel(tr("Extra Toolbar"), w);
  grid->addWidget(label, 1, 0);

  extraToolbarCheck = new QCheckBox(w);
  extraToolbarCheck->setChecked(extraToolbar);
  connect(extraToolbarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(extraToolbarCheck, 1, 1);

  // bar spacing 1
  label = new QLabel(tr("Bar Spacing 1"), w);
  grid->addWidget(label, 2, 0);

  bs1Spinner = new QSpinBox(2, 99, 1, w);
  bs1Spinner->setValue(ps1Button);
  connect(bs1Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs1Spinner, 2, 1);

  // bar spacing 2
  label = new QLabel(tr("Bar Spacing 2"), w);
  grid->addWidget(label, 3, 0);

  bs2Spinner = new QSpinBox(2, 99, 1, w);
  bs2Spinner->setValue(ps2Button);
  connect(bs2Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs2Spinner, 3, 1);

  // bar spacing 3
  label = new QLabel(tr("Bar Spacing 3"), w);
  grid->addWidget(label, 4, 0);

  bs3Spinner = new QSpinBox(2, 99, 1, w);
  bs3Spinner->setValue(ps3Button);
  connect(bs3Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs3Spinner, 4, 1);

  addTab(w, tr("General"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:62,代码来源:Preferences.cpp

示例7: createCTPage

void  Preferences::createCTPage()
{
  // chart tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Compression list"), w);
  grid->addWidget(label, i, j);
  cmpsComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmpsComboBox, tb);
  cmpsComboBoxCheck->setChecked(tb);
  connect(cmpsComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmpsComboBoxCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Minute"), w);
  grid->addWidget(label, i, j);
  cmps1MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1MBtn, tb);
  cmps1MBtnCheck->setChecked(tb);
  connect(cmps1MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps2MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2MBtn, tb);
//  cmps2MBtnCheck->setChecked(tb);
//  connect(cmps2MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 5 Minute"), w);
  grid->addWidget(label, i, j);
  cmps5MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps5MBtn, tb);
  cmps5MBtnCheck->setChecked(tb);
  connect(cmps5MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps5MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 10 Minute"), w);
  grid->addWidget(label, i, j);
  cmps10MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps10MBtn, tb);
  cmps10MBtnCheck->setChecked(tb);
  connect(cmps10MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps10MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 15 Minute"), w);
  grid->addWidget(label, i, j);
  cmps15MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps15MBtn, tb);
  cmps15MBtnCheck->setChecked(tb);
  connect(cmps15MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps15MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 20 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps20MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps20MBtn, tb);
//  cmps20MBtnCheck->setChecked(tb);
//  connect(cmps20MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps20MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 30 Minute"), w);
  grid->addWidget(label, i, j);
  cmps30MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps30MBtn, tb);
  cmps30MBtnCheck->setChecked(tb);
  connect(cmps30MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps30MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Hour"), w);
  grid->addWidget(label, i, j);
  cmps1HBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1HBtn, tb);
  cmps1HBtnCheck->setChecked(tb);
  connect(cmps1HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Hour"), w);
//  grid->addWidget(label, i, j);
//  cmps2HBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2HBtn, tb);
//  cmps2HBtnCheck->setChecked(tb);
//  connect(cmps2HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 4 Hour"), w);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:Preferences.cpp

示例8: createMTPage

void  Preferences::createMTPage()
{
  // main tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 6); // two more cols as needed
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(2, 1); // middle spacing col
  grid->setColStretch(5, 2); // outer right col

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Quit"), w);
  grid->addWidget(label, i, j);
  quitBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowQuitBtn, tb);
  quitBtnCheck->setChecked(tb);
  connect(quitBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(quitBtnCheck, i++, j + 1);

  label = new QLabel(tr("Preferences"), w);
  grid->addWidget(label, i, j);
  prefBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPrefBtn, tb);
  prefBtnCheck->setChecked(tb);
  connect(prefBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(prefBtnCheck, i++, j + 1);

  label = new QLabel(tr("Side Panel"), w);
  grid->addWidget(label, i, j);
  sidePanelBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowSidePanelBtn, tb);
  sidePanelBtnCheck->setChecked(tb);
  connect(sidePanelBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(sidePanelBtnCheck, i++, j + 1);

  label = new QLabel(tr("Grid"), w);
  grid->addWidget(label, i, j);
  gridBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowGridBtn, tb);
  gridBtnCheck->setChecked(tb);
  connect(gridBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(gridBtnCheck, i++, j + 1);

  label = new QLabel(tr("Scale to Screen"), w);
  grid->addWidget(label, i, j);
  scaleToScreenBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowScaleToScreenBtn, tb);
  scaleToScreenBtnCheck->setChecked(tb);
  connect(scaleToScreenBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(scaleToScreenBtnCheck, i++, j + 1);

  label = new QLabel(tr("CrossHair"), w);
  grid->addWidget(label, i, j);
  crosshairBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCrosshairBtn, tb);
  crosshairBtnCheck->setChecked(tb);
  connect(crosshairBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(crosshairBtnCheck, i++, j + 1);

  // now fill a second col
  i = 0;
  j = 3;

  label = new QLabel(tr("PaperTrade"), w);
  grid->addWidget(label, i, j);
  paperTradeBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPaperTradeBtn, tb);
  paperTradeBtnCheck->setChecked(tb);
  connect(paperTradeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(paperTradeBtnCheck, i++, j + 1);

  label = new QLabel(tr("DrawMode"), w);
  grid->addWidget(label, i, j);
  drawModeBtnCheck= new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDrawModeBtn, tb);
  drawModeBtnCheck->setChecked(tb);
  connect(drawModeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(drawModeBtnCheck, i++, j + 1);

  label = new QLabel(tr("NewIndicator"), w);
  grid->addWidget(label, i, j);
  newIndicatorBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowNewIndicatorBtn, tb);
  newIndicatorBtnCheck->setChecked(tb);
  connect(newIndicatorBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(newIndicatorBtnCheck, i++, j + 1);

  label = new QLabel(tr("DataWindow"), w);
  grid->addWidget(label, i, j);
  dataWindowBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDataWindowBtn, tb);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:Preferences.cpp


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