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


C++ slotOk函数代码示例

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


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

示例1: QDialog

PiwigoEdit::PiwigoEdit(QWidget* const pParent, Piwigo* const pPiwigo, const QString& title)
        : QDialog(pParent, Qt::Dialog)
{
    mpPiwigo = pPiwigo;

    setWindowTitle(title);

    QFrame* const  page              = new QFrame(this);
    QGridLayout* const centerLayout = new QGridLayout();
    page->setMinimumSize(500, 128);

    mpUrlEdit = new QLineEdit(this);
    centerLayout->addWidget(mpUrlEdit, 1, 1);

    mpUsernameEdit = new QLineEdit(this);
    centerLayout->addWidget(mpUsernameEdit, 2, 1);

    mpPasswordEdit = new QLineEdit(this);
    mpPasswordEdit->setEchoMode(QLineEdit::Password);
    centerLayout->addWidget(mpPasswordEdit, 3, 1);

    QLabel* const urlLabel = new QLabel(this);
    urlLabel->setText(i18nc("piwigo login settings", "URL:"));
    centerLayout->addWidget(urlLabel, 1, 0);

    QLabel* const usernameLabel = new QLabel(this);
    usernameLabel->setText(i18nc("piwigo login settings", "Username:"));
    centerLayout->addWidget(usernameLabel, 2, 0);

    QLabel* const passwdLabel = new QLabel(this);
    passwdLabel->setText(i18nc("piwigo login settings", "Password:"));
    centerLayout->addWidget(passwdLabel, 3, 0);

    //---------------------------------------------

    page->setLayout(centerLayout);

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

    // setting initial data
    mpUrlEdit->setText(pPiwigo->url());
    mpUsernameEdit->setText(pPiwigo->username());
    mpPasswordEdit->setText(pPiwigo->password());

    //---------------------------------------------

    QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);

    QVBoxLayout* dialogLayout = new QVBoxLayout(this);
    dialogLayout->addWidget(page);
    dialogLayout->addWidget(buttonBox);

    connect(this, SIGNAL(accepted()), this, SLOT(slotOk()));
    connect(this, SIGNAL(rejected()), this, SLOT(reject()));
}
开发者ID:IlyaSukhanov,项目名称:kipi-plugins,代码行数:56,代码来源:piwigoconfig.cpp

示例2: KDialog

DatepickerDlg::DatepickerDlg(KTagebuch *ktagebuch):

KDialog((QWidget*)ktagebuch),m_ktagebuch(ktagebuch) {  
  setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply );
  dateW= new KDatePicker(this);  

  setMainWidget (dateW);
  connect( this, SIGNAL( applyClicked() ), this, SLOT( slotApply() ) );
  connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
}
开发者ID:RainerBlessing,项目名称:KTagebuch,代码行数:10,代码来源:datepickerdlg.cpp

示例3: MultiPageDialogBase

/**
 * Constructor.
 */
ObjectNodeDialog::ObjectNodeDialog(QWidget *parent, ObjectNodeWidget * pWidget)
  : MultiPageDialogBase(parent),
    m_pObjectNodeWidget(pWidget),
    m_bChangesMade(false)
{
    setCaption(i18n("Properties"));
    setupPages();
    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
}
开发者ID:Nephos,项目名称:umbrello,代码行数:13,代码来源:objectnodedialog.cpp

示例4: KDialog

