当前位置: 首页>>代码示例>>C++>>正文


C++ Q3VBoxLayout类代码示例

本文整理汇总了C++中Q3VBoxLayout的典型用法代码示例。如果您正苦于以下问题:C++ Q3VBoxLayout类的具体用法?C++ Q3VBoxLayout怎么用?C++ Q3VBoxLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Q3VBoxLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

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"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:29,代码来源:Preferences.cpp

示例2: QDialog

ConstraintDialog::ConstraintDialog(ConstraintCanvas * c)
    : QDialog(0, "ConstraintVisibilityDialog", TRUE, 0), constraint(c)
{
    setCaption(TR("Constraints visibility dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    table = new ConstraintTable(this, constraint);
    vbox->addWidget(table);
    vbox->addWidget(new QLabel(this));

    Q3HBoxLayout * hbox;

    hbox = new Q3HBoxLayout(vbox);

    cb_visible = new QCheckBox(TR("Specify visible elements rather than hidden ones"), this);
    cb_visible->setChecked(constraint->indicate_visible);
    hbox->addWidget(cb_visible);

    QPushButton * showall = new QPushButton(TR("Show all"), this);
    QPushButton * hideall = new QPushButton(TR("Hide all"), this);
    QPushButton * hideinherited = new QPushButton(TR("Hide inherited"), this);
    QSize bs = hideinherited->sizeHint();

    showall->setFixedSize(bs);
    hideall->setFixedSize(bs);
    hideinherited->setFixedSize(bs);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(showall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideinherited);
    hbox->addWidget(new QLabel(this));

    connect(showall, SIGNAL(clicked()), this, SLOT(show_all()));
    connect(hideall, SIGNAL(clicked()), this, SLOT(hide_all()));
    connect(hideinherited, SIGNAL(clicked()), this, SLOT(hide_inherited()));

    vbox->addWidget(new QLabel(this));
    hbox = new Q3HBoxLayout(vbox);

    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);

    ok->setDefault(TRUE);
    bs = cancel->sizeHint();
    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(ok);
    hbox->addWidget(cancel);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:harmegnies,项目名称:douml,代码行数:60,代码来源:ConstraintDialog.cpp

示例3: 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"));
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:34,代码来源:importwizard.cpp

示例4: QWidget

CColorDialog::CColorDialog (QWidget * parent, const char *name, F4lmApp * p):
        QWidget (parent, name)
{
        //QColor renk;
        //renk=QColorDialog::getColor(renk,this);
    realp = p;

    Q3VBoxLayout *topLayout = new Q3VBoxLayout (this);

    Q3ButtonGroup *ToolsButtonGroup =new Q3ButtonGroup (this, "ToolsButtonGroup");
    ToolsButtonGroup->setGeometry (QRect (150, 70, 71, 291));
    ToolsButtonGroup->setLineWidth (0);
    ToolsButtonGroup->setTitle (trUtf8 (""));

    QToolButton *ToolButton1 =new QToolButton (ToolsButtonGroup, "ToolButton1");
    ToolButton1->setGeometry (QRect (0, 10, 30, 30));
    ToolButton1->setText (trUtf8 ("CC"));
    connect (ToolButton1, SIGNAL (clicked ()), this,SLOT (slotColorChooser ()));

    QToolButton *ToolButton2 =new QToolButton (ToolsButtonGroup, "ToolButton2");
    ToolButton2->setGeometry (QRect (30, 10, 30, 30));
    ToolButton2->setText (trUtf8 ("..."));

        //CColorSwatches* s=new CColorSwatches(this,"color_swatches",p);
    topLayout->addWidget (ToolsButtonGroup);
        //topLayout->addWidget(s);
}
开发者ID:ozkanpakdil,项目名称:f4l,代码行数:27,代码来源:ccolordialog.cpp

示例5: KDialog

RenameImagesDialog::RenameImagesDialog(const KUrl::List& images,
                                       KIPI::Interface* interface,
                                       QWidget* parent)
    : KDialog(parent)
{
    setCaption(i18n("Rename Images"));
    setModal(true);
    setButtons(Help | User1 | Close);
    setButtonText(User1, i18n("&Start"));
    setDefaultButton(Close);
    // About data and help button.

    m_about = new KIPIPlugins::KPAboutData(ki18n("Batch-rename images"),
                                           QByteArray(),
                                           KAboutData::License_GPL,
                                           ki18n("A Kipi plugin to batch-rename images"),
                                           ki18n("(c) 2003-2007, Gilles Caulier"));

    m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Author and maintainer"),
                       "caulier dot gilles at gmail dot com");

    DialogUtils::setupHelpButton(this, m_about);
    // gui

    QWidget* box = new QWidget(this);
    setMainWidget(box);
    Q3VBoxLayout* lay = new Q3VBoxLayout(box);
    m_widget = new RenameImagesWidget(box, interface, images);
    lay->addWidget(m_widget);

    connect(this, SIGNAL(user1Clicked()),
            m_widget, SLOT(slotStart()));
    
    adjustSize();
}
开发者ID:ruphy,项目名称:kipi-plugins,代码行数:35,代码来源:renameimagesdialog.cpp

示例6: main

int main(int argc, char** argv)
{
    // Initialise the program
    KCmdLineArgs::init(argc, argv, "kexidbcomboboxtest", 0, KLocalizedString(), "", KLocalizedString(), true);
    KApplication* app = new KApplication(true, true);

    // Look for installed database drivers
    KDbDriverManager manager;
    KDbDriver::InfoHash drvs = manager.driversInfo();

    // Set up a combo box and a quit widget in a new container
    QWidget* vbox = new QWidget();
    Q3VBoxLayout* vbLayout = new Q3VBoxLayout(vbox);

    KexiDBDriverComboBox* all = new KexiDBDriverComboBox(vbox, drvs);
    KexiDBDriverComboBox* srvOnly = new KexiDBDriverComboBox(vbox, drvs,
            KexiDBDriverComboBox::ShowServerDrivers);

    QPushButton* quit = new QPushButton("Quit", vbox);

    vbLayout->addWidget(all);     // Combobox listing all drivers
    vbLayout->addWidget(srvOnly); // Combobox only drivers for DB servers
    vbLayout->addWidget(quit);

    // Show the whole lot
    QObject::connect(quit, SIGNAL(clicked()), app, SLOT(quit()));
    vbox->show();
    app->exec();

    delete app;
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:31,代码来源:kexidbdrivercombotest.cpp

示例7: QWidget

TesterRulePage::TesterRulePage (QWidget *p) : QWidget (p)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
    vbox->setMargin(5);
    vbox->setSpacing(5);

    Q3GridLayout *grid = new Q3GridLayout(vbox, 2, 2);

    Q3VGroupBox *gbox = new Q3VGroupBox(tr("Enter Long"), this);
    grid->addWidget(gbox, 0, 0);

    enterLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Long"), this);
    grid->addWidget(gbox, 0, 1);

    exitLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Enter Short"), this);
    grid->addWidget(gbox, 1, 0);

    enterShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Short"), this);
    grid->addWidget(gbox, 1, 1);

    exitShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:28,代码来源:TesterRulePage.cpp

示例8: QWidget

void StocksDialog::createDataPage ()
{
    QWidget *w = new QWidget(this);

    Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
    vbox->setMargin(5);
    vbox->setSpacing(0);

    barEdit = new BarEdit(w);
    QString s = tr("Open");
    QString s2 = "Open";
    barEdit->createField(s, s2, FALSE);
    s = tr("High");
    s2 = "High";
    barEdit->createField(s, s2, FALSE);
    s = tr("Low");
    s2 = "Low";
    barEdit->createField(s, s2, FALSE);
    s = tr("Close");
    s2 = "Close";
    barEdit->createField(s, s2, FALSE);
    s = tr("Volume");
    s2 = "Volume";
    barEdit->createField(s, s2, FALSE);
    connect(barEdit, SIGNAL(signalDeleteRecord()), this, SLOT(deleteRecord()));
    connect(barEdit, SIGNAL(signalSaveRecord()), this, SLOT(saveRecord()));
    connect(barEdit, SIGNAL(signalSearch(QDateTime)), this, SLOT(slotDateSearch(QDateTime)));
    connect(barEdit, SIGNAL(signalFirstRecord()), this, SLOT(slotFirstRecord()));
    connect(barEdit, SIGNAL(signalLastRecord()), this, SLOT(slotLastRecord()));
    connect(barEdit, SIGNAL(signalPrevRecord()), this, SLOT(slotPrevRecord()));
    connect(barEdit, SIGNAL(signalNextRecord()), this, SLOT(slotNextRecord()));
    vbox->addWidget(barEdit);

    addTab(w, tr("Data"));
}
开发者ID:redrhino,项目名称:qtstalker-qt4,代码行数:35,代码来源:StocksDialog.cpp

示例9: throw

// -------------------------------------------------------------------------------------------------
TriggerWidget::TriggerWidget(QWidget* parent, const char* name)
throw ()
    : QWidget(parent, name)
{
    Q3VBoxLayout* boxLayout = new Q3VBoxLayout(this, 0, 0);

    Q3HBox* hbox = new Q3HBox(this);
    hbox->setSpacing(2);

    // create the checkboxes with their labels
    for (int i = 0; i < NUMBER_OF_BITS_PER_BYTE; i++) {
        Q3VBox* box = new Q3VBox(hbox);
        box->setSpacing(2);

        m_labels[i] = new QLabel(QString::number(i+1), box);
        m_labels[i]->setAlignment(Qt::AlignHCenter);

        m_checkboxes[i] = new QCheckBox(box);
        m_checkboxes[i]->setTristate(true);
        m_checkboxes[i]->setNoChange();


        connect(m_checkboxes[i], SIGNAL(stateChanged(int)), SLOT(valueChangedHandler()));
    }

    boxLayout->addWidget(hbox);
    boxLayout->addStretch(5);
}
开发者ID:BackupTheBerlios,项目名称:tfla-01-svn,代码行数:29,代码来源:triggerwidget.cpp

示例10: QWidget

LCDRange::LCDRange( QWidget *parent, const char *name ): QWidget( parent, name )
{
	//QLCDNumber *lcd = new QLCDNumber( 2, this,  "lcd" );
	QLCDNumber *lcd = new QLCDNumber( 2 );
	lcd->setSegmentStyle(QLCDNumber::Filled);

	//slider = new QSlider( Horizontal, this, "slider" );
	slider = new QSlider( Horizontal);
	slider->setRange( 0, 99 );
	slider->setValue( 0 );

	//设置滑块为焦点代理。当想要给LCDRange一个键盘焦点,滑块就会注意到它。
	setFocusProxy( slider );

	//这里把slider的valueChanged信号分别连接到display和自定义的valueChanged上面
	connect( slider, SIGNAL(valueChanged(int)), lcd,
			SLOT(display(int)) );

	//这里两种方式实现信号的连接,利用标准信号发出自定义信号。
	//connect( slider, SIGNAL(valueChanged(int)),
	//		SIGNAL(valueChanged(int)) );
	connect( slider, SIGNAL(valueChanged(int)), this,
			SIGNAL(valueChanged(int)) );

	//这里利用另外的方式实现添加到VBox,而不用继承QVBox类
	Q3VBoxLayout *layout = new Q3VBoxLayout;
	layout->addWidget(lcd);
	layout->addWidget(slider);
	setLayout(layout);

}
开发者ID:cherry-wb,项目名称:quietheart,代码行数:31,代码来源:lcdRange.cpp

示例11: 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);

}
开发者ID:BlueBrain,项目名称:qt_steerer,代码行数:59,代码来源:configform.cpp

