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


C++ KGuiItem函数代码示例

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


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

示例1: acceptDialog

bool RandRScreen::confirm()
{
    // uncomment the line below and edit out the KTimerDialog stuff to get
    // a version which works on today's kdelibs (no accept dialog is presented)

    // FIXME remember to put the dialog on the right screen

    KTimerDialog acceptDialog(15000, KTimerDialog::CountDown, KApplication::kApplication()->mainWidget(), "mainKTimerDialog", true,
                              i18n("Confirm Display Setting Change"), KTimerDialog::Ok | KTimerDialog::Cancel, KTimerDialog::Cancel);

    acceptDialog.setButtonOK(KGuiItem(i18n("&Accept Configuration"), "button_ok"));
    acceptDialog.setButtonCancel(KGuiItem(i18n("&Return to Previous Configuration"), "button_cancel"));

    KActiveLabel *label = new KActiveLabel(i18n("Your screen orientation, size and refresh rate "
                                                "have been changed to the requested settings. Please indicate whether you wish to "
                                                "keep this configuration. In 15 seconds the display will revert to your previous "
                                                "settings."),
                                           &acceptDialog, "userSpecifiedLabel");

    acceptDialog.setMainWidget(label);

    KDialog::centerOnScreen(&acceptDialog, m_screen);

    m_shownDialog = &acceptDialog;
    connect(m_shownDialog, SIGNAL(destroyed()), this, SLOT(shownDialogDestroyed()));
    connect(kapp->desktop(), SIGNAL(resized(int)), this, SLOT(desktopResized()));

    return acceptDialog.exec();
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:29,代码来源:randr.cpp

示例2: i18n

void K3b::AudioBurnDialog::slotNormalizeToggled( bool on )
{
    if( on ) {
        // we are not able to normalize in on-the-fly mode
        if( !k3bcore->externalBinManager()->foundBin( "normalize" ) ) {
            KMessageBox::sorry( this, i18n("<p><b>External program <em>normalize</em> is not installed.</b>"
                                           "<p>K3b uses <em>normalize</em> (http://normalize.nongnu.org/) "
                                           "to normalize audio tracks. In order to "
                                           "use this functionality, please install it first.") );
            m_checkNormalize->setChecked( false );
        }
        else if( !m_checkCacheImage->isChecked() && !m_checkOnlyCreateImage->isChecked() ) {
            if( KMessageBox::warningYesNo( this, i18n("<p>K3b is not able to normalize audio tracks when burning on-the-fly. "
                                                      "The external program used for this task only supports normalizing a set "
                                                      "of audio files."),
                                           QString(),
                                           KGuiItem( i18n("Disable normalization") ),
                                           KGuiItem( i18n("Disable on-the-fly burning") ),
                                           "audioProjectNormalizeOrOnTheFly" ) == KMessageBox::Yes )
                m_checkNormalize->setChecked( false );
            else
                m_checkCacheImage->setChecked( true );
        }
    }
}
开发者ID:franhaufer,项目名称:k3b,代码行数:25,代码来源:k3baudioburndialog.cpp

示例3: RK_TRACE

bool RKCaughtX11Window::close (bool also_delete) {
	RK_TRACE (MISC);

	if (killed_in_r || RKGlobals::rInterface ()->backendIsDead ()) {
		return RKMDIWindow::close (also_delete);
	}

	if (rk_native_device) rk_native_device->stopInteraction ();

	QString status = i18n ("Closing device (saving history)");
	if (!close_attempted) {
		RCommand* c = new RCommand ("dev.off (" + QString::number (device_number) + ')', RCommand::App, i18n ("Shutting down device number %1", device_number));
		setStatusMessage (status, c);
		RKGlobals::rInterface ()->issueCommand (c);
		close_attempted = true;
	} else {
		if (KMessageBox::questionYesNo (this, i18n ("<p>The graphics device is being closed, saving the last plot to the plot history. This may take a while, if the R backend is still busy. You can close the graphics device immediately, in case it is stuck. However, the last plot may be missing from the plot history, if you do this.</p>")
#ifdef Q_WS_X11
		+ i18n ("<p>Note: On X11, the embedded window may be expurged, and you will have to close it manually in this case.</p>")
#endif
		, status, KGuiItem (i18n ("Close immediately")), KGuiItem (i18n ("Keep waiting"))) == KMessageBox::Yes) forceClose ();
	}

	return false;
}
开发者ID:KDE,项目名称:rkward,代码行数:25,代码来源:rkwindowcatcher.cpp

示例4: testSetGuiItem

 void testSetGuiItem()
 {
     KDualAction action(0);
     action.setInactiveGuiItem(KGuiItem(INACTIVE_TEXT));
     action.setActiveGuiItem(KGuiItem(ACTIVE_TEXT));
     QCOMPARE(action.inactiveText(), INACTIVE_TEXT);
     QCOMPARE(action.activeText(), ACTIVE_TEXT);
     QCOMPARE(action.text(), INACTIVE_TEXT);
 }
开发者ID:SpiritSPb,项目名称:kwidgetsaddons,代码行数:9,代码来源:kdualactiontest.cpp

示例5: QWidget

KexiDBConnectionWidget::KexiDBConnectionWidget(QWidget* parent)
        : QWidget(parent)
        , d(new Private())
{
    setupUi(this);
    setObjectName("KexiConnSelectorWidget");
    iconLabel->setPixmap(DesktopIcon(KEXI_ICON_DATABASE_SERVER));

    QVBoxLayout *driversComboLyr = new QVBoxLayout(frmEngine);
    m_driversCombo = new KexiDBDriverComboBox(frmEngine, Kexi::driverManager().driversInfo(),
            KexiDBDriverComboBox::ShowServerDrivers);
    //lblEngine->setFocusProxy( m_driversCombo );
    driversComboLyr->addWidget(m_driversCombo);
    frmEngine->setFocusProxy(m_driversCombo);
    lblEngine->setBuddy(m_driversCombo);
    QWidget::setTabOrder(lblEngine, m_driversCombo);

#ifdef NO_LOAD_DB_LIST
    btnLoadDBList->hide();
#endif
    btnLoadDBList->setIcon(KIcon("view-refresh"));
    btnLoadDBList->setToolTip(i18n("Load database list from the server"));
    btnLoadDBList->setWhatsThis(
        i18n("Loads database list from the server, so you can select one using the \"Name\" combo box."));

    QHBoxLayout *hbox = new QHBoxLayout(frmBottom);
    hbox->addStretch(2);
    d->btnSaveChanges = new KPushButton(
        KGuiItem(
            i18n("Save Changes"), "document-save",
            i18n("Save all changes made to this connection information"),
            i18n("Save all changes made to this connection information. "
                 "You can later reuse this information.")),
        frmBottom);
    d->btnSaveChanges->setObjectName("savechanges");
    hbox->addWidget(d->btnSaveChanges);
    hbox->addSpacing(KDialog::spacingHint());
    QWidget::setTabOrder(titleEdit, d->btnSaveChanges);
    d->btnSaveChanges->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    d->btnTestConnection = new KPushButton(
// @todo add Test Connection icon
        KGuiItem(i18n("&Test Connection"), QString(),
                 i18n("Test database connection"),
                 i18n("Tests database connection. "
                      "You can ensure that valid connection information is provided.")),
        frmBottom);
    d->btnTestConnection->setObjectName("testConnection");
    hbox->addWidget(d->btnTestConnection);
    setTabOrder(d->btnSaveChanges, d->btnTestConnection);
    d->btnTestConnection->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    connect(locationBGrp, SIGNAL(clicked(int)), this, SLOT(slotLocationBGrpClicked(int)));
    connect(chkPortDefault, SIGNAL(toggled(bool)), this , SLOT(slotCBToggled(bool)));
    connect(btnLoadDBList, SIGNAL(clicked()), this, SIGNAL(loadDBList()));
    connect(d->btnSaveChanges, SIGNAL(clicked()), this, SIGNAL(saveChanges()));
}
开发者ID:KDE,项目名称:calligra-history,代码行数:57,代码来源:kexidbconnectionwidget.cpp

示例6: KDialogBase

IppReportDlg::IppReportDlg(TQWidget *parent, const char *name)
: KDialogBase(parent, name, true, i18n("IPP Report"), Close|User1, Close, false, KGuiItem(i18n("&Print"), "fileprint"))
{
	m_edit = new KTextEdit(this);
	m_edit->setReadOnly(true);
	setMainWidget(m_edit);
	resize(540, 500);
	setFocusProxy(m_edit);
	setButtonGuiItem(User1, KGuiItem(i18n("&Print"),"fileprint"));
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:10,代码来源:ippreportdlg.cpp

示例7: qstrcmp

bool CfgWm::tryWmLaunch()
{
    if( currentWm() == KWIN_BIN
        && qstrcmp( NETRootInfo( QX11Info::connection(), NET::SupportingWMCheck ).wmName(), "KWin" ) == 0 )
    {
        return true; // it is already running, don't necessarily restart e.g. after a failure with other WM
    }
    KMessageBox::information( window(), i18n( "Your running window manager will be now replaced with "
        "the configured one." ), i18n( "Window Manager Change" ), "windowmanagerchange" );
    wmLaunchingState = WmLaunching;
    wmProcess = new KProcess;
    *wmProcess << KShell::splitArgs( currentWmData().exec ) << currentWmData().restartArgument;
    connect( wmProcess, SIGNAL( error( QProcess::ProcessError )), this, SLOT( wmLaunchError()));
    connect( wmProcess, SIGNAL( finished( int, QProcess::ExitStatus )),
        this, SLOT( wmLaunchFinished( int, QProcess::ExitStatus )));
    wmProcess->start();
    wmDialog = new KTimerDialog( 20000, KTimerDialog::CountDown, window(), i18n( "Config Window Manager Change" ),
        KTimerDialog::Ok | KTimerDialog::Cancel, KTimerDialog::Cancel );
    wmDialog->setButtonGuiItem( KDialog::Ok, KGuiItem( i18n( "&Accept Change" ), "dialog-ok" ));
    wmDialog->setButtonGuiItem( KDialog::Cancel, KGuiItem( i18n( "&Revert to Previous" ), "dialog-cancel" ));
    QLabel *label = new QLabel(
        i18n( "The configured window manager is being launched.\n"
            "Please check it has started properly and confirm the change.\n"
            "The launch will be automatically reverted in 20 seconds." ), wmDialog );
    label->setWordWrap( true );
    wmDialog->setMainWidget( label );
    if( wmDialog->exec() == QDialog::Accepted ) // the user confirmed
        wmLaunchingState = WmOk;
    else // cancelled for some reason
        {
        if( wmLaunchingState == WmLaunching )
            { // time out
            wmLaunchingState = WmFailed;
            KProcess::startDetached( KWIN_BIN, QStringList() << "--replace" );
            // Let's hope KWin never fails.
            KMessageBox::sorry( window(),
                i18n( "The running window manager has been reverted to the default KDE window manager KWin." ));
            }
        else if( wmLaunchingState == WmFailed )
            {
            KProcess::startDetached( KWIN_BIN, QStringList() << "--replace" );
            // Let's hope KWin never fails.
            KMessageBox::sorry( window(),
                i18n( "The new window manager has failed to start.\n"
                    "The running window manager has been reverted to the default KDE window manager KWin." ));
            }
        }
    bool ret = ( wmLaunchingState == WmOk );
    wmLaunchingState = WmNone;
    delete wmDialog;
    wmDialog = NULL;
    // delete wmProcess; - it is intentionally leaked, since there is no KProcess:detach()
    wmProcess = NULL;
    return ret;
}
开发者ID:mafrez,项目名称:plasma-desktop,代码行数:55,代码来源:componentchooserwm.cpp

示例8: KDialogBase

QueueManager::QueueManager( QWidget *parent, const char *name )
    : KDialogBase( KDialogBase::Swallow, 0, parent, name, false, 0, Ok|Cancel )
{
    s_instance = this;

    // Gives the window a small title bar, and skips a taskbar entry
    KWin::setType( winId(), NET::Utility );
    KWin::setState( winId(), NET::SkipTaskbar );

    kapp->setTopWidget( this );
    setCaption( kapp->makeStdCaption( i18n("Queue Manager") ) );
    setInitialSize( QSize( 400, 260 ) );

    QVBox *mainBox = new QVBox( this );
    setMainWidget( mainBox );

    QHBox *box = new QHBox( mainWidget() );
    box->setSpacing( 5 );
    m_listview = new QueueList( box );

    QVBox *buttonBox = new QVBox( box );
    m_up     = new KPushButton( KGuiItem( QString::null, "up" ), buttonBox );
    m_down   = new KPushButton( KGuiItem( QString::null, "down" ), buttonBox );
    m_remove = new KPushButton( KGuiItem( QString::null, "edit_remove" ), buttonBox );
    m_add    = new KPushButton( KGuiItem( QString::null, "edit_add" ), buttonBox );
    m_clear  = new KPushButton( KGuiItem( QString::null, amaroK::icon( "playlist_clear" ) ), buttonBox );

    QToolTip::add( m_up,     i18n( "Move up" ) );
    QToolTip::add( m_down,   i18n( "Move down" ) );
    QToolTip::add( m_remove, i18n( "Remove" ) );
    QToolTip::add( m_add,    i18n( "Enqueue track" ) );
    QToolTip::add( m_clear,  i18n( "Clear queue" ) );

    m_up->setEnabled( false );
    m_down->setEnabled( false );
    m_remove->setEnabled( false );
    m_add->setEnabled( false );
    m_clear->setEnabled( false );

    connect( m_up,     SIGNAL( clicked() ), m_listview, SLOT( moveSelectedUp() ) );
    connect( m_down,   SIGNAL( clicked() ), m_listview, SLOT( moveSelectedDown() ) );
    connect( m_remove, SIGNAL( clicked() ), this,       SLOT( removeSelected() ) );
    connect( m_add,    SIGNAL( clicked() ), this,       SLOT( addItems() ) );
    connect( m_clear,  SIGNAL( clicked() ), m_listview, SLOT( clear() ) );

    Playlist *pl = Playlist::instance();
    connect( pl,         SIGNAL( selectionChanged() ),    SLOT( updateButtons() ) );
    connect( m_listview, SIGNAL( selectionChanged() ),    SLOT( updateButtons() ) );
    connect( pl,         SIGNAL( queueChanged(const PLItemList &, const PLItemList &) ),
             SLOT( addQueuedItems(const PLItemList &, const PLItemList &) ) );

    insertItems();
}
开发者ID:tmarques,项目名称:waheela,代码行数:53,代码来源:queuemanager.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: kDebug

bool KPlatoXmlLoader::load( const KoXmlElement& plan )
{
    kDebug(kplatoXmlDebugArea())<<"plan";
    QString syntaxVersion = plan.attribute( "version" );
    m_loader.setVersion( syntaxVersion );
    if ( syntaxVersion.isEmpty() ) {
        int ret = KMessageBox::warningContinueCancel(
                      0, i18n( "This document has no syntax version.\n"
                               "Opening it in Plan may lose information." ),
                      i18n( "File-Format Error" ), KGuiItem( i18n( "Continue" ) ) );
        if ( ret == KMessageBox::Cancel ) {
            m_message = "USER_CANCELED";
            return false;
        }
        // set to max version and hope for the best
        m_loader.setVersion( KPLATO_MAX_FILE_SYNTAX_VERSION );
    } else if ( syntaxVersion > KPLATO_MAX_FILE_SYNTAX_VERSION ) {
        int ret = KMessageBox::warningContinueCancel(
                      0, i18n( "This document was created with a newer version of KPlato than Plan can load.\n"
                               "Syntax version: %1\n"
                               "Opening it in this version of Plan may lose some information.", syntaxVersion ),
                      i18n( "File-Format Mismatch" ), KGuiItem( i18n( "Continue" ) ) );
        if ( ret == KMessageBox::Cancel ) {
            m_message = "USER_CANCELED";
            return false;
        }
    }
    m_loader.startLoad();
    bool result = false;
    KoXmlNode n = plan.firstChild();
    for ( ; ! n.isNull(); n = n.nextSibling() ) {
        if ( ! n.isElement() ) {
            continue;
        }
        KoXmlElement e = n.toElement();
        if ( e.tagName() == "project" ) {
            m_loader.setProject( m_project );
            result = load( m_project, e, m_loader );
            if ( result ) {
                if ( m_project->id().isEmpty() ) {
                    m_project->setId( m_project->uniqueNodeId() );
                    m_project->registerNodeId( m_project );
                }
            } else {
                m_loader.addMsg( XMLLoaderObject::Errors, "Loading of project failed" );
                kError()<<"Loading of project failed";
                //TODO add some ui here
            }
        }
    }
    m_loader.stopLoad();
    return result;
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:53,代码来源:KPlatoXmlLoader.cpp

示例11: KDialog

    ServerGroupDialog::ServerGroupDialog(const QString& title, QWidget *parent)
        : KDialog(parent)
    {
        setCaption(title);
        setButtons(Ok|Cancel);

        m_id = -1;
        m_identitiesNeedsUpdate = false;
        m_editedServer = false;

        m_mainWidget = new Ui::ServerGroupDialogUI();
        m_mainWidget->setupUi(mainWidget());
        mainWidget()->layout()->setMargin(0);
        m_mainWidget->serverWidget->layout()->setMargin(0);
        m_mainWidget->channelWidget->layout()->setMargin(0);

        connect(m_mainWidget->m_editIdentityButton, SIGNAL(clicked()), this, SLOT(editIdentity()));

        IdentityList identities = Preferences::identityList();

        for (IdentityList::ConstIterator it = identities.constBegin(); it != identities.constEnd(); ++it)
            m_mainWidget->m_identityCBox->addItem((*it)->getName());

        m_mainWidget->m_removeServerButton->setIcon(KIcon("list-remove"));
        m_mainWidget->m_upServerBtn->setIcon(KIcon("arrow-up"));
        m_mainWidget->m_downServerBtn->setIcon(KIcon("arrow-down"));

        connect(m_mainWidget->m_addServerButton, SIGNAL(clicked()), this, SLOT(addServer()));
        connect(m_mainWidget->m_changeServerButton, SIGNAL(clicked()), this, SLOT(editServer()));
        connect(m_mainWidget->m_removeServerButton, SIGNAL(clicked()), this, SLOT(deleteServer()));
        connect(m_mainWidget->m_serverLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateServerArrows()));
        connect(m_mainWidget->m_upServerBtn, SIGNAL(clicked()), this, SLOT(moveServerUp()));
        connect(m_mainWidget->m_downServerBtn, SIGNAL(clicked()), this, SLOT(moveServerDown()));

        m_mainWidget->m_removeChannelButton->setIcon(KIcon("list-remove"));
        m_mainWidget->m_upChannelBtn->setIcon(KIcon("arrow-up"));
        m_mainWidget->m_downChannelBtn->setIcon(KIcon("arrow-down"));

        connect(m_mainWidget->m_addChannelButton, SIGNAL(clicked()), this, SLOT(addChannel()));
        connect(m_mainWidget->m_changeChannelButton, SIGNAL(clicked()), this, SLOT(editChannel()));
        connect(m_mainWidget->m_removeChannelButton, SIGNAL(clicked()), this, SLOT(deleteChannel()));
        connect(m_mainWidget->m_channelLBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateChannelArrows()));
        connect(m_mainWidget->m_upChannelBtn, SIGNAL(clicked()), this, SLOT(moveChannelUp()));
        connect(m_mainWidget->m_downChannelBtn, SIGNAL(clicked()), this, SLOT(moveChannelDown()));

        setButtonGuiItem(Ok, KGuiItem(i18n("&OK"), "dialog-ok", i18n("Change network information")));
        setButtonGuiItem(Cancel, KGuiItem(i18n("&Cancel"), "dialog-cancel", i18n("Discards all changes made")));

        m_mainWidget->m_nameEdit->setFocus();

        setInitialSize(QSize(320, 400));
    }
开发者ID:wordlet,项目名称:mykonvi,代码行数:52,代码来源:servergroupdialog.cpp

示例12: qCDebug

void LoadCorruptQuery::execute()
{
    qCDebug(ARK) << "Executing LoadCorrupt prompt";
    QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));

    setResponse(KMessageBox::warningYesNo(Q_NULLPTR,
                                          xi18nc("@info", "The archive you're trying to open is corrupt.<nl/>"
                                                 "Some files may be missing or damaged."),
                                          i18nc("@title:window", "Corrupt archive"),
                                          KGuiItem(i18nc("@action:button", "Open as Read-Only")),
                                          KGuiItem(i18nc("@action:button", "Don't Open"))));
    QApplication::restoreOverrideCursor();
}
开发者ID:Zeirison,项目名称:ark,代码行数:13,代码来源:queries.cpp