CrossReferenceEditDialog::CrossReferenceEditDialog(CrossReferenceContent *contentNote, QWidget *parent/*, QKeyEvent *ke*/)
        : KDialog(parent)
        , m_noteContent(contentNote)
{

    // KDialog options
    setCaption(i18n("Edit Cross Reference"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("EditCrossReference");
    setModal(true);
    showButtonSeparator(true);
    connect(this, SIGNAL(okClicked()), SLOT(slotOk()));

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

    QGridLayout *layout = new QGridLayout(page);

    m_targetBasket = new KComboBox(wid);
    this->generateBasketList(m_targetBasket);

    if(m_noteContent->url().isEmpty()){
        BasketListViewItem *item = Global::bnpView->topLevelItem(0);
        m_noteContent->setCrossReference(KUrl(item->data(0, Qt::UserRole).toString()), m_targetBasket->currentText(), "edit-copy");
        this->urlChanged(0);
    } else {
        QString url = m_noteContent->url().url();
        //cannot use findData because I'm using a StringList and I don't have the second
        // piece of data to make find work.
        for(int i = 0; i < m_targetBasket->count(); ++i) {
            if(url == m_targetBasket->itemData(i, Qt::UserRole).toStringList().first()) {
                m_targetBasket->setCurrentIndex(i);
                break;
            }
        }
    }

    QLabel *label1 = new QLabel(page);
    label1->setText(i18n("Ta&rget:"));
    label1->setBuddy(m_targetBasket);

    layout->addWidget(label1,  0, 0, Qt::AlignVCenter);
    layout->addWidget(m_targetBasket,   0, 1, Qt::AlignVCenter);

    connect(m_targetBasket,   SIGNAL(activated(int)), this, SLOT(urlChanged(int)));

    QWidget *stretchWidget = new QWidget(page);
    QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Expanding);
    policy.setHorizontalStretch(1);
    policy.setVerticalStretch(255);
    stretchWidget->setSizePolicy(policy); // Make it fill ALL vertical space
    layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
}
开发者ID:tosky,项目名称:basket,代码行数:55,代码来源:noteedit.cpp

示例5: QDialog

KReferDialog::KReferDialog( KPhoneView * phv,int kcwn,QString uPrefix,QWidget *parent, const char *name )
	: QDialog( parent, name, true )
{
	phoneView=phv;
	kcwNumber= kcwn;
	userPrefix=uPrefix;
	
	phoneBook = 0;
	
	QVBox *vbox = new QVBox( this );
	vbox->setMargin( 3 );
	vbox->setSpacing( 3 );
	QVBoxLayout *vboxl = new QVBoxLayout( this, 5 );
	vboxl->addWidget( vbox );

	(void) new QLabel( tr("Refer-to URI:"), vbox );
	touri = new QLineEdit( vbox );
	touri->setMinimumWidth( fontMetrics().maxWidth() * 20 );
	
	
	QHBoxLayout *buttonBox;
	buttonBox = new QHBoxLayout( vboxl, 6 );
	
	loadUri = new QPushButton( "", this );	
	QIconSet icon;
	icon.setPixmap(SHARE_DIR "/icons/phonebook.png", QIconSet::Automatic );
	loadUri->setIconSet( icon );
	loadUri->setFixedWidth( loadUri->fontMetrics().maxWidth() * 2 );
	buttonBox->addWidget( loadUri );
	
	helpPushButton = new QPushButton( this, tr("help button") );
	helpPushButton->setText( tr("&help...") );
	helpPushButton->setEnabled( FALSE );
	buttonBox->addWidget( helpPushButton );
	
	QSpacerItem *spacer = new QSpacerItem(
		0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
	buttonBox->addItem( spacer );
	okPushButton = new QPushButton( this, tr("ok button") );
	okPushButton->setText( "OK" );
	okPushButton->setDefault( TRUE );
	buttonBox->addWidget( okPushButton );
	
	cancelPushButton = new QPushButton( this,tr( "cancel button") );
	cancelPushButton->setText( tr("Cancel") );
	cancelPushButton->setAccel( Key_Escape );
	buttonBox->addWidget( cancelPushButton );
	
	connect( loadUri, SIGNAL( clicked() ), 
		this, SLOT( getUri() ) );
	connect( okPushButton, SIGNAL( clicked() ),
		this, SLOT( slotOk() ) );
	connect( cancelPushButton, SIGNAL( clicked() ),
		this, SLOT( slotCancel() ) );
}
开发者ID:michalkielak,项目名称:tin,代码行数:55,代码来源:kreferdialog.cpp

示例6: QDialog

UserMenuDialog::UserMenuDialog( QWidget* parent,  QString name)
    : QDialog( parent) {
    setWindowTitle(name);
    setModal(true);
    ui.setupUi(this);

    previous_index=0;

    connect(ui.listWidget, SIGNAL(currentRowChanged(int)),this,SLOT(change(int)));
    connect( ui.buttonBox, SIGNAL(accepted()), SLOT(slotOk()) );
}
开发者ID:SiniAghilas,项目名称:texmaker-3.3.3,代码行数:11,代码来源:usermenudialog.cpp

示例7: KDialog

NamedAreaDialog::NamedAreaDialog(QWidget* parent, Selection* selection)
        : KDialog(parent)
        , m_selection(selection)
{
    setButtons(KDialog::Ok | KDialog::Close | KDialog::User1 | KDialog::User2 | KDialog::User3);
    setButtonsOrientation(Qt::Vertical);
    setButtonText(KDialog::Ok, i18n("&Select"));
    setButtonText(KDialog::User1, i18n("&Remove"));
    setButtonText(KDialog::User2, i18n("&Edit..."));
    setButtonText(KDialog::User3, i18n("&New..."));
    setCaption(i18n("Named Areas"));
    setModal(true);
    setObjectName("NamedAreaDialog");

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

    QVBoxLayout *vboxLayout = new QVBoxLayout(widget);
    vboxLayout->setMargin(0);
    vboxLayout->setSpacing(KDialog::spacingHint());

    m_list = new KListWidget(this);
    m_list->setSortingEnabled(true);
    vboxLayout->addWidget(m_list);

    m_rangeName = new QLabel(this);
    m_rangeName->setText(i18n("Area: %1", QString()));
    vboxLayout->addWidget(m_rangeName);

    const QList<QString> namedAreas = m_selection->activeSheet()->map()->namedAreaManager()->areaNames();
    for (int i = 0; i < namedAreas.count(); ++i)
        m_list->addItem(namedAreas[i]);

    if (m_list->count() == 0) {
        enableButtonOk(false);
        enableButton(KDialog::User1, false);
        enableButton(KDialog::User2, false);
        m_list->setCurrentRow(0);
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(cancelClicked()), this, SLOT(slotClose()));
    connect(this, SIGNAL(user1Clicked()), this, SLOT(slotRemove()));
    connect(this, SIGNAL(user2Clicked()), this, SLOT(slotEdit()));
    connect(this, SIGNAL(user3Clicked()), this, SLOT(slotNew()));
    connect(m_list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(slotOk()));
    connect(m_list, SIGNAL(currentTextChanged(const QString&)),
            this, SLOT(displayAreaValues(const QString&)));

    if (m_list->count() > 0)
        m_list->setCurrentItem(m_list->item(0));

    m_list->setFocus();
}
开发者ID:KDE,项目名称:koffice,代码行数:54,代码来源:NamedAreaDialog.cpp

示例8: MultiPageDialogBase

/**
 *  Sets up an Association Properties Dialog.
 *  @param  parent  The parent of the AssociationPropertiesDialog
 *  @param  assocWidget  The Association Widget to display properties of.
 *  @param  pageNum The page to show first.
 */
AssociationPropertiesDialog::AssociationPropertiesDialog (QWidget *parent, AssociationWidget * assocWidget, int pageNum)
  : MultiPageDialogBase(parent),
    m_pAssoc(assocWidget)
{
    Q_UNUSED(pageNum)
    setCaption(i18n("Association Properties"));
    setupPages();

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
}
开发者ID:Nephos,项目名称:umbrello,代码行数:17,代码来源:associationpropertiesdialog.cpp

示例9: KDialog

EditNotifyDialog::EditNotifyDialog(QWidget* parent,
int serverGroupId,
const QString& nickname):
    KDialog(parent)

{
    setCaption( i18n("Edit Watched Nickname") );
    setModal( true );
    setButtons( KDialog::Ok | KDialog::Cancel );
    setDefaultButton( KDialog::Ok );
    QWidget* page = mainWidget();

    QGridLayout* layout = new QGridLayout(page);

    QLabel* networkNameLabel=new QLabel(i18n("&Network name:"), page);
    QString networkNameWT = i18n(
        "Pick the server network you will connect to here.");
    networkNameLabel->setWhatsThis(networkNameWT);
    networkNameLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_networkNameCombo=new KComboBox(page);
    m_networkNameCombo->setWhatsThis(networkNameWT);
    networkNameLabel->setBuddy(m_networkNameCombo);

    QLabel* nicknameLabel=new QLabel(i18n("N&ickname:"), page);
    QString nicknameWT = i18n(
        "<qt>The nickname to watch for when connected to a server in the network.</qt>");
    nicknameLabel->setWhatsThis(nicknameWT);
    nicknameLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_nicknameInput = new KLineEdit(nickname, page);
    m_nicknameInput->setWhatsThis(nicknameWT);
    nicknameLabel->setBuddy(m_nicknameInput);

    // Add network names to network combobox and select the one corresponding to argument.
    m_networkNameCombo->addItem(i18n("All Networks"), -1);
    QList<Server *> serverList = Application::instance()->getConnectionManager()->getServerList();
    for (int i = 0; i < serverList.count(); ++i)
    {
      Server *server = serverList.at(i);
      if (server->getServerGroup())
        m_networkNameCombo->addItem(server->getServerGroup()->name(), server->getServerGroup()->id());
    }
    m_networkNameCombo->setCurrentIndex(m_networkNameCombo->findData(serverGroupId, Qt::UserRole));
    layout->addWidget(networkNameLabel, 0, 0);
    layout->addWidget(m_networkNameCombo, 0, 1);
    layout->addWidget(nicknameLabel, 1, 0);
    layout->addWidget(m_nicknameInput, 1, 1);

    setButtonGuiItem( KDialog::Ok, KGuiItem(i18n("&OK"),"dialog-ok",i18n("Change notify information")));
    setButtonGuiItem( KDialog::Cancel, KGuiItem(i18n("&Cancel"),"dialog-cancel",i18n("Discards all changes made")));
    connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()) );

    m_nicknameInput->setFocus();
}
开发者ID:wordlet,项目名称:mykonvi,代码行数:53,代码来源:editnotifydialog.cpp

