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


C++ setButtons函数代码示例

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


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

示例1: KDialog

DmesgDialog::DmesgDialog(QWidget *parent) : KDialog(parent)
{
	setButtons(KDialog::Close);
	setCaption(i18nc("@title:window", "dmesg"));

	dmesgProcess = new QProcess(this);
	dmesgProcess->setProcessChannelMode(QProcess::MergedChannels);
	connect(dmesgProcess, SIGNAL(readyRead()), this, SLOT(readyRead()));
	dmesgProcess->start(QLatin1String("dmesg"), QIODevice::ReadOnly);

	dmesgTextEdit = new QPlainTextEdit(this);
	dmesgTextEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
	dmesgTextEdit->setReadOnly(true);
	setMainWidget(dmesgTextEdit);

	resize(100 * fontMetrics().averageCharWidth(), 28 * fontMetrics().height());
}
开发者ID:Brandhand,项目名称:kaffeine-vlc,代码行数:17,代码来源:configurationdialog.cpp

示例2: setMainWidget

EquipmentWriter::EquipmentWriter() {
    QWidget *widget = new QWidget;
    ui.setupUi( widget );
    ui.tabWidget->setCurrentIndex(0);
    setMainWidget( widget );
    setCaption( i18n( "Define Equipment" ) );
    setButtons( KDialog::Close );
    ks = KStars::Instance();
    nextScope = 0;
    nextEyepiece = 0;
    nextFilter = 0;
    nextLens = 0;
    loadEquipment();
    newScope = true;
    newEyepiece = true;
    newLens = true;
    newFilter = true;


    #ifdef HAVE_INDI_H
    ui.driverComboBox->insertItems(1, DriverManager::Instance()->getDriversStringList());
    #endif

    //make connections
    connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) );
    connect( ui.NewScope, SIGNAL( clicked() ), this, SLOT( slotNewScope() ) );
    connect( ui.NewEyepiece, SIGNAL( clicked() ), this, SLOT( slotNewEyepiece() ) );
    connect( ui.NewLens, SIGNAL( clicked() ), this, SLOT( slotNewLens() ) );
    connect( ui.NewFilter, SIGNAL( clicked() ), this, SLOT( slotNewFilter() ) );
    connect( ui.AddScope, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddEyepiece, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddLens, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddFilter, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.ScopeList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetScope(QString) ) );
    connect( ui.EyepieceList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetEyepiece(QString) ) );
    connect( ui.LensList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetLens(QString) ) );
    connect( ui.FilterList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetFilter(QString) ) );
    connect( ui.RemoveScope, SIGNAL( clicked() ), this, SLOT( slotRemoveScope() ) );
    connect( ui.RemoveEyepiece, SIGNAL( clicked() ), this, SLOT( slotRemoveEyepiece() ) );
    connect( ui.RemoveLens, SIGNAL( clicked() ), this, SLOT( slotRemoveLens() ) );
    connect( ui.RemoveFilter, SIGNAL( clicked() ), this, SLOT( slotRemoveFilter() ) );
}
开发者ID:spacetime,项目名称:kstars-hackfest,代码行数:46,代码来源:equipmentwriter.cpp

示例3: KDialog

KU_PwDlg::KU_PwDlg( QWidget* parent )
  : KDialog(parent)
{
  setCaption(i18n("Enter Password"));
  setButtons(Ok | Cancel);
  setDefaultButton(Ok);
  QFrame *page = new QFrame( this );
  setMainWidget( page );
  QLabel* lb1 = new QLabel(page);
  lb1->setText(i18n("Password:"));
  lb1->setMinimumSize(lb1->sizeHint());
  lb1->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  lepw1 = new KLineEdit(page);

  // ensure it fits at least 12 characters
  lepw1->setText( QLatin1String( "XXXXXXXXXXXX" ) );
  lepw1->setMinimumSize(lepw1->sizeHint());

  // clear text
  lepw1->clear();
  lepw1->setFocus();
  lepw1->setEchoMode(KLineEdit::Password);

  QLabel* lb2 = new QLabel(page);
  lb2->setText(i18n("Verify:"));
  lb2->setMinimumSize(lb2->sizeHint());
  lb2->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

  lepw2 = new KLineEdit(page);

  // ensure it fits at least 12 characters
  lepw2->setText( QLatin1String( "XXXXXXXXXXXX" ) );
  lepw2->setMinimumSize(lepw2->sizeHint());

  // clear text
  lepw2->clear();
  lepw2->setEchoMode(KLineEdit::Password);

  QGridLayout *layout = new QGridLayout;
  layout->addWidget(lb1, 0, 0);
  layout->addWidget(lepw1, 0, 1);
  layout->addWidget(lb2, 1, 0);
  layout->addWidget(lepw2, 1, 1);
  page->setLayout(layout);
}
开发者ID:KDE,项目名称:kuser,代码行数:46,代码来源:ku_pwdlg.cpp