示例13: KGuiItem

int MessageBox::questionYesNo(QWidget *parent, const QString &text, const QString &caption, const QString &yesButtonText, const QString &noButtonText)
{
	int result;
	if (!yesButtonText.isEmpty())
	{
		if (!noButtonText.isEmpty())
			result = KMessageBox::questionYesNo(parent, text, caption, KGuiItem(yesButtonText, "dialog-ok"), KGuiItem(noButtonText, "process-stop"));
		else
			result = KMessageBox::questionYesNo(parent, text, caption, KGuiItem(yesButtonText, "dialog-ok"));
	}
	else
		result = KMessageBox::questionYesNo(parent, text, caption);

	return (result == KMessageBox::Yes) ? Yes : No;
}
开发者ID:KarateSnowMachine,项目名称:qtikz-svn,代码行数:15,代码来源:messagebox.cpp

示例14: KDialogBase

KHLogin::KHLogin(QWidget *parent ) : KDialogBase(parent, "KHLogin", true, i18n("Log in"), User1 |KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true)
{
    QVBox *page = makeVBoxMainWidget();
    page->setMargin(5);
    page->setLineWidth(4);
    page->setMidLineWidth(4);
    page->setFrameStyle (QFrame::Box | QFrame::Raised );

    QVGroupBox *m_container = new QVGroupBox(i18n("Select your player"),page);

    m_selector = new KHSelectUser(m_container);
    m_selector->readPlayers(true);
    connect(m_selector, SIGNAL(playerSelected()), this, SLOT(setPlayerInformation()));

    QVBox *m_infoBox = new QVBox(m_container);

    m_labelName = new QLabel(i18n("Name: "), m_container);
    m_labelElo = new QLabel(i18n("Elo: "), m_container);
    m_labelType = new QLabel(i18n("Type: "), m_container);

    new KSeparator(m_container);

    new QLabel(i18n("Login"), m_container);
    m_login = new KLineEdit(m_container);
    new QLabel(i18n("Password"), m_container);
    m_password = new KLineEdit(m_container);

    setModal(true);

    setButtonGuiItem (KDialogBase::User1, KGuiItem( i18n("Create a new user"), SmallIcon("penguin"), i18n("Click to create new user"), i18n("Clicking this button you can create a new user") ));

    hide();
}
开发者ID:BackupTheBerlios,项目名称:khess-svn,代码行数:33,代码来源:khlogin.cpp

