• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cancelClicked函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了cancelClicked函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:34,代码来源:idletimedetector.cpp


示例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;
    }
}
开发者ID:Vogtinator,项目名称:kipi-plugins,代码行数:26,代码来源:removeredeyeswindow.cpp


示例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);
  }
}
开发者ID:fluxer,项目名称:kdelibs,代码行数:26,代码来源:dialog.cpp


示例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()));
}
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:34,代码来源:SaveDialogs.cpp


示例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()));
}
开发者ID:KDE,项目名称:k3b,代码行数:31,代码来源:k3bdatamultisessionimportdialog.cpp


示例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();
}
开发者ID:SiteView,项目名称:GenieMap-Temp-fingerpoint,代码行数:16,代码来源:enterwirelesssettingpage.cpp


示例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()));
}
开发者ID:liyulun,项目名称:mantid,代码行数:29,代码来源:TomoToolConfigDialog.cpp


示例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();
}
开发者ID:BackupTheBerlios,项目名称:kphotobook-svn,代码行数:29,代码来源:exportsymlinks.cpp


示例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();
}
开发者ID:blue-shell,项目名称:folderview,代码行数:28,代码来源:validatorsdialog.cpp


示例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);
}
开发者ID:PavloNaichuk,项目名称:Projects,代码行数:34,代码来源:ProgressWidget.cpp


示例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);
}
开发者ID:wodim,项目名称:KVIrc,代码行数:25,代码来源:OptionsWidget_identity.cpp


示例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 );
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:26,代码来源:FlattenPathPlugin.cpp


示例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)) );
}
开发者ID:adarsha83,项目名称:choqok-facebook,代码行数:32,代码来源:facebookviewdialog.cpp


示例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();
}
开发者ID:KDE,项目名称:kipi-plugins,代码行数:35,代码来源:swwindow.cpp


示例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();
}
开发者ID:27sparks,项目名称:GoldenCheetah,代码行数:60,代码来源:StravaUploadDialog.cpp


示例16: KPageDialog

KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 )
{
	setFaceType( KPageDialog::List );
	setWindowTitle( i18n( "Preferences" ) );
	setButtons( Help|Default|Ok|Apply|Cancel );
	setDefaultButton( Ok );
	setModal( true );
	showButtonSeparator( true );

	// ok i need some stuff in that pref dlg...
	//setIconListAllVisible(true);

	m_viewPage = new ViewPage();
	KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) );
	item->setIcon( KIcon( "preferences-desktop-theme" ) );
	item->setHeader( i18n( "View Settings" ) );
	m_viewPage->setSettings( viewSets );

	m_diffPage = new DiffPage();
	item = addPage( m_diffPage, i18n( "Diff" ) );
	item->setIcon( KIcon( "text-x-patch" ) );
	item->setHeader( i18n( "Diff Settings" ) );
	m_diffPage->setSettings( diffSets );

//	frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) );

	connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) );
	connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) );
	connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
	connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
	connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) );

	adjustSize();
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:34,代码来源:kompareprefdlg.cpp


示例17: QWidget

SettingsWidget::SettingsWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SettingsWidget)
{
    ui->setupUi(this);
    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    // Setup values
    ui->colorVarSpin->setValue(N_COLOR_VAR);
    ui->shapeVarSpin->setValue(N_POS_VAR);
    ui->nPointsSpin->setValue(N_POLY_POINTS);
    ui->focusLeft->setValue(FOCUS_LEFT);
    ui->focusRight->setValue(FOCUS_RIGHT);
    ui->focusTop->setValue(FOCUS_TOP);
    ui->focusBottom->setValue(FOCUS_BOTTOM);
    ui->shapeOptFreqSpin->setValue(SHAPE_OPT_FREQ);
    ui->guiRefreshSpin->setValue(GUI_REFRESH_RATE);
    ui->coreSpin->setValue(N_CORES);
    ui->minPolySpin->setValue(POLYS_MIN);
    ui->maxPolySpin->setValue(POLYS_MAX);
    ui->autofocusEnable->setChecked(AUTOFOCUS_ENABLED);
    ui->autofocusSubdivs->setValue(AUTOFOCUS_SUBDIVS);
    ui->autofocusDelay->setValue(AUTOFOCUS_DELAY);
}
开发者ID:Xxderp420xX,项目名称:Evolve,代码行数:25,代码来源:settingswidget.cpp


