本文整理汇总了C++中QVBox::layout方法的典型用法代码示例。如果您正苦于以下问题:C++ QVBox::layout方法的具体用法?C++ QVBox::layout怎么用?C++ QVBox::layout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVBox
的用法示例。
在下文中一共展示了QVBox::layout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
Kfind::Kfind(QWidget *parent, const char *name) : QWidget(parent, name)
{
kdDebug() << "Kfind::Kfind " << this << endl;
QBoxLayout *mTopLayout = new QBoxLayout(this, QBoxLayout::LeftToRight, KDialog::marginHint(), KDialog::spacingHint());
// create tabwidget
tabWidget = new KfindTabWidget(this);
mTopLayout->addWidget(tabWidget);
/*
* This is ugly. Might be a KSeparator bug, but it makes a small black
* pixel for me which is visually distracting (GS).
// create separator
KSeparator * mActionSep = new KSeparator( this );
mActionSep->setFocusPolicy( QWidget::ClickFocus );
mActionSep->setOrientation( QFrame::VLine );
mTopLayout->addWidget(mActionSep);
*/
// create button box
QVBox *mButtonBox = new QVBox(this);
QVBoxLayout *lay = (QVBoxLayout *)mButtonBox->layout();
lay->addStretch(1);
mTopLayout->addWidget(mButtonBox);
mSearch = new KPushButton(KGuiItem(i18n("&Find"), "find"), mButtonBox);
mButtonBox->setSpacing((tabWidget->sizeHint().height() - 4 * mSearch->sizeHint().height()) / 4);
connect(mSearch, SIGNAL(clicked()), this, SLOT(startSearch()));
mStop = new KPushButton(KGuiItem(i18n("Stop"), "stop"), mButtonBox);
connect(mStop, SIGNAL(clicked()), this, SLOT(stopSearch()));
mSave = new KPushButton(KStdGuiItem::saveAs(), mButtonBox);
connect(mSave, SIGNAL(clicked()), this, SLOT(saveResults()));
KPushButton *mClose = new KPushButton(KStdGuiItem::close(), mButtonBox);
connect(mClose, SIGNAL(clicked()), this, SIGNAL(destroyMe()));
// react to search requests from widget
connect(tabWidget, SIGNAL(startSearch()), this, SLOT(startSearch()));
mSearch->setEnabled(true); // Enable "Search"
mStop->setEnabled(false); // Disable "Stop"
mSave->setEnabled(false); // Disable "Save..."
dirlister = new KDirLister();
}