示例15: QWidget

void KexiUtils::addKexiDBDebug(const QString& text)
{
    // (this is internal code - do not use i18n() here)
    if (!debugWindowTab)
        return;
    if (!kexiDBDebugPage) {
        QWidget *page = new QWidget(debugWindowTab);
        QVBoxLayout *vbox = new QVBoxLayout(page);
        QHBoxLayout *hbox = new QHBoxLayout(page);
        vbox->addLayout(hbox);
        hbox->addStretch(1);
        KPushButton *btn_clear = new KPushButton(KGuiItem("Clear", "edit-clear-locationbar-rtl"), page);
        hbox->addWidget(btn_clear);

        kexiDBDebugPage = new K3ListView(page);
        kexiDBDebugPage->setObjectName("kexiDbDebugPage");
        kexiDBDebugPage->setFont(KexiUtils::smallFont(kexiDBDebugPage));
        QObject::connect(btn_clear, SIGNAL(clicked()), kexiDBDebugPage, SLOT(clear()));
        vbox->addWidget(kexiDBDebugPage);
        kexiDBDebugPage->addColumn("");
        kexiDBDebugPage->header()->hide();
        kexiDBDebugPage->setSorting(-1);
        kexiDBDebugPage->setAllColumnsShowFocus(true);
        kexiDBDebugPage->setColumnWidthMode(0, Q3ListView::Maximum);
        kexiDBDebugPage->setRootIsDecorated(true);
        debugWindowTab->addTab(page, "KexiDB");
        debugWindowTab->setCurrentWidget(page);
        kexiDBDebugPage->show();
    }
    //add \n after (about) every 30 characters
//TODO QString realText

    K3ListViewItem * li = new K3ListViewItem(kexiDBDebugPage, kexiDBDebugPage->lastItem(), text);
    li->setMultiLinesEnabled(true);
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:35,代码来源:debuggui.cpp


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