示例12: 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);
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:58,代码来源:kexicsvwidgets.cpp

示例13: 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()));
}
开发者ID:harmegnies,项目名称:douml,代码行数:58,代码来源:About.cpp

示例14: QDialog

Dialog::Dialog(BooL & rec, char & lang) : QDialog(0, 0, TRUE), _rec(rec), _lang(lang) {
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBox * htab;
  
  vbox->setMargin(5);
  
  // recursive checkbox
  if (rec) {
    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);
    
    rec_cb = new QCheckBox("Do recursively", htab);
  }
  else
    rec_cb = 0;

  // langs + cancel buttons
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  QPushButton * cpp = new QPushButton("&C++", htab);
  new QLabel(htab);
  QPushButton * java = new QPushButton("&Java", htab);
  new QLabel(htab);
  QPushButton * idl = new QPushButton("&Idl", htab);
  new QLabel(htab);
  QPushButton * php = new QPushButton("P&hp", htab);
  new QLabel(htab);
  QPushButton * python = new QPushButton("P&ython", htab);
  new QLabel(htab);
  QPushButton * cancel = new QPushButton("&Cancel", htab);
  new QLabel(htab);
  QSize bs(cancel->sizeHint());
  
  cpp->setFixedSize(bs);
  java->setFixedSize(bs);
  
  connect(cpp, SIGNAL(clicked()), this, SLOT(accept_cpp()));
  connect(java, SIGNAL(clicked()), this, SLOT(accept_java()));
  connect(idl, SIGNAL(clicked()), this, SLOT(accept_idl()));
  connect(php, SIGNAL(clicked()), this, SLOT(accept_php()));
  connect(python, SIGNAL(clicked()), this, SLOT(accept_python()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));

  // help
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  new QLabel(htab);
  new QLabel("Warning : reset the declarations/definitions to\n"
	     "their default value from the 'generation settings'", htab);
  new QLabel(htab);
}
开发者ID:SciBoy,项目名称:douml,代码行数:58,代码来源:Dialog.cpp

示例15: 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()));
}
开发者ID:kralf,项目名称:bouml,代码行数:56,代码来源:About.cpp


注:本文中的Q3VBoxLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。