本文整理汇总了C++中Q3HBoxLayout::addLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3HBoxLayout::addLayout方法的具体用法?C++ Q3HBoxLayout::addLayout怎么用?C++ Q3HBoxLayout::addLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3HBoxLayout
的用法示例。
在下文中一共展示了Q3HBoxLayout::addLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
StringListEdit::StringListEdit(const QStringList &list,
UntitledList* unamedList,
QWidget *parent)
: QDialog(parent),
ask(false),
duplicatesOk(false),
_suggestedStringsList(unamedList)
{
addCaption = "Add String";
addLabel = "String:";
editCaption = "Edit String";
editLabel = addLabel;
Q3HBoxLayout *hbox = new Q3HBoxLayout(this, 5, 5);
Q3VBoxLayout *vbox = new Q3VBoxLayout;
listBox = new Q3ListBox(this);
connect(listBox, SIGNAL(currentChanged(Q3ListBoxItem*)),
this, SLOT(updateButtons()));
hbox->addWidget(listBox, 1);
QPushButton *button = new QPushButton(tr("&Add..."), this);
connect(button, SIGNAL(clicked()), this, SLOT(addString()));
vbox->addWidget(button);
editButton = new QPushButton(tr("&Edit..."), this);
connect(editButton, SIGNAL(clicked()), this, SLOT(editString()));
vbox->addWidget(editButton);
removeButton = new QPushButton(tr("&Remove..."), this);
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeString()));
vbox->addWidget(removeButton);
upButton = new QPushButton(tr("&Up"), this);
connect(upButton, SIGNAL(clicked()), this, SLOT(moveUp()));
vbox->addWidget(upButton);
downButton = new QPushButton(tr("&Down"), this);
connect(downButton, SIGNAL(clicked()), this, SLOT(moveDown()));
vbox->addWidget(downButton);
vbox->addStretch(1);
button = new QPushButton(tr("OK"), this);
connect(button, SIGNAL(clicked()), this, SLOT(accept()));
vbox->addWidget(button);
button = new QPushButton(tr("Cancel"), this);
connect(button, SIGNAL(clicked()), this, SLOT(reject()));
vbox->addWidget(button);
hbox->addLayout(vbox);
setList(list);
}