本文整理汇总了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()));
}
示例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() ) );
}
示例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()));
}
示例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);
}
示例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() ) );
}
示例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()) );
}
示例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();
}
示例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()));
}
示例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();
}
示例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()) );
}
示例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()) );
}
示例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()));
}
示例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()));
}
示例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();
}
示例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;
}
}