本文整理汇总了C++中cancelClicked函数的典型用法代码示例。如果您正苦于以下问题:C++ cancelClicked函数的具体用法?C++ cancelClicked怎么用?C++ cancelClicked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cancelClicked函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KDialog
void IdleTimeDetector::informOverrun()
{
if (!_overAllIdleDetect)
return; // In the preferences the user has indicated that he do not
// want idle detection.
_timer->stop();
start = QDateTime::currentDateTime();
idlestart = start.addSecs(-60 * _maxIdle);
QString backThen = KGlobal::locale()->formatTime(idlestart.time());
// Create dialog
KDialog *dialog=new KDialog( 0 );
QWidget* wid=new QWidget(dialog);
dialog->setMainWidget( wid );
QVBoxLayout *lay1 = new QVBoxLayout(wid);
QHBoxLayout *lay2 = new QHBoxLayout();
lay1->addLayout(lay2);
QString idlemsg=QString( "Desktop has been idle since %1. What do you want to do ?" ).arg(backThen);
QLabel *label = new QLabel( idlemsg, wid );
lay2->addWidget( label );
connect( dialog , SIGNAL(cancelClicked()) , this , SLOT(revert()) );
connect( wid , SIGNAL(changed(bool)) , wid , SLOT(enabledButtonApply(bool)) );
QString explanation=i18n("Continue timing. Timing has started at %1", backThen);
QString explanationrevert=i18n("Stop timing and revert back to the time at %1.", backThen);
dialog->setButtonText(KDialog::Ok, i18n("Continue timing."));
dialog->setButtonText(KDialog::Cancel, i18n("Revert timing"));
dialog->setButtonWhatsThis(KDialog::Ok, explanation);
dialog->setButtonWhatsThis(KDialog::Cancel, explanationrevert);
// The user might be looking at another virtual desktop as where ktimetracker is running
KWindowSystem::self()->setOnDesktop( dialog->winId(), KWindowSystem::self()->currentDesktop() );
KWindowSystem::self()->demandAttention( dialog->winId() );
kDebug(5970) << "Setting WinId " << dialog->winId() << " to deskTop " << KWindowSystem::self()->currentDesktop();
dialog->show();
}
示例2: buttonClicked
void RemoveRedEyesWindow::slotButtonClicked(int button)
{
emit buttonClicked(static_cast<KDialog::ButtonCode> (button));
switch (button)
{
case User2: // testrun
emit user2Clicked();
break;
case User1: // correction
emit user1Clicked();
break;
case Cancel:
emit cancelClicked();
break;
case Close:
emit myCloseClicked();
break;
case Help:
emit helpClicked();
break;
case Default:
emit defaultClicked();
break;
}
}
示例3: if
void Dialog::setProgressDialogVisible(bool b)
{
if (!b)
{
d->deleteProgressDialog(true);
}
else if(d->progressDialogTimeout >= 0)
{
if (d->progressDialog)
{
return;
}
d->progressDialog = new KProgressDialog(this, i18nc("@title:window", "Check Spelling"),
i18nc("progress label", "Spell checking in progress..."));
d->progressDialog->setModal(true);
d->progressDialog->setAutoClose(false);
d->progressDialog->setAutoReset(false);
// create an 'indefinite' progress box as we currently cannot get progress feedback from
// the speller
d->progressDialog->progressBar()->reset();
d->progressDialog->progressBar()->setRange(0, 0);
d->progressDialog->progressBar()->setValue(0);
connect(d->progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel()));
d->progressDialog->setMinimumDuration(d->progressDialogTimeout);
}
}
示例4: QDialog
//----------------------------------------------------------------------
// Save Single File Dialog Widget
//----------------------------------------------------------------------
SaveSingleDialogWidget::SaveSingleDialogWidget(MainWindow *mainWindow, RideItem *rideItem) :
QDialog(mainWindow, Qt::Dialog), mainWindow(mainWindow), rideItem(rideItem)
{
setWindowTitle(tr("Save and Conversion"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
// Warning text
warnText = new QLabel(tr("WARNING\n\nYou have made changes to ") + rideItem->fileName + tr(" If you want to save\nthem, we need to convert the ride to GoldenCheetah\'s\nnative format. Should we do so?\n"));
mainLayout->addWidget(warnText);
// Buttons
QHBoxLayout *buttonLayout = new QHBoxLayout;
saveButton = new QPushButton(tr("&Save and Convert"), this);
buttonLayout->addWidget(saveButton);
abandonButton = new QPushButton(tr("&Discard Changes"), this);
buttonLayout->addWidget(abandonButton);
cancelButton = new QPushButton(tr("&Cancel Save"), this);
buttonLayout->addWidget(cancelButton);
mainLayout->addLayout(buttonLayout);
// Don't warn me!
warnCheckBox = new QCheckBox(tr("Always warn me about file conversions"), this);
warnCheckBox->setChecked(true);
mainLayout->addWidget(warnCheckBox);
// connect up slots
connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
connect(abandonButton, SIGNAL(clicked()), this, SLOT(abandonClicked()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
connect(warnCheckBox, SIGNAL(clicked()), this, SLOT(warnSettingClicked()));
}
示例5: QDialog
K3b::DataMultisessionImportDialog::DataMultisessionImportDialog( QWidget* parent )
: QDialog( parent),
d( new Private() )
{
setModal(true);
setWindowTitle(i18n("Session Import"));
QVBoxLayout* layout = new QVBoxLayout( this );
QLabel* label = new QLabel( i18n( "Please select a session to import." ), this );
d->sessionView = new QTreeWidget( this );
d->sessionView->setHeaderHidden( true );
d->sessionView->setItemsExpandable( false );
d->sessionView->setRootIsDecorated( false );
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this );
d->okButton = buttonBox->button( QDialogButtonBox::Ok );
connect( buttonBox, SIGNAL(accepted()), SLOT(accept()) );
connect( buttonBox, SIGNAL(rejected()), SLOT(reject()) );
layout->addWidget( label );
layout->addWidget( d->sessionView );
layout->addWidget( buttonBox );
connect( k3bappcore->mediaCache(), SIGNAL(mediumChanged(K3b::Device::Device*)),
this, SLOT(updateMedia()) );
connect( d->sessionView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
this, SLOT(slotSelectionChanged()) );
connect( d->sessionView, SIGNAL(itemActivated(QTreeWidgetItem*,int)), SIGNAL(okClicked()) );
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
}
示例6: QWidget
EnterWirelessSettingPage::EnterWirelessSettingPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::EnterWirelessSettingPage)
{
ui->setupUi(this);
connect(ui->m_searchRouterPane, SIGNAL(searchRouterClicked()),
this ,SIGNAL(searchRouterClicked()));
connect(ui->m_wirelessSettingPane, SIGNAL(settingValidityUpdate(bool)), SLOT(onSettingValidityUpdate(bool)));
connect(ui->m_operatePane, SIGNAL(applyClicked()), SLOT(onApplySetting()));
connect(ui->m_operatePane, SIGNAL(cancelClicked()), this, SIGNAL(cancelClicked()));
retranslateUi();
}
示例7: QDialog
TomoToolConfigDialog::TomoToolConfigDialog(QWidget *parent) : QDialog(parent) {
labelRun = new QLabel("Runnable script");
editRun = new QLineEdit("/work/imat/");
hRun = new QHBoxLayout();
hRun->addWidget(labelRun);
hRun->addWidget(editRun);
labelOpt = new QLabel("Command line options");
editOpt = new QLineEdit("/work/imat");
hOpt = new QHBoxLayout();
hOpt->addWidget(labelOpt);
hOpt->addWidget(editOpt);
okButton = new QPushButton("Ok");
cancelButton = new QPushButton("Cancel");
hBut = new QHBoxLayout();
hBut->insertStretch(0, 1);
hBut->addWidget(okButton);
hBut->addWidget(cancelButton);
layout = new QGridLayout();
layout->addLayout(hRun, 0, 0);
layout->addLayout(hOpt, 1, 0);
layout->addLayout(hOpt, 2, 0);
connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
}
示例8: dir
void ExportSymlinks::execute()
{
// test the destination directory
if (m_destinationDir->isEmpty()) {
tracer->error(__func__, "The specified 'destinationDir' is null or empty!");
return;
}
QDir dir(*m_destinationDir);
if (!dir.exists()) {
tracer->error(__func__, "The specified 'destinationDir' does not exist or is not a directory!");
return;
}
// test the files to export
if (!m_sourceFiles || m_sourceFiles->isEmpty()) {
tracer->info(__func__, "No files to export!");
return;
}
// setup progress dialog
m_progressDialog = new KProgressDialog(m_parent, "exportSymlinksProgressDialog", i18n("Exporting symbolic links"), i18n("Initializing export..."), true);
m_progressDialog->progressBar()->setTotalSteps(m_sourceFiles->count());
m_progressDialog->setAllowCancel(true);
connect(m_progressDialog, SIGNAL(cancelClicked()), this, SLOT(slotCancel()));
m_progressDialog->show();
// do the job
doExport();
}
示例9: KPageDialog
ValidatorsDialog::ValidatorsDialog(QWidget *parent )
: KPageDialog( parent)
{
setButtons(Ok|Cancel);
setDefaultButton(Ok);
setModal(false);
showButtonSeparator(true);
setCaption(i18nc("@title:window", "Configure Validator Plugin"));
setMinimumWidth(400);
#ifdef HAVE_TIDY
QWidget* internalConfiguration = new QWidget();
m_internalUi.setupUi(internalConfiguration);
internalConfiguration->layout()->setMargin(0);
KPageWidgetItem *internalConfigurationItem = addPage(internalConfiguration, i18n("Internal Validation"));
internalConfigurationItem->setIcon(KIcon("validators"));
#endif
QWidget* remoteConfiguration = new QWidget();
m_remoteUi.setupUi(remoteConfiguration);
remoteConfiguration->layout()->setMargin(0);
KPageWidgetItem *remoteConfigurationItem = addPage(remoteConfiguration, i18n("Remote Validation"));
remoteConfigurationItem->setIcon(KIcon("validators"));
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
load();
}
示例10: QDialog
ProgressWidget::ProgressWidget(qint64 directorySizeInBytes, QDialog *parent)
: QDialog(parent)
, mActionState(RUNNING)
, mDirectorySizeInBytes(directorySizeInBytes)
, mBytesProcessed(0)
{
setWindowTitle("Search");
setModal(true);
mProgressBar = new QProgressBar();
mProgressBar->setMaximum(100);
mProgressBar->setMinimumWidth(200);
mProgressBar->setAlignment(Qt::AlignCenter);
mProgressBar->setValue(0);
mPauseOrContinueButton = new QPushButton("&Pause");
mCancelButton = new QPushButton("&Cancel");
QHBoxLayout* hLayout = new QHBoxLayout();
hLayout->addWidget(mPauseOrContinueButton);
hLayout->addWidget(mCancelButton);
hLayout->setSpacing(6);
hLayout->setContentsMargins(11, 11, 11, 11);
QVBoxLayout* vLayout = new QVBoxLayout();
vLayout->addWidget(mProgressBar);
vLayout->addLayout(hLayout);
connect(mPauseOrContinueButton, SIGNAL(clicked()), SLOT(pauseClicked()));
connect(mCancelButton, SIGNAL(clicked()), SLOT(cancelClicked()));
setLayout(vLayout);
resize(300, 100);
}
示例11: QDialog
AvatarDownloadDialog::AvatarDownloadDialog(QWidget * par,const QString &szUrl)
: QDialog(par)
{
setWindowTitle(__tr2qs_ctx("Avatar Download - KVIrc","options"));
m_szUrl = szUrl;
QGridLayout * g = new QGridLayout(this);
m_pOutput = new QLabel(__tr2qs_ctx("<center>Please wait while the avatar is being downloaded</center>","options"),this);
g->addWidget(m_pOutput,0,0,1,2);
QPushButton * b = new QPushButton(__tr2qs_ctx("Abort","options"),this);
g->addWidget(b,1,1);
connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));
m_pRequest = new KviHttpRequest();
QTimer::singleShot(0,this,SLOT(startDownload()));
g->setRowStretch(0,1);
g->setColumnStretch(0,1);
setMinimumSize(250,120);
}
示例12: KDialog
FlattenDlg::FlattenDlg( QWidget* parent, const char* name )
: KDialog( parent )
{
setObjectName(name);
setModal(true);
setCaption( i18n( "Flatten Path" ) );
setButtons( Ok | Cancel );
// add input fields on the left:
QGroupBox* group = new QGroupBox( i18n( "Properties" ), this );
QHBoxLayout* layout = new QHBoxLayout;
layout->addWidget(new QLabel( i18n( "Flatness:" )));
m_flatness = new KDoubleNumInput(group);
layout->addWidget(m_flatness);
group->setLayout(layout);
group->setMinimumWidth( 300 );
// signals and slots:
connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) );
setMainWidget( group );
}
示例13: setButtons
void FacebookViewDialog::initUi()
{
setButtons( KDialog::Cancel );
setCaption( i18n( "Facebook Post" ) );
setAttribute( Qt::WA_DeleteOnClose, true );
QWidget * const widget = new QWidget( this );
QVBoxLayout * const layout = new QVBoxLayout( widget );
QWidget * const progressWidget = new QWidget( this );
QHBoxLayout * const progressLayout = new QHBoxLayout( progressWidget );
progressLayout->setMargin( 0 );
layout->setMargin( 0 );
setMainWidget( widget );
mWebView = new KWebView( this );
mWebView->setMinimumWidth(1000);
mWebView->setMinimumHeight(500);
mProgressBar = new QProgressBar( this );
mProgressBar->setRange( 0, 100 );
QLabel * const progressLabel = new QLabel( i18n( "Loading Page:" ), this );
progressLayout->addWidget( progressLabel );
progressLayout->addWidget( mProgressBar );
layout->addWidget( progressWidget );
layout->addWidget( mWebView );
connect( this, SIGNAL(cancelClicked()), SIGNAL(canceled()) );
connect( mWebView, SIGNAL(loadStarted()), progressWidget, SLOT(show()) );
connect( mWebView, SIGNAL(loadFinished(bool)), progressWidget, SLOT(hide()) );
connect( mWebView, SIGNAL(loadProgress(int)), mProgressBar, SLOT(setValue(int)) );
connect( mWebView, SIGNAL(urlChanged(QUrl)), this, SLOT(urlChanged(QUrl)) );
}
示例14: qCDebug
void SwWindow::slotStartTransfer()
{
qCDebug(KIPIPLUGINS_LOG) << "slotStartTransfer invoked";
m_transferQueue = m_widget->m_imgList->imageUrls();
// we will not upload directories -- duh!
for (int idx=m_transferQueue.count(); idx-->0; )
{
if ( QFileInfo( m_transferQueue.at(idx).path() ).isDir() )
{
m_widget->m_imgList->removeItemByUrl( m_transferQueue.at(idx) );
m_transferQueue.removeAt(idx);
}
}
if (m_transferQueue.isEmpty())
return;
m_currentAlbumID = m_widget->m_albumsCoB->itemData(m_widget->m_albumsCoB->currentIndex()).toLongLong();
m_imagesTotal = m_transferQueue.count();
m_imagesCount = 0;
m_progressDlg = new KProgressDialog(this, i18n("Transfer Progress"));
m_progressDlg->setMinimumDuration(0);
m_progressDlg->setModal(true);
m_progressDlg->setAutoReset(true);
m_progressDlg->setAutoClose(true);
m_progressDlg->progressBar()->setFormat(i18n("%v / %m"));
connect(m_progressDlg, SIGNAL(cancelClicked()),
this, SLOT(slotTransferCancel()));
uploadNextPhoto();
}
示例15: show
void
StravaUploadDialog::uploadToStrava()
{
show();
overwrite = true;
if(activityId.length()>0)
{
overwrite = false;
dialog = new QDialog();
QVBoxLayout *layout = new QVBoxLayout;
QVBoxLayout *layoutLabel = new QVBoxLayout();
QLabel *label = new QLabel();
label->setText(tr("This Ride is marked as already on Strava. Are you sure you want to upload it?"));
layoutLabel->addWidget(label);
QPushButton *ok = new QPushButton(tr("OK"), this);
QPushButton *cancel = new QPushButton(tr("Cancel"), this);
QHBoxLayout *buttons = new QHBoxLayout();
buttons->addStretch();
buttons->addWidget(cancel);
buttons->addWidget(ok);
connect(ok, SIGNAL(clicked()), this, SLOT(okClicked()));
connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()));
layout->addLayout(layoutLabel);
layout->addLayout(buttons);
dialog->setLayout(layout);
if (!dialog->exec()) return;
}
requestLogin();
if(!loggedIn)
{
/*QMessageBox aMsgBox;
aMsgBox.setText(tr("Cannot login to Strava. Check username/password"));
aMsgBox.exec();*/
reject();
}
requestUpload();
if(!uploadSuccessful)
{
progressLabel->setText("Error uploading to Strava");
}
else
{
//requestVerifyUpload();
progressLabel->setText(tr("Successfully uploaded to Strava\n")+uploadStatus);
}
uploadButton->setVisible(false);
cancelButton->setText("OK");
QApplication::processEvents();
}