本文整理汇总了C++中Q3VBoxLayout::insertStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3VBoxLayout::insertStretch方法的具体用法?C++ Q3VBoxLayout::insertStretch怎么用?C++ Q3VBoxLayout::insertStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3VBoxLayout
的用法示例。
在下文中一共展示了Q3VBoxLayout::insertStretch方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"));
}
示例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"));
}
示例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"));
}
示例4: createDetailsPage
void FuturesDialog::createDetailsPage ()
{
QWidget *w = new QWidget(this);
Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
vbox->setMargin(5);
vbox->setSpacing(0);
Q3GridLayout *grid = new Q3GridLayout(vbox);
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("Futures Type"), w);
grid->addWidget(label, 4, 0);
QString s2;
item.getFuturesType(s2);
label = new QLabel(s2, w);
label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
grid->addWidget(label, 4, 1);
label = new QLabel(tr("Futures Month"), w);
grid->addWidget(label, 5, 0);
item.getFuturesMonth(s2);
label = new QLabel(s2, w);
label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
grid->addWidget(label, 5, 1);
label = new QLabel(tr("First Date"), w);
grid->addWidget(label, 6, 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, 6, 1);
}
label = new QLabel(tr("Last Date"), w);
grid->addWidget(label, 7, 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, 7, 1);
}
grid->setColStretch(1, 1);
vbox->insertStretch(-1, 0);
addTab(w, tr("Details"));
}
示例5: 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"));
}
示例6: 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);
//.........这里部分代码省略.........
示例7: 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);
//.........这里部分代码省略.........