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


C++ setMainWidget函数代码示例

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


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

示例1: KDialog

EditNamedAreaDialog::EditNamedAreaDialog(QWidget* parent, Selection* selection)
        : KDialog(parent)
        , m_selection(selection)
{
    setButtons(Ok | Cancel);
    setModal(true);
    setObjectName("EditNamedAreaDialog");
    enableButtonOk(false);

    QWidget *page = new QWidget();
    setMainWidget(page);

    QGridLayout * gridLayout = new QGridLayout(page);
    gridLayout->setMargin(KDialog::marginHint());
    gridLayout->setSpacing(KDialog::spacingHint());

    QLabel * textLabel4 = new QLabel(page);
    textLabel4->setText(i18n("Cells:"));
    gridLayout->addWidget(textLabel4, 2, 0);

    m_cellRange = new KLineEdit(page);
    gridLayout->addWidget(m_cellRange, 2, 1);

    QLabel * textLabel1 = new QLabel(page);
    textLabel1->setText(i18n("Sheet:"));
    gridLayout->addWidget(textLabel1, 1, 0);

    m_sheets = new KComboBox(page);
    gridLayout->addWidget(m_sheets, 1, 1);

    QLabel * textLabel2 = new QLabel(page);
    textLabel2->setText(i18n("Area name:"));
    gridLayout->addWidget(textLabel2, 0, 0);

    m_areaNameEdit = new KLineEdit(page);
    gridLayout->addWidget(m_areaNameEdit, 0, 1);

    const QList<KCSheet*> sheetList = m_selection->activeSheet()->map()->sheetList();
    for (int i = 0; i < sheetList.count(); ++i) {
        KCSheet* sheet = sheetList.at(i);
        if (!sheet)
            continue;
        m_sheets->insertItem(i, sheet->sheetName());
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(m_areaNameEdit, SIGNAL(textChanged(const QString&)),
            this, SLOT(slotAreaNameModified(const QString&)));
}
开发者ID:KDE,项目名称:koffice,代码行数:49,代码来源:NamedAreaDialog.cpp

示例2: KDialog

PurchaseEditor::PurchaseEditor( QWidget *parent )
: KDialog( parent )
{
    ui = new PurchaseEditorUI( this );
    setMainWidget( ui );
    setCaption( i18n("Purchase") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    setDefaultButton(KDialog::None);
    ui->btnAddItem->setDefault(true);

    //Set Validators for input boxes
    QRegExp regexpC("[0-9]{1,13}"); //(EAN-13 y EAN-8) .. y productos sin codigo de barras?
    QRegExpValidator * validatorEAN13 = new QRegExpValidator(regexpC, this);
    ui->editCode->setValidator(validatorEAN13);
    ui->editTax->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editTax));
    ui->editExtraTaxes->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editExtraTaxes));
    ui->editCost->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3, ui->editCost));
    ui->editPoints->setValidator(new QIntValidator(0,999999999, ui->editPoints));
    ui->editFinalPrice->setValidator(new QDoubleValidator(0.00,999999999999.99, 3, ui->editFinalPrice));
    ui->editItemsPerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editItemsPerBox));
    ui->editPricePerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editPricePerBox));
    ui->editQty->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editQty));

    connect( ui->btnPhoto          , SIGNAL( clicked() ), this, SLOT( changePhoto() ) );
    connect( ui->btnCalculatePrice , SIGNAL( clicked() ), this, SLOT( calculatePrice() ) );
    connect( ui->editItemsPerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editPricePerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCost , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editTax , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editExtraTaxes , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editUtility , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCode, SIGNAL(textEdited(const QString &)), SLOT(checkIfCodeExists()));
    connect( ui->editCode, SIGNAL(returnPressed()), ui->editQty, SLOT(setFocus()));
    connect( ui->btnAddItem, SIGNAL( clicked() ), this, SLOT( addItemToList() ) );
    connect(ui->groupBoxedItem, SIGNAL(toggled(bool)), this, SLOT(focusItemsPerBox(bool)) );

    connect(ui->btnRemoveItem, SIGNAL( clicked() ), SLOT( deleteSelectedItem() ) );

    ui->chIsAGroup->setDisabled(true);
    

    status = estatusNormal;
    productExists = false;
    productsHash.clear();
    resetEdits();
    totalBuy = 0.0;
    itemCount = 0.0;
    QTimer::singleShot(500, this, SLOT(setupTable()));
}
开发者ID:adlh,项目名称:lemonpos,代码行数:49,代码来源:purchaseeditor.cpp

示例3: KDialog