示例10: ItemViewSettupDialog

//----
GanttViewSettingsDialog::GanttViewSettingsDialog( GanttViewBase *gantt, GanttItemDelegate *delegate, ViewBase *view )
    : ItemViewSettupDialog( view, gantt->treeView(), true, view ),
    m_gantt( gantt )
{
    GanttChartDisplayOptionsPanel *panel = new GanttChartDisplayOptionsPanel( delegate );
    /*KPageWidgetItem *page = */insertWidget( 1, panel, i18n( "Chart" ), i18n( "Gantt Chart Settings" ) );
    QTabWidget *tab = new QTabWidget();
    QWidget *w = ViewBase::createPageLayoutWidget( view );
    tab->addTab( w, w->windowTitle() );
    m_pagelayout = w->findChild<KoPageLayoutWidget*>();
    Q_ASSERT( m_pagelayout );

    m_printingoptions = new GanttPrintingOptionsWidget( this );
    m_printingoptions->setOptions( gantt->printingOptions() );
    tab->addTab( m_printingoptions, m_printingoptions->windowTitle() );
    /*KPageWidgetItem *page = */insertWidget( 2, tab, i18n( "Printing" ), i18n( "Printing Options" ) );

    connect( this, SIGNAL(accepted()), this, SLOT(slotOk()) );
    connect( this, SIGNAL(accepted()), panel, SLOT(slotOk()) );
    connect( button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), panel, SLOT(setDefault()) );
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:22,代码来源:kptganttview.cpp