示例18: QDialog

  NetworkProxyDialog::NetworkProxyDialog(QSettings &t_settings, QWidget *t_parent = 0)
    : QDialog(t_parent), 
      m_settings(t_settings)
  {
    QGridLayout *layout = new QGridLayout(this);

    // NoProxy, DefaultProxy, Socks5Proxy, HttpProxy, HttpCachingProxy, FtpCachingProxy
    m_proxyType = new QComboBox();
    m_proxyType->addItem("No Proxy", QNetworkProxy::NoProxy);
    // Allow http only for now since that's known to be supported by ruby / aws
    // m_proxyType->addItem("Socks5 Proxy", QNetworkProxy::Socks5Proxy);
    m_proxyType->addItem("Http Proxy", QNetworkProxy::HttpProxy);

    connect(m_proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyTypeChanged(int)));

    m_hostName = new QLineEdit(this);
    m_port = new QLineEdit(this);
    m_port->setValidator(new QIntValidator(0, 65535));

    m_user = new QLineEdit(this);


    layout->addWidget(new QLabel("Proxy Type"), 0, 0);
    layout->addWidget(m_proxyType, 0, 1);
    layout->addWidget(new QLabel("Host Name"), 1, 0);
    layout->addWidget(m_hostName, 1, 1);
    layout->addWidget(new QLabel("Port"), 2, 0);
    layout->addWidget(m_port, 2, 1);
    layout->addWidget(new QLabel("User Name"), 3, 0);
    layout->addWidget(m_user, 3, 1);
    
    QHBoxLayout *buttonBox = new QHBoxLayout();

    QPushButton *saveButton = new QPushButton("Save");
    QPushButton *cancelButton = new QPushButton("Cancel");
    QPushButton *testButton = new QPushButton("Test");
   
    buttonBox->addWidget(saveButton);
    buttonBox->addWidget(cancelButton);
    buttonBox->addWidget(testButton);

    layout->addLayout(buttonBox, 4,0,1,2);

    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(testButton, SIGNAL(clicked()), this, SLOT(testClicked()));

    QNetworkProxy proxy(createProxy(t_settings));

    int type = m_proxyType->findData(proxy.type());
    QString user = proxy.user();
    QString hostname = proxy.hostName();
    int port = proxy.port();

    m_proxyType->setCurrentIndex(type>-1?type:0);
    m_user->setText(user);
    m_hostName->setText(hostname);
    m_port->setText(QString::number(port));
    proxyTypeChanged(m_proxyType->currentIndex());
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:60,代码来源:NetworkProxyDialog.cpp


示例19: cancelClicked

void SqliteVacuum::dumpProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
    //sqliteDebug() << exitCode << exitStatus;
    if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
        cancelClicked();
        m_result.setCode(ERR_OTHER);
    }

    if (m_dlg) {
        m_dlg->close();
    }

    if (m_result.isError() || m_canceled) {
        return;
    }
    QFileInfo fi(m_filePath);
    const qint64 origSize = fi.size();

    const QByteArray oldName(QFile::encodeName(m_tmpFilePath)), newName(QFile::encodeName(fi.absoluteFilePath()));
    if (0 != ::rename(oldName.constData(), newName.constData())) {
        m_result.setMessage(tr("Could not rename file \"%1\" to \"%2\".")
                            .arg(m_tmpFilePath, fi.absoluteFilePath()));
        sqliteWarning() << m_result;
    }

    if (!m_result.isError()) {
        const qint64 newSize = QFileInfo(m_filePath).size();
        const qint64 decrease = 100 - 100 * newSize / origSize;
        QMessageBox::information(0, QString(), // krazy:exclude=qclasses
            tr("The database has been compacted. Current size decreased by %1% to %2 MB.")
               .arg(decrease).arg(QLocale().toString(double(newSize)/1000000.0, 'f', 2)));
    }
}
开发者ID:KDE,项目名称:kdb,代码行数:33,代码来源:SqliteVacuum.cpp


示例20: setWindowTitle

void QModernProgressDialog::createWidgets() {
    setWindowTitle(tr("Progress"));
    setWindowIcon(QIcon());
    m_wasCancel=false;
    label=new QLabel(this);
    longmessage=new QTextEdit(this);
    longmessage->setVisible(false);
    progress=new QModernProgressWidget(this);
    progress->setMinimumSize(QSize(48,48));
    cancel=new QPushButton(tr("Cancel"), this);
    connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    QVBoxLayout* vbl=new QVBoxLayout;
    setLayout(vbl);
    QHBoxLayout* hbl=new QHBoxLayout;
    hbl->addWidget(progress);
    hbl->addWidget(label);
    hbl->addStretch();
    vbl->addLayout(hbl);
    vbl->addWidget(longmessage);
    hbl=new QHBoxLayout;
    hbl->addStretch();
    hbl->addWidget(cancel);
    vbl->addLayout(hbl);
    connect(&timerDelay, SIGNAL(timeout()), this, SLOT(open()));

    QDesktopWidget desktopWidget;
    QRect desktopRect(desktopWidget.availableGeometry(desktopWidget.primaryScreen()));
    QRect widgetRect=rect();
    move(desktopRect.center() - widgetRect.center());
}
开发者ID:jkriege2,项目名称:LitSoz3,代码行数:31,代码来源:qmodernprogresswidget.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cancelData函数代码示例发布时间:2022-05-30
下一篇:
C++ cancel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap