本文整理汇总了C++中Q3HBoxLayout类的典型用法代码示例。如果您正苦于以下问题:C++ Q3HBoxLayout类的具体用法?C++ Q3HBoxLayout怎么用?C++ Q3HBoxLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Q3HBoxLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
CBrushProperties::CBrushProperties (QWidget * parent, const char *name):
QWidget (parent, name)
{
Q3HBoxLayout *topLayout = new Q3HBoxLayout (this);
QLabel *title = new QLabel (this);
title->setText ("Brush width :");
topLayout->addWidget (title);
textBox1 = new QLineEdit (this, "brustoolsizechooser");
textBox1->setText ("10");
textBox1->show ();
textBox1->setMaximumWidth (50);
topLayout->addWidget (textBox1);
QLabel *label1 = new QLabel (this);
label1->setText (" just enter width walue end start to draw.");
label1->adjustSize ();
topLayout->addWidget (label1);
// QPushButton *pushButton1=new QPushButton(this);
// pushButton1->setText("Set width");
// connect(pushButton1,SLOT(clicked()),this,SIGNAL());
}
示例2: QWidget
//===========================================================
//
void ImportWizard::setupDstType()
{
m_dstTypePage = new QWidget(this);
KexiDB::DriverManager manager;
KexiDB::Driver::InfoHash drvs = manager.driversInfo();
Q3VBoxLayout *vbox = new Q3VBoxLayout(m_dstTypePage, KDialog::marginHint());
Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox);
QLabel *lbl = new QLabel(i18n("Destination database type:") + " ", m_dstTypePage);
lbl->setAlignment(Qt::AlignAuto | Qt::AlignTop);
hbox->addWidget(lbl);
m_dstPrjTypeSelector = new KexiPrjTypeSelector(m_dstTypePage);
hbox->addWidget(m_dstPrjTypeSelector);
m_dstPrjTypeSelector->option_file->setText(i18n("Database project stored in a file"));
m_dstPrjTypeSelector->option_server->setText(i18n("Database project stored on a server"));
QVBoxLayout *frame_server_vbox = new QVBoxLayout(
m_dstPrjTypeSelector->frame_server, KDialog::spacingHint());
m_dstServerTypeCombo = new KexiDBDriverComboBox(m_dstPrjTypeSelector->frame_server, drvs,
KexiDBDriverComboBox::ShowServerDrivers);
frame_server_vbox->addWidget(m_dstServerTypeCombo);
hbox->addStretch(1);
vbox->addStretch(1);
lbl->setBuddy(m_dstServerTypeCombo);
//! @todo hardcoded: find a way to preselect default engine item
//m_dstTypeCombo->setCurrentText("SQLite3");
addPage(m_dstTypePage, i18n("Select Destination Database Type"));
}
示例3: QDialog
GearPropertiesDialog::GearPropertiesDialog(QWidget *parent, Gear *gear, Engine *engine) :
QDialog(parent, "Properties", true),
_gear(gear),
_engine(engine)
{
setCaption("Properties");
_verticalLayout = new Q3VBoxLayout(this, 12, 12, "layout");
std::vector<Property*> properties;
_gear->settings().getAll(&properties);
//create all PropertieControls for the gear
for (std::vector<Property*>::iterator it=properties.begin(); it!=properties.end(); ++it)
addControl((*it));
//ok cancels
Q3HBoxLayout *hLayout = new Q3HBoxLayout(2);
_okButton = new QPushButton("Ok", this);
hLayout->addWidget(_okButton);
QObject::connect(_okButton, SIGNAL(clicked()), this, SLOT(slotOK()));
_cancelButton = new QPushButton("Cancel", this);
QObject::connect(_cancelButton, SIGNAL(clicked()), this, SLOT(accept()));
hLayout->addWidget(_cancelButton);
_verticalLayout->addLayout(hLayout);
}
示例4: QDialog
ConfigForm::ConfigForm(int aCurrentIntervalValue, QWidget *parent,
const char *name,
bool modal, Qt::WFlags f)
: QDialog( parent, name, modal, f ),
mApplyButton(kNULL), mCancelButton(kNULL)
{
mMinVal_Sec = float(kMIN_POLLING_INT) / 1000.f;
mMaxVal_Sec = float(kMAX_POLLING_INT) / 1000.f;
REG_DBGMSG1("ARPDBG: min val = ", mMinVal_Sec);
REG_DBGMSG1("ARPDBG: max val = ", mMaxVal_Sec);
REG_DBGCON("ConfigForm");
// note aCurrentIntervalValue is in milliseconds - convert to
// seconds for GUI entry
this->setCaption( "Configure Polling" );
resize( 150, 150 );
// create the layouts for the form
Q3VBoxLayout *lFormLayout = new Q3VBoxLayout(this, 10, 10, "configformlayout");
Q3HBoxLayout *lButtonLayout = new Q3HBoxLayout(6, "configbuttonlayout");
lFormLayout->addWidget(new QLabel("Enter interval value (seconds) \n"
"Valid range: "
+QString::number(mMinVal_Sec)
+" - "+QString::number(mMaxVal_Sec)
+" (2 d.p.)", this));
mLineEdit = new QLineEdit( this );
double lVal = (double) aCurrentIntervalValue/1000;
mLineEdit->setText(QString::number(lVal, 'g', 3));
mLineEdit->setValidator( new QDoubleValidator(mLineEdit, "dbleavlidator" ) );
lFormLayout->addWidget( mLineEdit);
mApplyButton = new QPushButton("Apply", this, "Applybutton"); \
mApplyButton->setAutoDefault(FALSE);
QToolTip::add(mApplyButton, "Apply to steerer");
connect(mApplyButton, SIGNAL(clicked()), this, SLOT(applySlot()));
mCancelButton = new QPushButton("Cancel", this, "cancelbutton");
mCancelButton->setAutoDefault(FALSE);
connect(mCancelButton, SIGNAL(clicked()), this, SLOT( reject()));
mCancelButton->setMinimumSize(mCancelButton->sizeHint());
mCancelButton->setMaximumSize(mCancelButton->sizeHint());
mApplyButton->setMinimumSize(mCancelButton->sizeHint());
mApplyButton->setMaximumSize(mApplyButton->sizeHint());
lButtonLayout->addWidget(mApplyButton);
lButtonLayout->addWidget(mCancelButton);
lFormLayout->addLayout(lButtonLayout);
}
示例5: QWidget
TicTacToe::TicTacToe( bool meFirst, int boardSize, QWidget *parent, const char *name )
: QWidget( parent, name )
{
Q3VBoxLayout * l = new Q3VBoxLayout( this, 6 );
// Create a message label
message = new QLabel( this );
message->setFrameStyle( Q3Frame::WinPanel | Q3Frame::Sunken );
message->setAlignment( Qt::AlignCenter );
l->addWidget( message );
// Create the game board and connect the signal finished() to this
// gameOver() slot
board = new TicTacGameBoard( meFirst, boardSize, this );
connect( board, SIGNAL(finished()), SLOT(gameOver()) );
l->addWidget( board );
// Create a horizontal frame line
Q3Frame *line = new Q3Frame( this );
line->setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken );
l->addWidget( line );
// Create the combo box for deciding who should start, and
// connect its clicked() signals to the buttonClicked() slot
whoStarts = new QComboBox( this );
whoStarts->insertItem( "Opponent starts" );
whoStarts->insertItem( "You start" );
l->addWidget( whoStarts );
whoStarts->setEnabled(false);
whoStarts->setCurrentIndex(meFirst);
// Create the push buttons and connect their clicked() signals
// to this right slots.
connect( board, SIGNAL(myMove(int)), this, SIGNAL(myMove(int)));
connect( board, SIGNAL(stateChanged()), this, SLOT(newState()));
newGame = new QPushButton( "Play!", this );
connect( newGame, SIGNAL(clicked()), SLOT(newGameClicked()) );
newGame->setEnabled(false);
quit = new QPushButton( "Quit", this );
connect( quit, SIGNAL(clicked()), this, SIGNAL(closing()) );
Q3HBoxLayout * b = new Q3HBoxLayout;
l->addLayout( b );
b->addWidget( newGame );
b->addWidget( quit );
newState();
//board->newGame();
newGameClicked();
}
示例6: QWidget
QWidget * QSettingColorTableItem::createEditor() const
{
QWidget * pBox = new QWidget(table()->viewport());
Q3HBoxLayout * pBoxLayout = new Q3HBoxLayout(pBox);
QLineEdit * pEdit = new QLineEdit(pBox, "editor");
QColorPushButton * pButton = new QColorPushButton(pEdit, "...", pBox, "colorbutton");
pBoxLayout->addWidget(pEdit, 1);
pBoxLayout->addWidget(pButton);
pBox->setFocusProxy(pEdit);
pEdit->setText(pButton->m_strColor = text());
return pBox;
}
示例7: QDialog
AboutDialog::AboutDialog() : QDialog(0, "About DoUML", TRUE)
{
setCaption(TR("About DoUML"));
//move(p);
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3HBoxLayout * hbox;
vbox->setMargin(5);
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPixmap bp((const char **) bp_xpm);
// QLabel * lbp = new QLabel(this);
// lbp->setPixmap(bp);
// hbox->addWidget(lbp);
hbox->addWidget(new QLabel(" ", this));
// Replacing about to bouml-ng
const char htmltext[] = "<p>DoUML</p>\n"
"<p>This project is a fork of\n"
"Bruno Pages's work, BoUML:\n"
"<i>http://sourceforge.net/projects/douml/</i></p>\n"
"<p>DoUML focus is to port BoUML to Qt4\n"
"and to maintain it as a community</p>\n"
"<p>Join us at:<br>\n"
"https://github.com/leonardo2d/douml/<br>\n"
"#[email protected]</p>\n\n\n";
Q3TextView * tx =
new Q3TextView(htmltext, QString(), this);
QFont fnt = tx->font();
fnt.setItalic(TRUE);
QFontMetrics fm(fnt);
tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
tx->setMinimumSize(fm.size(0, htmltext));
hbox->addWidget(tx);
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPushButton * ok = new QPushButton(TR("&OK"), this);
ok->setDefault(TRUE);
hbox->addWidget(new QLabel(this));
hbox->addWidget(ok);
hbox->addWidget(new QLabel(this));
if (UmlDesktop::fixed())
UmlDesktop::tocenter(this);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
示例8: QWidget
VTabWidget::VTabWidget(VTabPosition p,QWidget* parent, const char* name): QWidget(parent, name)
{
m_position = p;
Q3HBoxLayout *layout = new Q3HBoxLayout(this);
m_bar = new VTabBar(p,this);
m_wStack = new Q3WidgetStack(this);
layout->addWidget(m_bar,0);
layout->addWidget(m_wStack,5);
m_autoIndexer = 0;
m_wStack->hide();
connect(m_bar,SIGNAL(allTabsOff()),m_wStack,SLOT(hide()));
connect(m_bar, SIGNAL(activatedTab(int)), this, SLOT(setCurrentPage(int)));
connect(m_bar,SIGNAL(allTabsOff()),this,SIGNAL(widgetStackHidden()));
connect(m_bar,SIGNAL(activatedTab(int)),this,SIGNAL(widgetStackShown()));
}
示例9: QDialog
AboutDialog::AboutDialog() : QDialog(0, "About " PROJECT_NAME, TRUE) {
setCaption(TR("About " PROJECT_NAME));
//move(p);
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3HBoxLayout * hbox;
vbox->setMargin(5);
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPixmap bp((const char **) bp_xpm);
QLabel * lbp = new QLabel(this);
// lbp->setPixmap(bp);
// hbox->addWidget(lbp);
hbox->addWidget(new QLabel(" ", this));
QString htmltext;
htmltext.sprintf("%s <b>%d.%d-%d</b> release <b>%s</b><br>\n"
"<br>\n"
"<i>%s</i><br>\n"
"<br>\n"
"%s (<i>%s</i>)",
PROJECT_NAME, PROJECT_MAJOR, PROJECT_MINOR, PROJECT_REVISION, PROJECT_RELEASE,
PROJECT_HOME, PROJECT_ADMIN, PROJECT_CONTACT);
Q3TextView * tx =
new Q3TextView(htmltext, QString::null, this);
QFont fnt = tx->font();
fnt.setItalic(TRUE);
QFontMetrics fm(fnt);
tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
tx->setMinimumSize(fm.size(0, htmltext));
hbox->addWidget(tx);
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPushButton * ok = new QPushButton(TR("&OK"), this);
ok->setDefault( TRUE );
hbox->addWidget(new QLabel(this));
hbox->addWidget(ok);
hbox->addWidget(new QLabel(this));
if (UmlDesktop::fixed())
UmlDesktop::tocenter(this);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
示例10: 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);
}
示例11: setPosition
void VTabWidget::setPosition(VTabPosition p)
{
if(m_position == p)
return;
m_position = p;
Q3HBoxLayout *l = (Q3HBoxLayout*)layout();
if(!l)
{
qWarning( "Error layout is null");
return;
}
l->remove(m_wStack);
l->remove(m_bar);
m_bar->setPosition(p);
if(p == TabLeft)
{
l->addWidget(m_bar,0);
l->addWidget(m_wStack,5);
}
else
{
l->addWidget(m_wStack,5);
l->addWidget(m_bar,0);
}
}
示例12: QDialog
BrowserSearchDialog::BrowserSearchDialog(const QPoint & p)
: QDialog(0, "Browser search", TRUE) {
setCaption("Browser search");
move(p);
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
vbox->setMargin(5);
Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/);
ed = new QLineEdit(this);
ed->setText(saved_ed);
gl->addWidget(new QLabel("Containing", this), 1, 0, Qt::AlignLeft);
gl->addWidget(ed, 1, 1);
Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, this);
case_sensitive = new QCheckBox("case sensitive", gb);
case_sensitive->setChecked(saved_case_sensitive);
gl->addWidget(gb, 2, 1);
gl->addWidget(new QLabel("Result", this), 3, 0, Qt::AlignLeft);
results = new Q3ComboBox(FALSE, this);
gl->addWidget(results, 3, 1);
Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPushButton * search_b = new QPushButton("Search", this);
QPushButton * select_b = new QPushButton("Select", this);
QPushButton * close_b = new QPushButton("Close", this);
search_b->setDefault(TRUE);
hbox->addWidget(search_b);
hbox->addWidget(select_b);
hbox->addWidget(close_b);
connect(search_b, SIGNAL(clicked()), this, SLOT(search()));
connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
setMaximumHeight(sizeHint().height());
}
示例13: QWidget
KexiCSVInfoLabel::KexiCSVInfoLabel(const QString& labelText, QWidget* parent)
: QWidget(parent)
{
Q3VBoxLayout *vbox = new Q3VBoxLayout(this, 0, KDialog::spacingHint());
Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
vbox->addLayout(hbox);
m_leftLabel = new QLabel(labelText, this);
m_leftLabel->setMinimumWidth(130);
m_leftLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
m_leftLabel->setWordWrap(true);
hbox->addWidget(m_leftLabel);
m_iconLbl = new QLabel(this);
m_iconLbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
m_iconLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
m_fnameLbl = new QLabel(this);
m_fnameLbl->setOpenExternalLinks(true);
m_fnameLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
m_fnameLbl->setFocusPolicy(Qt::NoFocus);
m_fnameLbl->setTextFormat(Qt::PlainText);
m_fnameLbl->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 1, 0));
m_fnameLbl->setLineWidth(1);
m_fnameLbl->setFrameStyle(Q3Frame::Box);
m_fnameLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
m_fnameLbl->setWordWrap(true);
hbox->addSpacing(5);
hbox->addWidget(m_iconLbl);
hbox->addWidget(m_fnameLbl, 1, Qt::AlignVCenter | Qt::AlignLeft
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
);
hbox->addSpacing(10);
m_commentLbl = new QLabel(this);
m_commentLbl->setOpenExternalLinks(true);
m_commentLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
m_commentLbl->setFocusPolicy(Qt::NoFocus);
m_commentLbl->setTextFormat(Qt::PlainText);
m_commentLbl->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_commentLbl->setLineWidth(1);
m_commentLbl->setFrameStyle(QFrame::Box);
m_commentLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
m_commentLbl->setWordWrap(true);
hbox->addWidget(m_commentLbl, 0, Qt::AlignVCenter | Qt::AlignRight
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
);
m_separator = new Q3Frame(this);
m_separator->setFrameShape(Q3Frame::HLine);
m_separator->setFrameShadow(Q3Frame::Sunken);
vbox->addWidget(m_separator);
}
示例14: QDialog
OperationListDialog::OperationListDialog(const char * m,
Q3PtrList<BrowserOperation> & l)
: QDialog(0, m, TRUE) {
setCaption(m);
move(QCursor::pos());
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3HBoxLayout * hbox;
vbox->setMargin(5);
cb = new Q3ComboBox(FALSE, this);
vbox->addWidget(cb);
for (BrowserOperation * oper = l.first(); oper; oper = l.next()) {
QString s = ((BrowserNode *) oper->parent())->get_name() +
QString("::") + oper->get_data()->definition(TRUE, FALSE);
if (((OperationData *) oper->get_data())->get_is_abstract())
cb->insertItem("[a] " + s);
else
cb->insertItem(s);
}
hbox = new Q3HBoxLayout(vbox);
hbox->setMargin(5);
QPushButton * ok = new QPushButton(TR("&OK"), this);
QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
QSize bs(cancel->sizeHint());
ok->setDefault(TRUE);
ok->setFixedSize(bs);
cancel->setFixedSize(bs);
hbox->addWidget(ok);
hbox->addWidget(cancel);
UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
示例15: KDialog
SetKeySig::SetKeySig(int keySig, QWidget *parent)
: KDialog(parent)
{
setCaption(i18n("Key signature"));
setButtons(Ok | Cancel);
setModal(true);
QWidget *page = new QWidget(this);
setMainWidget(page);
QStringList signatures;
signatures
<< i18n("7 sharps") + " (C#/A#m)"
<< i18n("6 sharps") + " (F/D#m)"
<< i18n("5 sharps") + " (B/G#m)"
<< i18n("4 sharps") + " (E/C#m)"
<< i18n("3 sharps") + " (A/F#m)"
<< i18n("2 sharps") + " (D/Bm)"
<< i18n("1 sharp") + " (G/Em)"
<< i18n("none") + " (C/Am)"
<< i18n("1 flat") + " (F/Dm)"
<< i18n("2 flats") + " (Bb/Gm)"
<< i18n("3 flats") + " (Eb/Cm)"
<< i18n("4 flats") + " (Ab/Fm)"
<< i18n("5 flats") + " (Db/Bbm)"
<< i18n("6 flats") + " (Gb/Ebm)"
<< i18n("7 flats") + " (Cb/Abm)";
sig = new QComboBox(TRUE, page);
sig->setEditable(false);
sig->setInsertionPolicy(QComboBox::NoInsertion);
sig->insertStringList(signatures);
sig->setCurrentItem(7 - keySig);
QLabel *sig_l = new QLabel(sig, i18n("Flats / sharps:"), page);
Q3HBoxLayout *l = new Q3HBoxLayout(page, 0, spacingHint());
l->addWidget(sig_l);
l->addWidget(sig);
l->activate();
}