TextFileImportDialog::TextFileImportDialog(QWidget *parent)
        : KDialog(parent)
{
    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    // KDialog options
    setCaption(i18n("Import Text File"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("ImportTextFile");
    setModal(true);
    showButtonSeparator(false);


    m_choices = new QGroupBox(i18n("Format of the Text File"), page);
    m_choiceLayout = new QVBoxLayout;
    m_choices->setLayout(m_choiceLayout);

    m_emptyline_choice = new QRadioButton(i18n("Notes separated by an &empty line"), m_choices);
    m_newline_choice = new QRadioButton(i18n("One &note per line"),                  m_choices);
    m_dash_choice = new QRadioButton(i18n("Notes begin with a &dash (-)"),           m_choices);
    m_star_choice = new QRadioButton(i18n("Notes begin with a &star (*)"),           m_choices);
    m_anotherSeparator = new QRadioButton(i18n("&Use another separator:"),           m_choices);

    m_choiceLayout->addWidget(m_emptyline_choice);
    m_choiceLayout->addWidget(m_newline_choice);
    m_choiceLayout->addWidget(m_dash_choice);
    m_choiceLayout->addWidget(m_star_choice);
    m_choiceLayout->addWidget(m_anotherSeparator);

    QWidget *indentedTextEdit = new QWidget(m_choices);
    m_choiceLayout->addWidget(indentedTextEdit);

    QHBoxLayout *hLayout = new QHBoxLayout(indentedTextEdit);
    hLayout->addSpacing(20);
    m_customSeparator = new KTextEdit(indentedTextEdit);
    hLayout->addWidget(m_customSeparator);

    m_all_in_one_choice = new QRadioButton(i18n("&All in one note"),                  m_choices);
    m_choiceLayout->addWidget(m_all_in_one_choice);

    m_emptyline_choice->setChecked(true);
    topLayout->addWidget(m_choices);

    connect(m_customSeparator, SIGNAL(textChanged()), this, SLOT(customSeparatorChanged()));

    setMainWidget(page);
}
开发者ID:bewitchingme,项目名称:basket,代码行数:49,代码来源:softwareimporters.cpp

示例4: KDialog

FlickrLogin::FlickrLogin(QWidget* parent, const QString& header,
                         const QString& _name, const QString& _passwd)
           : KDialog(parent)
{
    setWindowTitle(header);
    setButtons(Help|Ok|Cancel);
    setDefaultButton(Ok);
    setModal(false);

    QWidget *widget = new QWidget(this);
    setMainWidget(widget);

    QVBoxLayout* vbox = new QVBoxLayout(widget);
    m_headerLabel     = new QLabel(widget);
    m_headerLabel->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
    m_headerLabel->setText(header);

    KSeparator *hline = new KSeparator(Qt::Horizontal, widget);

    QGridLayout* centerLayout = new QGridLayout();

    m_nameEdit   = new KLineEdit(widget);
    m_passwdEdit = new KLineEdit(widget);
    m_passwdEdit->setEchoMode(KLineEdit::Password);

    QLabel* nameLabel = new QLabel(widget);
    nameLabel->setText(i18n("Username:"));

    QLabel* passwdLabel = new QLabel(widget);
    passwdLabel->setText(i18n("Password:"));

    centerLayout->addWidget(m_nameEdit,   0, 1);
    centerLayout->addWidget(m_passwdEdit, 1, 1);
    centerLayout->addWidget(nameLabel,    0, 0);
    centerLayout->addWidget(passwdLabel,  1, 0);
    centerLayout->setMargin(KDialog::spacingHint());
    centerLayout->setSpacing(KDialog::spacingHint());

    vbox->addWidget(m_headerLabel);
    vbox->addWidget(hline);
    vbox->addLayout(centerLayout);
    vbox->setMargin(0);
    vbox->setSpacing(KDialog::spacingHint());

    resize( QSize(300, 150).expandedTo(minimumSizeHint()) );

    m_nameEdit->setText(_name);
    m_passwdEdit->setText(_passwd);
}
开发者ID:ruphy,项目名称:kipi-plugins,代码行数:49,代码来源:login.cpp

示例5: KDialog

ExportDialog::ExportDialog(QWidget *parent)
        : KDialog(parent), m_mainwidget(new ExportWidget(this))
{
    setCaption(i18n("Export Sheet to HTML"));
    setButtons(Ok | Cancel);
    setDefaultButton(KDialog::Cancel);
    kapp->restoreOverrideCursor();

    connect(m_mainwidget->mCustomButton, SIGNAL(toggled(bool)),
            m_mainwidget->mCustomURL, SLOT(setEnabled(bool)));
    m_mainwidget->mEncodingBox->addItem(i18n("Recommended: UTF-8"));
    m_mainwidget->mEncodingBox->addItem(i18n("Locale (%1)", QString::fromLatin1(KGlobal::locale()->codecForEncoding()->name())));
    m_mainwidget->mCustomURL->setMode(KFile::ExistingOnly);
    setMainWidget(m_mainwidget);
}
开发者ID:KDE,项目名称:koffice,代码行数:15,代码来源:exportdialog.cpp

示例6: KDialogBase

MessagePropertyDialog::MessagePropertyDialog(QWidget *parent, KTNEFMessage *msg)
    : KDialogBase(parent, "MessagePropertyDialog", true, i18n("Message Properties"),
                  KDialogBase::Close | KDialogBase::User1, KDialogBase::Close, false,
                  KStdGuiItem::save())
{
    m_message = msg;

    m_listview = new KListView(this);
    m_listview->addColumn(i18n("Name"));
    m_listview->addColumn(i18n("Value"));
    m_listview->setAllColumnsShowFocus(true);
    setMainWidget(m_listview);

    formatPropertySet(m_message, m_listview);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:15,代码来源:messagepropertydialog.cpp

示例7: KDialogBase

ValgrindDialog::ValgrindDialog( Type type, QWidget* parent )
  : KDialogBase( parent, "valgrind dialog", true, i18n("Valgrind Memory Check"), Ok|Cancel ),
  m_type(type)
{
  w = new DialogWidget( this );
  w->valExecutableEdit->setURL( "valgrind" );
  w->executableEdit->setFocus();
  w->stack->raiseWidget(m_type);
  setMainWidget( w );
  connect( w->executableEdit->lineEdit(),  SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->valExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->ctExecutableEdit->lineEdit(),  SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  connect( w->kcExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
  enableButtonOK( false );
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:15,代码来源:valgrind_dialog.cpp

示例8: KDialog

KListBoxDialog::KListBoxDialog(const QString &text, QWidget *parent)
    : KDialog( parent )
{
  setModal(true);
  setButtons( Ok | Cancel );

  KVBox *page = new KVBox(this);
  setMainWidget(page);

  label = new QLabel(text, page);
  label->setAlignment(Qt::AlignCenter);

  table = new QListWidget(page);
  table->setFocus();
}
开发者ID:KDE,项目名称:kde-baseapps,代码行数:15,代码来源:klistboxdialog.cpp

示例9: Image

void Splasher::createUI() {
	vlMain = new VerticalLayout;
	vlMain->setBackgroundColor(0xcccccc);
	vlMain->fillSpaceHorizontally();
	vlMain->fillSpaceVertically();

	imgSplash = new Image();
	imgSplash->setScaleMode(IMAGE_SCALE_PRESERVE_ASPECT);
	imgSplash->fillSpaceHorizontally();
	imgSplash->fillSpaceVertically();
	imgSplash->setImage(LOGO);
	vlMain->addChild(imgSplash);

	setMainWidget(vlMain);
}
开发者ID:fatinbrain,项目名称:reList455,代码行数:15,代码来源:Splasher.cpp

示例10: KDialogBase

AnnotateDialog::AnnotateDialog(KConfig& cfg, QWidget *parent, const char *name)
    : KDialogBase(parent, name, false, QString::null,
                  Close | Help, Close, true)
    , partConfig(cfg)
{
    annotate = new AnnotateView(partConfig, this);
    setMainWidget(annotate);

    setHelp("annotate");

    setWFlags(Qt::WDestructiveClose | getWFlags());

    QSize size = configDialogSize(partConfig, "AnnotateDialog");
    resize(size);
}
开发者ID:serghei,项目名称:kde-kdesdk,代码行数:15,代码来源:annotatedlg.cpp

示例11: Dialog

JamendoSettingsDialog::JamendoSettingsDialog(QWidget *parent)
    : Dialog(parent)
{
    setButtons(Ok|Cancel);
    setCaption(tr("Jamendo Settings"));
    QWidget *mw=new QWidget(this);
    QFormLayout *layout=new QFormLayout(mw);
    fmt=new QComboBox(mw);
    fmt->insertItem(0, tr("MP3"));
    fmt->insertItem(1, tr("Ogg"));
    layout->setWidget(0, QFormLayout::LabelRole, new BuddyLabel(tr("Streaming format:"), mw, fmt));
    layout->setWidget(0, QFormLayout::FieldRole, fmt);
    layout->setMargin(0);
    setMainWidget(mw);
}
开发者ID:padertux,项目名称:cantata,代码行数:15,代码来源:jamendosettingsdialog.cpp

示例12: KDialog

SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const char *name )
    : KDialog( parent )
{
  setObjectName( name );
  setModal( true );
  setCaption( i18n( "Sensor Logger Settings" ) );
  setButtons( Ok|Cancel );

  QWidget *widget = new QWidget( this );

  m_settingsWidget = new Ui_SensorLoggerSettingsWidget;
  m_settingsWidget->setupUi( widget );

  setMainWidget( widget );
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:15,代码来源:SensorLoggerSettings.cpp

示例13: KDialog

ExportDialog::ExportDialog( const QString& remoteTypeName,
                            AbstractModelExporterConfigEditor* configEditor,
                            QWidget* parent )
  : KDialog( parent ),
    mConfigEditor( configEditor )
{
    setCaption( i18nc("@title:window","Export") );
    setButtons( Ok | Cancel );
    setButtonGuiItem( Ok, KGuiItem(i18nc("@action:button","&Export to File..."), QLatin1String("document-export"),
                      i18nc("@info:tooltip","Export the selected data to a file."),
                      i18nc("@info:whatsthis","If you press the <interface>Export to file</interface> "
                            "button, the selected data will be copied to a file "
                            "with the settings you entered above.")) );
    setDefaultButton( Ok );

    QSplitter* splitter = new QSplitter( this );

    setMainWidget( splitter );

    // config editor
    QWidget* editorPage = new QWidget( splitter );
    QVBoxLayout* editorPageLayout = new QVBoxLayout( editorPage );
    QLabel* editorLabel = new QLabel( remoteTypeName );
    QFont font = editorLabel->font();
    font.setBold( true );
    editorLabel->setFont( font );
    editorPageLayout->addWidget( editorLabel );
    editorPageLayout->addWidget( mConfigEditor );
    editorPageLayout->addStretch();

    splitter->addWidget( editorPage );
    splitter->setCollapsible( 0, false );

    mPreviewView = configEditor->createPreviewView();

    if( mPreviewView )
    {
        QGroupBox* previewBox = new QGroupBox( i18nc("@title:group","Preview"), this );
        splitter->addWidget( previewBox );

        QHBoxLayout* previewBoxLayout = new QHBoxLayout( previewBox );

        previewBoxLayout->addWidget( mPreviewView->widget() );
    }

    enableButtonOk( configEditor->isValid() );
    connect( configEditor, SIGNAL(validityChanged(bool)), SLOT(enableButtonOk(bool)) );
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:48,代码来源:exportdialog.cpp

示例14: KDialog

KileListSelectorBase::KileListSelectorBase(const QStringList &list, const QString &caption, const QString &select, bool sort,
                                           QWidget *parent, const char *name)
: KDialog(parent)
{
	setObjectName(name);
	setCaption(caption);
	setModal(true);
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	showButtonSeparator(true);

	QWidget *page = new QWidget(this);
	setMainWidget(page);

	QVBoxLayout *layout = new QVBoxLayout();
	layout->setMargin(0);
	layout->setSpacing(KDialog::spacingHint());
	page->setLayout(layout);

	layout->addWidget(new QLabel(select, page));

	m_listView = new QTreeWidget(page);
	m_listView->setHeaderLabel(i18n("Files"));
	m_listView->setSortingEnabled(false);
	m_listView->setAllColumnsShowFocus(true);
	m_listView->setRootIsDecorated(false);

	layout->addWidget(m_listView);

	layout->addWidget(new QLabel(i18np("1 item found.", "%1 items found.", list.size())));

	m_listView->setSortingEnabled(sort);
	if(sort) {
		m_listView->sortByColumn(0, Qt::AscendingOrder);
	}

	insertStringList(list);

	m_listView->clearSelection();
	connect(m_listView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(accept()));
	QItemSelectionModel *selectionModel = m_listView->selectionModel();
	if(selectionModel) { // checking just to be safe
		connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
		        this, SLOT(handleSelectionChanged(const QItemSelection&,const QItemSelection&)));
	}

	enableButtonOk(false);
}
开发者ID:fagu,项目名称:kileip,代码行数:48,代码来源:listselector.cpp

示例15: KDialog

PasswordDlg::PasswordDlg(QWidget *parent)
        : KDialog(parent)
        , w(0)
{
    // KDialog options
    setWindowTitle(i18n("Password Protection"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setModal(true);
    showButtonSeparator(true);

    setMainWidget(new QWidget(this));
    QHBoxLayout* toplayout = new QHBoxLayout(mainWidget());
    w = new Password;
    toplayout->addWidget(w, 1);
}
开发者ID:KrissN,项目名称:basket,代码行数:16,代码来源:password.cpp


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