示例11: KCMultiDialog

KJotsConfigDlg::KJotsConfigDlg( const QString & title, QWidget *parent )
  : KCMultiDialog( parent )
{
    setCaption( title );
    setFaceType( KPageDialog::List );
    setButtons( Default | Ok | Cancel );
    setDefaultButton( Ok );

    showButtonSeparator( true );

    addModule( "kjots_config_misc" );
    connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:13,代码来源:kjotsconfigdlg.cpp

示例12: KDialog

UMLTemplateDialog::UMLTemplateDialog(QWidget* pParent, UMLTemplate* pTemplate)
        : KDialog( pParent)
{
    m_pTemplate = pTemplate;
    setCaption( i18n("Template Properties") );
    setButtons( Help | Ok | Cancel );
    setDefaultButton( Ok );
    setModal( true );
    showButtonSeparator( true );
    setupDialog();
    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
}
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:13,代码来源:umltemplatedialog.cpp

示例13: KoDialog

WBSDefinitionDialog::WBSDefinitionDialog(Project &project, WBSDefinition &def, QWidget *p)
    : KoDialog(p)
{
    setCaption( i18n("WBS Definition") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    m_panel = new WBSDefinitionPanel(project, def, this);
    setMainWidget(m_panel);
    enableButtonOk(false);
    connect(m_panel, SIGNAL(changed(bool)), SLOT(enableButtonOk(bool)));
    connect(this, SIGNAL(okClicked()), SLOT(slotOk()));
}
开发者ID:KDE,项目名称:calligra,代码行数:14,代码来源:kptwbsdefinitiondialog.cpp

示例14: KDialog

K3b::AudioTrackDialog::AudioTrackDialog( const QList<K3b::AudioTrack*>& tracks, QWidget *parent )
    : KDialog( parent)
{
    m_tracks = tracks;

    setCaption(i18n("Audio Track Properties"));
    setButtons(Ok|Cancel|Apply);
    setDefaultButton(Ok);
    setModal(true);
    connect(this,SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));

    setupGui();
}
开发者ID:franhaufer,项目名称:k3b,代码行数:14,代码来源:k3baudiotrackdialog.cpp

示例15: timerTimeout

void KTimerDialog::slotInternalTimeout()
{
    emit timerTimeout();
    switch(buttonOnTimeout)
    {
        case Help:
            slotHelp();
            break;
        case Default:
            slotDefault();
            break;
        case Ok:
            slotOk();
            break;
        case Apply:
            applyPressed();
            break;
        case Try:
            slotTry();
            break;
        case Cancel:
            slotCancel();
            break;
        case Close:
            slotClose();
            break;
        /*case User1:
            slotUser1();
            break;
        case User2:
            slotUser2();
            break;*/
        case User3:
            slotUser3();
            break;
        case No:
            slotNo();
            break;
        case Yes:
            slotCancel();
            break;
        case Details:
            slotDetails();
            break;
        case Filler:
        case Stretch:
            kdDebug() << "Cannot execute button code " << buttonOnTimeout << endl;
            break;
    }
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:50,代码来源:ktimerdialog.cpp


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