示例4: KraftViewBase

KraftViewRO::KraftViewRO(QWidget *parent, const char *name) :
    KraftViewBase( parent )
{
  setObjectName( name );
  setModal( false );
  setCaption( i18n("Document" ) );
  setButtons( Close );
  m_type = ReadOnly;

  KVBox *w = new KVBox( parent );
  mGlobalVBox = w;
  setMainWidget( w );
  mGlobalVBox->setMargin( 3 );

  mHtmlView = new HtmlView( mGlobalVBox );
  mHtmlView->setStylesheetFile( "docoverview_ro.css" );
}
开发者ID:KDE,项目名称:kraft,代码行数:17,代码来源:kraftview_ro.cpp

示例5: KDialog

KOEventViewerDialog::KOEventViewerDialog( CalendarSupport::Calendar *calendar, QWidget *parent )
  : KDialog( parent )
{
  setCaption( i18n( "Event Viewer" ) );
  setButtons( Close | User1 | User2 );
  setModal( false );
  setButtonGuiItem( User1, KGuiItem( i18n( "Edit..." ), KIcon( "document-edit" ) ) );
  setButtonGuiItem( User2, KGuiItem( i18n( "Show in Context" ) ) );
  mEventViewer = new CalendarSupport::IncidenceViewer( calendar, this );
  setMainWidget( mEventViewer );

  resize( QSize( 500, 520 ).expandedTo( minimumSizeHint() ) );

  connect( this, SIGNAL(finished()), this, SLOT(delayedDestruct()) );
  connect( this, SIGNAL(user1Clicked()), this, SLOT(editIncidence()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(showIncidenceContext()) );
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:17,代码来源:koeventviewerdialog.cpp

示例6: KoDialog

MainProjectDialog::MainProjectDialog(Project &p, QWidget *parent, const char */*name*/)
    : KoDialog( parent),
      project(p)
{
    setWindowTitle( i18n("Project Settings") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );
    panel = new MainProjectPanel(project, this);

    setMainWidget(panel);
    enableButtonOk(false);
    resize( QSize(500, 410).expandedTo(minimumSizeHint()));

    connect(this, SIGNAL(okClicked()), SLOT(slotOk()));
    connect(panel, SIGNAL(obligatedFieldsFilled(bool)), SLOT(enableButtonOk(bool)));
}
开发者ID:foren197316,项目名称:calligra,代码行数:17,代码来源:kptmainprojectdialog.cpp

示例7: KPageDialog

Setup::Setup(QWidget* const parent)
  : KPageDialog(parent), d(new Private())
{
    setCaption(i18n("Configure"));
    setButtons(Apply|Ok|Cancel);
    setDefaultButton(Ok);
    setModal(true);

    d->setupGeneral = new SetupGeneral(this);
    d->pageGeneral = addPage(d->setupGeneral, i18nc("General setup", "General"));

    connect(this, SIGNAL(applyClicked()),
            this, SLOT(slotApplyClicked()));

    connect(this, SIGNAL(okClicked()),
            this, SLOT(slotOkClicked()));
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:17,代码来源:setup.cpp

示例8: KDialog

/*
 *  Constructs a fontProgressDialog which is a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'
 */
fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, QWidget* parent, bool progressbar)
  : KDialog( parent),
    TextLabel2(0),
    TextLabel1(0),
    ProgressBar1(0),
    progress(0),
    process(0)
{
  setCaption( i18n( "Font Generation Progress Dialog" ) );
  setModal( true );
  setButtons( Cancel );
  setDefaultButton( Cancel );
  setCursor(QCursor(Qt::WaitCursor));

  setButtonGuiItem(Cancel, KGuiItem(i18n("Abort"), "process-stop", abortTip));

  if (helpIndex.isEmpty() == false) {
    setHelp(helpIndex, "okular");
    setHelpLinkText( i18n( "What is happening here?") );
    enableLinkedHelp(true);
  } else
    enableLinkedHelp(false);

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

  TextLabel1   = new QLabel(label, page);
  TextLabel1->setAlignment(Qt::AlignCenter);
  TextLabel1->setWhatsThis( whatsThis );
  TextLabel1->setToolTip( ttip );

  if (progressbar) {
    ProgressBar1 = new QProgressBar( page );
    ProgressBar1->setFormat(i18n("%v of %m"));
    ProgressBar1->setWhatsThis( whatsThis );
    ProgressBar1->setToolTip( ttip );
  } else
    ProgressBar1 = NULL;

  TextLabel2   = new QLabel("", page);
  TextLabel2->setAlignment(Qt::AlignCenter);
  TextLabel2->setWhatsThis( whatsThis );
  TextLabel2->setToolTip( ttip );

  qApp->connect(this, SIGNAL(finished()), this, SLOT(killProcess()));
}
开发者ID:JPriya,项目名称:Okular,代码行数:50,代码来源:fontprogress.cpp

示例9: KDialog

SelectOpDlg::SelectOpDlg(UMLView * parent, UMLClassifier * c)
        : KDialog( parent)
{
    setCaption( i18n("Select Operation") );
    setButtons( Ok | Cancel );
    setDefaultButton( Yes );
    setModal( true );
    showButtonSeparator( true );

    QFrame *frame = new QFrame( this );
    setMainWidget( frame );

    m_pView = parent;
    QVBoxLayout * topLayout = new QVBoxLayout(frame);

    m_pOpGB = new QGroupBox(i18n("Select Operation"), frame);
    topLayout->addWidget(m_pOpGB);

    QGridLayout * mainLayout = new QGridLayout(m_pOpGB);
    mainLayout->setSpacing(spacingHint());
    mainLayout->setMargin(fontMetrics().height());

    Dialog_Utils::makeLabeledEditField( m_pOpGB, mainLayout, 0,
                                    m_pSeqL, i18n("Sequence number:"),
                                    m_pSeqLE );

    m_pOpRB = new QRadioButton(i18n("Class operation:"), m_pOpGB);
    connect(m_pOpRB, SIGNAL(clicked()), this, SLOT(slotSelectedOp()));
    mainLayout->addWidget(m_pOpRB, 1, 0);

    m_pOpCB = new KComboBox(m_pOpGB);
    m_pOpCB->setCompletionMode( KGlobalSettings::CompletionPopup );
    m_pOpCB->setDuplicatesEnabled(false); // only allow one of each type in box
    mainLayout->addWidget(m_pOpCB, 1, 1);

    m_pCustomRB = new QRadioButton(i18n("Custom operation:"), m_pOpGB);
    connect(m_pCustomRB, SIGNAL(clicked()), this, SLOT(slotSelectedCustom()));
    mainLayout->addWidget(m_pCustomRB, 2, 0);

    m_pOpLE = new KLineEdit(m_pOpGB);
    mainLayout->addWidget(m_pOpLE, 2, 1);

    UMLOperationList list = c->getOpList(true);
    foreach (UMLOperation* obj, list ) {
        insertOperation( obj->toString(Uml::st_SigNoVis), list.count() );
    }
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:46,代码来源:selectopdlg.cpp

示例10: KDialog

RSDialog::RSDialog(QWidget* parent) : KDialog(parent)
{
    setCaption(i18n("Risks/Security Phrases"));
    setButtons(Help | Close);

    createRPhrases();
    createSPhrases();

    ui.setupUi(mainWidget());

    connect(ui.filterButton, SIGNAL(clicked()),
            this, SLOT(filter()));
    connect(this, SIGNAL(helpClicked()),
            this, SLOT(slotHelp()));

        filter();
}
开发者ID:Anumittal,项目名称:Kalzium,代码行数:17,代码来源:rsdialog.cpp

示例11: KDialog

PodcastSettingsDialog::PodcastSettingsDialog( Podcasts::SqlPodcastChannelPtr channel, QWidget* parent )
    : KDialog( parent )
    , m_ps( new Ui::PodcastSettingsBase() )
    , m_channel( channel )
{
    QWidget* main = new QWidget( this );
    m_ps->setupUi( main );
    setMainWidget( main );

    setCaption( i18nc("change options", "Configure %1", m_channel->title() ) );
    setModal( true );
    setButtons( Apply | Cancel | Ok );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    init();
}
开发者ID:vasilenkomike,项目名称:amarok,代码行数:17,代码来源:PodcastSettingsDialog.cpp

示例12: KDialog

ResumeDialog::ResumeDialog( QWidget *parent )
: KDialog( parent )
{
    m_modelAssigned = false;
    trNumber = 0;
    userId = 0;

    ui = new ResumeDialogUI( this );
    setMainWidget( ui );
    setCaption( i18n("Resume Sale") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    enableButtonOk(false);

    connect(ui->tableWidget, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    connect( ui->editSearch, SIGNAL(returnPressed()), SLOT(filterClient()) );
    setDefaultButton(KDialog::Ok);
}
开发者ID:bielfrontera,项目名称:lemonpos,代码行数:17,代码来源:resume.cpp

示例13: KDialog

KSaneDeviceDialog::KSaneDeviceDialog(QWidget *parent)
    : KDialog(parent)
{

    setButtons(KDialog::User1 | KDialog::Ok | KDialog::Cancel);
    setButtonText(User1, i18n("Reload devices list"));
    
    m_btnGroup = new QButtonGroup(this);

    m_btnBox = new QGroupBox;
    QVBoxLayout *layout = new QVBoxLayout;
    m_btnContainer = new QWidget;
    m_btnLayout = new QVBoxLayout(m_btnContainer);
    QScrollArea *area = new QScrollArea;
    
    m_btnBox->setLayout(layout);

    QLabel *explanation =
      new QLabel(i18n("<html>The SANE (Scanner Access Now Easy) system could not find any device.<br>"
                      "Check that the scanner is plugged in and turned on<br>"
                      "or check your systems scanner setup.<br>"
                      "For details about SANE see the "
                      "<a href='http://www.sane-project.org/'>SANE homepage</a>.</html>"));
    explanation->setOpenExternalLinks(true);
    int l,t,r,b;
    layout->getContentsMargins(&l, &t, &r, &b);
    explanation->setContentsMargins(l, t, r, b);

    layout->addWidget(explanation);
    m_btnBox->adjustSize();  // make sure to see the complete explanation text
    layout->addWidget(area);
    layout->setContentsMargins(0,0,0,0);

    area->setWidgetResizable(true);
    area->setFrameShape(QFrame::NoFrame);
    area->setWidget(m_btnContainer);

    setMainWidget(m_btnBox);
    setMinimumHeight(200);
    m_findDevThread = FindSaneDevicesThread::getInstance();

    connect(m_findDevThread, SIGNAL(finished()), this, SLOT(updateDevicesList()));
    connect(this, SIGNAL(user1Clicked()),        this, SLOT(reloadDevicesList()));

    reloadDevicesList();
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:46,代码来源:ksane_device_dialog.cpp

示例14: KDialog

/*
 *  Constructs a SectionEditor as a child of 'parent'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
SectionEditor::SectionEditor(QWidget* parent)
  : KDialog(parent)
{
    setButtons(Close);
    setCaption(i18n("Section Editor"));

    QWidget *widget = new QWidget(this);
    m_ui.setupUi(widget);
    m_btnAdd = new KPushButton(koIcon("list-add"), i18n("Add..."), this);
    m_ui.lGroupSectionsButtons->addWidget(m_btnAdd);
    m_btnEdit = new KPushButton(koIcon("document-edit"), i18n("Edit..."), this);
    m_ui.lGroupSectionsButtons->addWidget(m_btnEdit);
    m_btnRemove = new KPushButton(koIcon("list-remove"), i18n("Delete"), this);
    m_ui.lGroupSectionsButtons->addWidget(m_btnRemove);
    m_btnMoveUp = new KPushButton(koIcon("arrow-up"), i18n("Move Up"), this);
    m_ui.lGroupSectionsButtons->addWidget(m_btnMoveUp);
    m_btnMoveDown = new KPushButton(koIcon("arrow-down"), i18n("Move Down"), this);
    m_ui.lGroupSectionsButtons->addWidget(m_btnMoveDown);
    m_ui.lGroupSectionsButtons->addStretch();
    setMainWidget(widget);

    // signals and slots connections
    connect(m_ui.cbReportHeader, SIGNAL(toggled(bool)), this, SLOT(cbReportHeader_toggled(bool)));
    connect(m_ui.cbReportFooter, SIGNAL(toggled(bool)), this, SLOT(cbReportFooter_toggled(bool)));
    connect(m_ui.cbHeadFirst, SIGNAL(toggled(bool)), this, SLOT(cbHeadFirst_toggled(bool)));
    connect(m_ui.cbHeadLast, SIGNAL(toggled(bool)), this, SLOT(cbHeadLast_toggled(bool)));
    connect(m_ui.cbHeadEven, SIGNAL(toggled(bool)), this, SLOT(cbHeadEven_toggled(bool)));
    connect(m_ui.cbHeadOdd, SIGNAL(toggled(bool)), this, SLOT(cbHeadOdd_toggled(bool)));
    connect(m_ui.cbFootFirst, SIGNAL(toggled(bool)), this, SLOT(cbFootFirst_toggled(bool)));
    connect(m_ui.cbFootLast, SIGNAL(toggled(bool)), this, SLOT(cbFootLast_toggled(bool)));
    connect(m_ui.cbFootEven, SIGNAL(toggled(bool)), this, SLOT(cbFootEven_toggled(bool)));
    connect(m_ui.cbFootOdd, SIGNAL(toggled(bool)), this, SLOT(cbFootOdd_toggled(bool)));
    connect(m_ui.cbHeadAny, SIGNAL(toggled(bool)), this, SLOT(cbHeadAny_toggled(bool)));
    connect(m_ui.cbFootAny, SIGNAL(toggled(bool)), this, SLOT(cbFootAny_toggled(bool)));
    connect(m_ui.lbGroups, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
            this, SLOT(updateButtonsForItem(QListWidgetItem*)));
    connect(m_ui.lbGroups, SIGNAL(currentRowChanged(int)),
            this, SLOT(updateButtonsForRow(int)));

    connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked()));
    connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked()));
    connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked()));
    connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked()));
    connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked()));
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:51,代码来源:sectioneditor.cpp

示例15: Dialog

LyricsDialog::LyricsDialog(const Song &s, QWidget *parent)
    : Dialog(parent)
    , prev(s)
{
    QWidget *mw=new QWidget(this);
    QGridLayout *mainLayout=new QGridLayout(mw);
    QWidget *wid = new QWidget(mw);
    QFormLayout *layout = new QFormLayout(wid);
    int row=0;
    QLabel *lbl=new QLabel(i18n("If Cantata has failed to find lyrics, or has found the wrong ones, "
                                "use this dialog to enter new search details. For example, the current "
                                "song may actually be a cover-version - if so, then searching for "
                                "lyrics by the original artist might help.\n\nIf this search does find "
                                "new lyrics, these will still be associated with the original song title "
                                "and artist as displayed in Cantata."), mw);
    lbl->setWordWrap(true);
    QLabel *icn=new QLabel(mw);
    icn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    int iconSize=48;
    icn->setMinimumSize(iconSize, iconSize);
    icn->setMaximumSize(iconSize, iconSize);
    icn->setPixmap(Icon("dialog-information").pixmap(iconSize, iconSize));
    mainLayout->setMargin(0);
    layout->setMargin(0);
    mainLayout->addWidget(icn, 0, 0, 1, 1);
    mainLayout->addWidget(lbl, 0, 1, 1, 1);
    mainLayout->addItem(new QSpacerItem(8, 4, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
    mainLayout->addWidget(wid, 2, 0, 1, 2);
    titleEntry = new LineEdit(wid);
    artistEntry = new LineEdit(wid);

    layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Title:"), wid));
    layout->setWidget(row++, QFormLayout::FieldRole, titleEntry);
    layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Artist:"), wid));
    layout->setWidget(row++, QFormLayout::FieldRole, artistEntry);
    setCaption(i18n("Search For Lyrics"));
    setMainWidget(mw);
    setButtons(Ok|Cancel);
    enableButton(Ok, false);
    connect(titleEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    connect(artistEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    titleEntry->setFocus();
    titleEntry->setText(s.title);
    artistEntry->setText(s.artist);
}
开发者ID:pmattern,项目名称:cantata,代码行数:45,代码来源:lyricsdialog.cpp


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