本文整理汇总了C++中QBoxLayout::addSpacing方法的典型用法代码示例。如果您正苦于以下问题:C++ QBoxLayout::addSpacing方法的具体用法?C++ QBoxLayout::addSpacing怎么用?C++ QBoxLayout::addSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QBoxLayout
的用法示例。
在下文中一共展示了QBoxLayout::addSpacing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlagRadioButton
LinkerTab::LinkerTab( QWidget * parent, const char * name )
: QWidget(parent, name), radioController(new FlagRadioButtonController()),
pathController(new FlagPathEditController()),
editController(new FlagEditController())
{
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
layout->setAutoAdd(true);
QVButtonGroup *map_group = new QVButtonGroup(i18n("Map File"), this);
QRadioButton *m_defaultMap = new QRadioButton(i18n("Off"), map_group);
m_defaultMap->setChecked(true);
new FlagRadioButton(map_group, radioController,
"-GS", i18n("Segments"));
new FlagRadioButton(map_group, radioController,
"-GP", i18n("Publics"));
new FlagRadioButton(map_group, radioController,
"-GD", i18n("Detailed"));
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
new FlagPathEdit(this, "", pathController,
"--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
"-$M", i18n("Reserved address space:"));
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
layout->addStretch();
}
示例2: FlagPathEdit
FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( QWidget * parent, const char * name )
:QWidget(parent, name), controller(new FlagCheckBoxController()),
pathController(new FlagPathEditController())
{
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
layout->setAutoAdd(true);
new FlagPathEdit(this, "", pathController,
"-FE", i18n("Write executables and units in:"));
new FlagPathEdit(this, "", pathController,
"-FU", i18n("Write units in:"));
new FlagPathEdit(this, "", pathController,
"-o", i18n("Executable name:"), KFile::File);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(20);
new FlagPathEdit(this, "", pathController,
"-e", i18n("Location of as and ld programs:"));
new FlagPathEdit(this, "", pathController,
"-FL", i18n("Dynamic linker executable:"), KFile::File);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(20);
new FlagPathEdit(this, "", pathController,
"-Fr", i18n("Compiler messages file:"), KFile::File);
new FlagPathEdit(this, "", pathController,
"-Fe", i18n("Write compiler messages to file:"), KFile::File);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addStretch();
}
示例3: QWidget
VidaliaExitWidget::VidaliaExitWidget(VidaliaConfigManager *vc, QWidget *parent)
: QWidget(parent), vidaliaConfig(vc)
{
QBoxLayout *layout = new QVBoxLayout(this);
QLabel *title = new QLabel(tr("To continue, you must exit Vidalia"));
title->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
title->setStyleSheet(QLatin1String("font-size:13pt"));
layout->addWidget(title);
layout->addSpacing(20);
QLabel *desc = new QLabel(tr("Look for the vidalia icon (<img src=':/graphics/vidalia-tray.png'>) in "
"the system tray and choose to exit.<br>Anything currently using Tor (such "
"as web downloads) will be interrupted."));
desc->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
layout->addWidget(desc);
layout->addSpacing(30);
QLabel *desc2 = new QLabel(tr("Configuration will continue automatically when Vidalia is closed."));
desc2->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
layout->addWidget(desc2);
layout->addStretch();
exitTimer = new QTimer(this);
connect(exitTimer, SIGNAL(timeout()), SLOT(checkVidalia()));
exitTimer->start(5000);
}
示例4: AboutInherited
//-----------------------------------------------------------------------------
About::About (QWidget * aParent, const char *aName, bool aInit)
: AboutInherited(aParent, aName)
{
QBoxLayout* box;
QLabel* lbl;
QFrame* frm;
QString str;
QFont fnt;
if (aInit) return;
box = new QVBoxLayout(this, 20, 6);
lblTheme = new QLabel(" ", this);
fnt = lblTheme->font();
fnt.setPointSize(fnt.pointSize() * 1.2);
lblTheme->setFont(fnt);
lblTheme->setMinimumSize(lblTheme->sizeHint());
lblTheme->setAutoResize(true);
box->addWidget(lblTheme);
lblVersion = new QLabel(" ", this);
lblVersion->setMinimumSize(lblVersion->sizeHint());
lblVersion->setAutoResize(true);
box->addWidget(lblVersion);
lblAuthor = new QLabel(" ", this);
lblAuthor->setMinimumSize(lblAuthor->sizeHint());
lblAuthor->setAutoResize(true);
box->addWidget(lblAuthor);
lblHomepage = new QLabel(" ", this);
lblHomepage->setMinimumSize(lblHomepage->sizeHint());
lblHomepage->setAutoResize(true);
box->addWidget(lblHomepage);
frm = new QFrame(this);
frm->setFrameStyle(QFrame::HLine|QFrame::Raised);
box->addSpacing(5);
box->addWidget(frm);
box->addSpacing(5);
lbl = new QLabel(i18n("KDE Theme Manager"), this);
lbl->setFont(fnt);
lbl->setMinimumSize(lbl->sizeHint());
box->addWidget(lbl);
str.sprintf(i18n("Version %s\n\n"
"Copyright (C) 1998 by\n%s\n\n"
"Gnu Public License (GPL)"),
KTHEME_VERSION,
"Stefan Taferner <[email protected]>\n"
"Waldo Bastian <[email protected]>");
lbl = new QLabel(str, this);
lbl->setMinimumSize(lbl->sizeHint());
box->addWidget(lbl);
box->addStretch(1000);
box->activate();
}
示例5: LicqDialog
//TODO Add a drop down list of the avaialable protocols
// that a user may be added for
AddUserDlg::AddUserDlg(CICQDaemon *s, const char* szId, unsigned long PPID,
QWidget *parent)
: LicqDialog(parent, "AddUserDialog")
{
server = s;
QBoxLayout *lay = new QBoxLayout(this, QBoxLayout::Down, 8);
QFrame *frmProtocol = new QFrame(this);
QFrame *frmUin = new QFrame(this);
QFrame *frmBtn = new QFrame(this);
lay->addWidget(frmProtocol);
lay->addWidget(frmUin);
lay->addSpacing(5);
lay->addStretch();
lay->addWidget(frmBtn);
QBoxLayout *layProtocol = new QBoxLayout(frmProtocol, QBoxLayout::LeftToRight);
lblProtocol = new QLabel(tr("Protocol:"), frmProtocol);
cmbProtocol = new QComboBox(frmProtocol);
layProtocol->addWidget(lblProtocol);
layProtocol->addWidget(cmbProtocol);
// Fill the combo list now
ProtoPluginsList pl;
ProtoPluginsListIter it;
server->ProtoPluginList(pl);
uint index = 0;
uint ppidIndex = 0;
for (it = pl.begin(); it != pl.end(); it++, ++index)
{
cmbProtocol->insertItem((*it)->Name());
if ((*it)->PPID() == PPID) ppidIndex = index;
}
cmbProtocol->setCurrentItem(ppidIndex);
QBoxLayout *layUin = new QBoxLayout(frmUin, QBoxLayout::LeftToRight);
lblUin = new QLabel(tr("New User ID:"), frmUin);
edtUin = new QLineEdit(frmUin);
layUin->addWidget(lblUin);
layUin->addWidget(edtUin);
if (szId != 0) edtUin->setText(szId);
QBoxLayout *layBtn = new QBoxLayout(frmBtn, QBoxLayout::LeftToRight);
btnOk = new QPushButton(tr("&Ok"), frmBtn);
btnCancel = new QPushButton(tr("&Cancel"), frmBtn);
layBtn->addStretch();
layBtn->addWidget(btnOk);
layBtn->addSpacing(20);
layBtn->addWidget(btnCancel);
setCaption(tr("Licq - Add User"));
connect (btnOk, SIGNAL(clicked()), SLOT(ok()) );
connect (edtUin, SIGNAL(returnPressed()), SLOT(ok()) );
connect (btnCancel, SIGNAL(clicked()), SLOT(reject()) );
// Set Tab Order
setTabOrder(edtUin, btnOk);
setTabOrder(btnOk, btnCancel);
}
示例6: QLabel
GTrans::GTrans() {
QLayout *mainLayout = new QVBoxLayout;
// The input section
QLayout *top = new QHBoxLayout;
QBoxLayout *tl = new QVBoxLayout;
QLabel *inLabel = new QLabel(tr("Input:"));
fromLang = new QComboBox;
tl->addWidget(inLabel);
tl->addSpacing(10);
tl->addWidget(fromLang);
tl->addStretch();
top->addItem(tl);
inputTxt = new QTextEdit;
top->addWidget(inputTxt);
// The output section
QLayout *bottom = new QHBoxLayout;
QBoxLayout *bl = new QVBoxLayout;
QLabel *outLabel = new QLabel(tr("Output:"));
toLang = new QComboBox;
bl->addWidget(outLabel);
bl->addSpacing(10);
bl->addWidget(toLang);
bl->addStretch();
bottom->addItem(bl);
outputTxt = new QTextEdit;
outputTxt->setReadOnly(true);
bottom->addWidget(outputTxt);
mainLayout->addItem(top);
mainLayout->addItem(bottom);
// Translate button
trans_b = new QPushButton(tr("Translate"));
mainLayout->addWidget(trans_b);
fillInLanguages();
setLayout(mainLayout);
setWindowTitle(tr("Translate"));
trans_b->setDefault(true);
connect(trans_b, SIGNAL(clicked()), this, SLOT(doTrans()));
// Setup foxus and tab order.
inputTxt->setTabChangesFocus(true);
inputTxt->setFocus(Qt::ActiveWindowFocusReason);
setTabOrder(inputTxt, toLang);
setTabOrder(toLang, trans_b);
setTabOrder(trans_b, fromLang);
setTabOrder(fromLang, inputTxt);
outputTxt->setFocusProxy(trans_b);
}
示例7: FlagCheckBox
DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
: QWidget(parent, name), controller(new FlagCheckBoxController()),
radioController(new FlagRadioButtonController)
{
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
// layout->setAutoAdd(true);
QVButtonGroup *optim_group = new QVButtonGroup(i18n("Optimization"), this);
new FlagCheckBox(optim_group, controller,
"'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
layout->addWidget(optim_group);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
new FlagCheckBox(debug_group, controller,
"'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
new FlagCheckBox(debug_group, controller,
"'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
gdb = new FlagCheckBox(debug_group, controller,
"-V", i18n("Debug information for GDB"));
namespacedb = new FlagCheckBox(debug_group, controller,
"-VN", i18n("Namespace debug info"));
symboldb = new FlagCheckBox(debug_group, controller,
"-VR", i18n("Write symbol info in an .rsm file"));
layout2->addWidget(debug_group);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
QVButtonGroup *debug_add = new QVButtonGroup(i18n("Symbol Reference Information"), this);
QRadioButton *m_default = new QRadioButton(i18n("Default (-$YD)"), debug_add);
m_default->setChecked(true);
new FlagRadioButton(debug_add, radioController,
"'-$Y-'", i18n("No information"));
new FlagRadioButton(debug_add, radioController,
"'-$YD'", i18n("Definition information"));
new FlagRadioButton(debug_add, radioController,
"'-$Y+'", i18n("Full reference information"));
layout2->addWidget(debug_add);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
QHBoxLayout *layout3 = new QHBoxLayout(layout, KDialog::spacingHint());
QPushButton *release = new QPushButton(i18n("Release"), this);
QPushButton *debug = new QPushButton(i18n("Debug"), this);
layout3->addWidget(release);
layout3->addWidget(debug);
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));
layout->addStretch();
}
示例8: FlagCheckBox
FeedbackTab::FeedbackTab(QWidget *parent, const char *name)
: QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
{
QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
layout->setAutoAdd(true);
QVButtonGroup *output_group = new QVButtonGroup(i18n("Output"), this);
new FlagCheckBox(output_group, controller,
"-vr", i18n("Format errors like GCC does"));
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
QVButtonGroup *verbose_group = new QVButtonGroup(i18n("Verbose"), this);
new FlagCheckBox(verbose_group, controller,
"-va", i18n("Write all possible info"));
new FlagCheckBox(verbose_group, controller,
"-v0", i18n("Write no messages"));
new FlagCheckBox(verbose_group, controller,
"-ve", i18n("Show only errors"));
new FlagCheckBox(verbose_group, controller,
"-vi", i18n("Show some general information"));
new FlagCheckBox(verbose_group, controller,
"-vw", i18n("Issue warnings"));
new FlagCheckBox(verbose_group, controller,
"-vn", i18n("Issue notes"));
new FlagCheckBox(verbose_group, controller,
"-vh", i18n("Issue hints"));
new FlagCheckBox(verbose_group, controller,
"-vd", i18n("Write other debugging info"));
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addSpacing(10);
QVButtonGroup *other_group = new QVButtonGroup(i18n("Other Information"), this);
new FlagCheckBox(other_group, controller,
"-vl", i18n("Show line numbers when processing files"));
new FlagCheckBox(other_group, controller,
"-vu", i18n("Print information on loaded units"));
new FlagCheckBox(other_group, controller,
"-vt", i18n("Print the names of loaded files"));
new FlagCheckBox(other_group, controller,
"-vm", i18n("Write which macros are defined"));
new FlagCheckBox(other_group, controller,
"-vc", i18n("Warn when processing a conditional"));
new FlagCheckBox(other_group, controller,
"-vp", i18n("Print the names of procedures and functions"));
new FlagCheckBox(other_group, controller,
"-vb", i18n("Show all procedure declarations if an overloaded function error occurs"));
QApplication::sendPostedEvents(this, QEvent::ChildInserted);
layout->addStretch();
}
示例9: reformat
/*!
Changes the status bar's appearance to account for item
changes. Special subclasses may need this, but normally
geometry management will take care of any necessary
rearrangements.
*/
void QStatusBar::reformat()
{
if ( d->box )
delete d->box;
QBoxLayout *vbox;
if ( isSizeGripEnabled() ) {
d->box = new QHBoxLayout( this );
vbox = new QVBoxLayout( d->box );
} else {
vbox = d->box = new QVBoxLayout( this );
}
vbox->addSpacing( 3 );
QBoxLayout* l = new QHBoxLayout( vbox );
l->addSpacing( 3 );
int maxH = fontMetrics().height();
QStatusBarPrivate::SBItem* item = d->items.first();
while ( item && !item->p ) {
l->addWidget( item->w, item->s );
l->addSpacing( 4 );
int itemH = item->w->sizeHint().height();
maxH = QMAX( maxH, itemH );
item = d->items.next();
}
l->addStretch( 0 );
while ( item ) {
l->addWidget( item->w, item->s );
l->addSpacing( 4 );
int itemH = item->w->sizeHint().height();
maxH = QMAX( maxH, itemH );
item = d->items.next();
}
#ifndef QT_NO_SIZEGRIP
if ( d->resizer ) {
maxH = QMAX( maxH, d->resizer->sizeHint().height() );
d->box->addSpacing( 2 );
d->box->addWidget( d->resizer, 0, AlignBottom );
}
#endif
l->addStrut( maxH );
vbox->addSpacing( 2 );
d->box->activate();
repaint();
}
示例10: CreateLayout
// =============================================================================
void ProgressDlg::CreateLayout()
{
mStatusLabel = new QLabel( tr( "" ) );
mStatusLabel->setAlignment( Qt::AlignTop | Qt::AlignLeft );
mStatusLabel->setWordWrap( true );
QVBoxLayout *lLayout = new QVBoxLayout;
QBoxLayout *lBoxLayout = new QBoxLayout(QBoxLayout::LeftToRight);
lBoxLayout->addSpacing(30);
lBoxLayout->addWidget( mStatusLabel);
lLayout->addLayout(lBoxLayout);
setLayout( lLayout );
setFixedSize( 400, 120 );
Qt::WindowFlags lFlags = windowFlags();
lFlags |= Qt::CustomizeWindowHint;
lFlags &= ~Qt::WindowContextHelpButtonHint;
lFlags &= ~Qt::WindowSystemMenuHint;
lFlags &= ~Qt::WindowCloseButtonHint;
setWindowFlags( lFlags );
mWheel = new QPixmap (":GEVPlayer/res/wheel.bmp");
mWheel->setMask(mWheel->createMaskFromColor(QColor(0xFF, 0xFF, 0xFF)));
setWindowTitle( tr( "Connection Progress" ) );
}
示例11: drv_boxlayout
int drv_boxlayout(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
handle_head* head = (handle_head*)a0;
QBoxLayout *self = (QBoxLayout*)head->native;
switch (drvid) {
case BOXLAYOUT_ADDLAYOUTWITH: {
self->addLayout((QLayout*)drvGetNative(a1),drvGetInt(a2));
break;
}
case BOXLAYOUT_ADDWIDGETWITH: {
self->addWidget((QWidget*)drvGetNative(a1),drvGetInt(a2),Qt::Alignment(drvGetInt(a3)));
break;
}
case BOXLAYOUT_ADDSPACING: {
self->addSpacing(drvGetInt(a1));
break;
}
case BOXLAYOUT_ADDSTRETCH: {
self->addStretch(drvGetInt(a1));
break;
}
default:
return 0;
}
return 1;
}
示例12: QPushButton
SynCELocalKonnectorConfig::SynCELocalKonnectorConfig( QWidget *parent, const char *name )
: SynCEKonnectorConfigBase( parent, name )
{
QBoxLayout * topLayout = new QVBoxLayout( this );
topLayout->addWidget( new QLabel( i18n( "Calendar file:" ), this ) );
mCalendarFile = new KURLRequester( this );
mCalendarFile->setMode( KFile::File | KFile::LocalOnly );
topLayout->addWidget( mCalendarFile );
QPushButton *button =
new QPushButton( i18n( "Select From Existing Calendars..." ), this );
connect( button, SIGNAL( clicked() ), SLOT( selectCalendarResource() ) );
topLayout->addWidget( button );
topLayout->addSpacing( 4 );
topLayout->addWidget( new QLabel( i18n( "Address book file:" ), this ) );
mAddressBookFile = new KURLRequester( this );
mAddressBookFile->setMode( KFile::File | KFile::LocalOnly );
topLayout->addWidget( mAddressBookFile );
button = new QPushButton( i18n( "Select From Existing Address Books..." ), this );
connect( button, SIGNAL( clicked() ), SLOT( selectAddressBookResource() ) );
topLayout->addWidget( button );
}
示例13: LicqDialog
ShowAwayMsgDlg::ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager* _sigman,
const char *szId, unsigned long nPPID, QWidget *parent)
: LicqDialog(parent, "ShowAwayMessageDialog")
{
m_szId = szId ? strdup(szId) : 0;
m_nPPID = nPPID;
sigman = _sigman;
server = _server;
QBoxLayout* top_lay = new QVBoxLayout(this, 10);
mleAwayMsg = new MLEditWrap(true, this);
// ICQ99b allows 37 chars per line, so we do the same
//mleAwayMsg->setWordWrap(QMultiLineEditNew::FixedColumnWidth);
//mleAwayMsg->setWrapColumnOrWidth(37);
mleAwayMsg->setReadOnly(true);
mleAwayMsg->setMinimumSize(230, 110);
connect(mleAwayMsg, SIGNAL(signal_CtrlEnterPressed()), SLOT(accept()));
top_lay->addWidget(mleAwayMsg);
QBoxLayout* lay = new QHBoxLayout(top_lay, 10);
chkShowAgain = new QCheckBox(tr("&Show Again"), this);
lay->addWidget(chkShowAgain);
lay->addStretch(1);
lay->addSpacing(30);
ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R);
QTextCodec * codec = UserCodec::codecForICQUser(u);
// chkShowAgain->setChecked(u->ShowAwayMsg());
setCaption(QString(tr("%1 Response for %2")).arg(u->StatusStr()).arg(QString::fromUtf8(u->GetAlias())));
btnOk = new QPushButton(tr("&Ok"), this);
btnOk->setMinimumWidth(75);
btnOk->setDefault(true);
btnOk->setFocus();
connect(btnOk, SIGNAL(clicked()), SLOT(accept()));
lay->addWidget(btnOk);
// Check if this is an active request or not
if (sigman == NULL || server == NULL)
{
mleAwayMsg->setText(codec->toUnicode(u->AutoResponse()));
gUserManager.DropUser(u);
icqEventTag = 0;
}
else
{
bool bSendServer = (u->SocketDesc(ICQ_CHNxNONE) <= 0 && u->Version() > 6);
gUserManager.DropUser(u);
mleAwayMsg->setEnabled(false);
mleAwayMsg->setBackgroundMode(PaletteBackground);
connect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(doneEvent(ICQEvent *)));
icqEventTag = server->icqFetchAutoResponse(szId, nPPID, bSendServer);
}
show();
}
示例14: addToolBarToLayout
static void addToolBarToLayout( QMainWindowPrivate::ToolBarDock * dock,
QBoxLayout * tl,
QBoxLayout::Direction direction,
QBoxLayout::Direction dockDirection,
bool mayNeedDockLayout,
bool justify,
GUIStyle style )
{
if ( !dock || dock->isEmpty() )
return;
bool moreThanOneRow = FALSE;
bool anyToolBars = FALSE;
dock->first();
while ( dock->next() ) {
if ( dock->current()->nl ) {
moreThanOneRow = TRUE;
break;
}
}
QBoxLayout * dockLayout;
if ( mayNeedDockLayout && moreThanOneRow ) {
dockLayout = new QBoxLayout( dockDirection );
tl->addLayout( dockLayout );
} else {
dockLayout = tl;
}
QBoxLayout * toolBarRowLayout = 0;
QMainWindowPrivate::ToolBar * t = dock->first();
do {
if ( !toolBarRowLayout || t->nl ) {
if ( toolBarRowLayout ) {
if ( !justify )
toolBarRowLayout->addStretch( 1 );
}
toolBarRowLayout = new QBoxLayout( direction );
dockLayout->addLayout( toolBarRowLayout, 0 );
}
if ( t->t->isVisible() && !t->t->testWFlags( WState_DoHide ) ) {
toolBarRowLayout->addWidget( t->t, 0 );
anyToolBars = TRUE;
}
} while ( (t=dock->next()) != 0 );
if ( anyToolBars && style == MotifStyle )
dockLayout->addSpacing( 2 );
if ( toolBarRowLayout && (!justify || !anyToolBars) )
toolBarRowLayout->addStretch( 1 );
}
示例15: QWidget
TitleBarWidget::TitleBarWidget(ToolWindow *window) :
QWidget(window), collapsed_icon(":/images/ic_unfold_more_48px.svg"), expanded_icon(":/images/ic_unfold_less_48px.svg"), tool_window(window)
{
QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
layout->setContentsMargins(4, 4, 20, 4);
layout->setAlignment(Qt::AlignLeft);
setLayout(layout);
addButton(layout, ":/images/ic_close_48px.svg", (ToolWindowSlot)&ToolWindow::close);
layout->addSpacing(3);
expand_button = addButton(layout, NULL, (ToolWindowSlot)&ToolWindow::slot_toggleExpand);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}