本文整理汇总了C++中KGuiItem::text方法的典型用法代码示例。如果您正苦于以下问题:C++ KGuiItem::text方法的具体用法?C++ KGuiItem::text怎么用?C++ KGuiItem::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KGuiItem
的用法示例。
在下文中一共展示了KGuiItem::text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void KexiDBConnectionDialog::init(const KGuiItem& acceptButtonGuiItem)
{
setObjectName("KexiDBConnectionDialog");
setButtons(KDialog::User1 | KDialog::Cancel | KDialog::Help);
setButtonGuiItem(KDialog::User1,
acceptButtonGuiItem.text().isEmpty()
? KGuiItem(i18n("&Open"), "document-open", i18n("Open Database Connection"))
: acceptButtonGuiItem
);
setModal(true);
setMainWidget(m_tabWidget);
connect(this, SIGNAL(user1Clicked()), this, SLOT(accept()));
connect(m_tabWidget->mainWidget, SIGNAL(saveChanges()), this, SIGNAL(saveChanges()));
connect(m_tabWidget, SIGNAL(testConnection()), this, SIGNAL(testConnection()));
adjustSize();
resize(width(), m_tabWidget->height());
if (m_tabWidget->mainWidget->connectionOnly())
m_tabWidget->mainWidget->driversCombo()->setFocus();
else if (m_tabWidget->mainWidget->nameCombo->currentText().isEmpty())
m_tabWidget->mainWidget->nameCombo->setFocus();
else if (m_tabWidget->mainWidget->userEdit->text().isEmpty())
m_tabWidget->mainWidget->userEdit->setFocus();
else if (m_tabWidget->mainWidget->passwordEdit->text().isEmpty())
m_tabWidget->mainWidget->passwordEdit->setFocus();
else //back
m_tabWidget->mainWidget->nameCombo->setFocus();
}
示例2: QObject
KAction::KAction( const KGuiItem& item, const KShortcut& cut,
const QObject* receiver, const char* slot,
KActionCollection* parent, const char* name )
: QObject( parent, name ), d(new KActionPrivate)
{
initPrivate( item.text(), cut, receiver, slot );
if( item.hasIcon() )
setIcon( item.iconName() );
setToolTip( item.toolTip() );
setWhatsThis( item.whatsThis() );
}
示例3: KDialogBase
KexiDBConnectionDialog::KexiDBConnectionDialog(const KexiDB::ConnectionData& data,
const QString& shortcutFileName, const KGuiItem& acceptButtonGuiItem)
: KDialogBase(0, "dlg", true, i18n("Connect to a Database Server"),
KDialogBase::User1|KDialogBase::Cancel|KDialogBase::Help,
KDialogBase::User1, false,
acceptButtonGuiItem.text().isEmpty()
? KGuiItem(i18n("&Open"), "fileopen", i18n("Open Database Connection"))
: acceptButtonGuiItem
)
{
tabWidget = new KexiDBConnectionTabWidget(this, "tabWidget");
tabWidget->setData(data, shortcutFileName);
init();
}
示例4: KexiView
KexiReportDesignView::KexiReportDesignView(QWidget *parent, KexiSourceSelector *s)
: KexiView(parent)
{
m_scrollArea = new QScrollArea(this);
layout()->addWidget(m_scrollArea);
m_sourceSelector = s;
m_reportDesigner = 0;
m_editCutAction = KStandardAction::cut(this);
m_editCutAction->setProperty("iconOnly", true);
m_editCopyAction = KStandardAction::copy(this);
m_editCopyAction->setProperty("iconOnly", true);
m_editPasteAction = KStandardAction::paste(this);
m_editPasteAction->setProperty("iconOnly", true);
const KGuiItem del = KStandardGuiItem::del();
m_editDeleteAction = new QAction(del.icon(), del.text(), this);
m_editDeleteAction->setObjectName("editdelete");
m_editDeleteAction->setToolTip(del.toolTip());
m_editDeleteAction->setWhatsThis(del.whatsThis());
m_editDeleteAction->setProperty("iconOnly", true);
m_sectionEdit = new QAction(i18n("Edit Sections"), this);
m_sectionEdit->setObjectName("sectionedit");
m_itemRaiseAction = new QAction(koIcon("arrow-up"), i18n("Raise"), this);
m_itemRaiseAction->setObjectName("itemraise");
m_itemLowerAction = new QAction(koIcon("arrow-down"), i18n("Lower"), this);
m_itemLowerAction->setObjectName("itemlower");
//parameterEdit = new QAction ( i18n ( "Parameter Editor" ), this );
//parameterEdit->setObjectName("parameteredit");
QList<QAction*> al;
QAction *sep = new QAction(QString(), this);
sep->setSeparator(true);
al << m_editCutAction << m_editCopyAction << m_editPasteAction << m_editDeleteAction << sep << m_sectionEdit << sep << m_itemLowerAction << m_itemRaiseAction;
setViewActions(al);
}
示例5: QPushButton
KexiLinkButton::KexiLinkButton(const KGuiItem &item, QWidget *parent)
: QPushButton(item.icon(), item.text(), parent), d(new Private)
{
init();
}
示例6: QShortcut
Interface::Interface(Plasma::RunnerManager *runnerManager, QWidget *parent)
: KRunnerDialog(runnerManager, parent),
m_delayedRun(false),
m_running(false),
m_queryRunning(false)
{
m_resultData.processHoverEvents = true;
m_resultData.mouseHovering = false;
m_resultData.runnerManager = runnerManager;
m_hideResultsTimer.setSingleShot(true);
connect(&m_hideResultsTimer, SIGNAL(timeout()), this, SLOT(hideResultsArea()));
m_reenableHoverEventsTimer.setSingleShot(true);
m_reenableHoverEventsTimer.setInterval(50);
connect(&m_reenableHoverEventsTimer, SIGNAL(timeout()), this, SLOT(reenableHoverEvents()));
m_layout = new QVBoxLayout(this);
m_layout->setMargin(0);
m_buttonContainer = new QWidget(this);
QHBoxLayout *bottomLayout = new QHBoxLayout(m_buttonContainer);
bottomLayout->setMargin(0);
m_configButton = new ToolButton(m_buttonContainer);
m_configButton->setText(i18n("Settings"));
m_configButton->setToolTip(i18n("Settings"));
connect(m_configButton, SIGNAL(clicked()), SLOT(toggleConfigDialog()));
bottomLayout->addWidget(m_configButton);
//Set up the system activity button, using the krunner global action, showing the global shortcut in the tooltip
m_activityButton = new ToolButton(m_buttonContainer);
KRunnerApp *krunnerApp = KRunnerApp::self();
QAction *showSystemActivityAction = krunnerApp->actionCollection()->action(QLatin1String( "Show System Activity" ));
m_activityButton->setDefaultAction(showSystemActivityAction);
updateSystemActivityToolTip();
connect(showSystemActivityAction, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(updateSystemActivityToolTip()));
connect(showSystemActivityAction, SIGNAL(triggered(bool)), this, SLOT(resetAndClose()));
bottomLayout->addWidget(m_activityButton);
m_singleRunnerIcon = new QLabel();
bottomLayout->addWidget(m_singleRunnerIcon);
m_singleRunnerDisplayName = new QLabel();
bottomLayout->addWidget(m_singleRunnerDisplayName);
m_helpButton = new ToolButton(m_buttonContainer);
m_helpButton->setText(i18n("Help"));
m_helpButton->setToolTip(i18n("Information on using this application"));
connect(m_helpButton, SIGNAL(clicked(bool)), SLOT(showHelp()));
connect(m_helpButton, SIGNAL(clicked(bool)), SLOT(configCompleted()));
bottomLayout->addWidget(m_helpButton);
QSpacerItem* closeButtonSpacer = new QSpacerItem(0,0,QSizePolicy::MinimumExpanding,QSizePolicy::Fixed);
bottomLayout->addSpacerItem(closeButtonSpacer);
m_closeButton = new ToolButton(m_buttonContainer);
KGuiItem guiItem = KStandardGuiItem::close();
m_closeButton->setText(guiItem.text());
m_closeButton->setToolTip(guiItem.text().remove(QLatin1Char( '&' )));
connect(m_closeButton, SIGNAL(clicked(bool)), SLOT(resetAndClose()));
bottomLayout->addWidget(m_closeButton);
m_layout->addWidget(m_buttonContainer);
m_searchTerm = new KrunnerHistoryComboBox(false, this);
KLineEdit *lineEdit = new KLineEdit(m_searchTerm);
QAction *focusEdit = new QAction(this);
focusEdit->setShortcut(Qt::Key_F6);
connect(focusEdit, SIGNAL(triggered(bool)), this, SLOT(searchTermSetFocus()));
addAction(focusEdit);
// the order of these next few lines if very important.
// QComboBox::setLineEdit sets the autoComplete flag on the lineedit,
// and KComboBox::setAutoComplete resets the autocomplete mode! ugh!
m_searchTerm->setLineEdit(lineEdit);
m_completion = new KCompletion();
lineEdit->setCompletionObject(m_completion);
lineEdit->setCompletionMode(static_cast<KGlobalSettings::Completion>(KRunnerSettings::queryTextCompletionMode()));
lineEdit->setClearButtonShown(true);
QStringList pastQueryItems = KRunnerSettings::pastQueries();
m_searchTerm->setHistoryItems(pastQueryItems);
m_completion->insertItems(pastQueryItems);
bottomLayout->insertWidget(4, m_searchTerm, 10);
m_singleRunnerSearchTerm = new KLineEdit(this);
bottomLayout->insertWidget(4, m_singleRunnerSearchTerm, 10 );
//kDebug() << "size:" << m_resultsView->size() << m_resultsView->minimumSize();
m_resultsScene = new ResultScene(&m_resultData, runnerManager, m_searchTerm, this);
m_resultsView = new ResultsView(m_resultsScene, &m_resultData, this);
m_layout->addWidget(m_resultsView);
connect(m_resultsScene, SIGNAL(viewableHeightChanged()), this, SLOT(fitWindow()));
connect(m_resultsScene, SIGNAL(matchCountChanged(int)), this, SLOT(matchCountChanged(int)));
connect(m_resultsScene, SIGNAL(itemActivated(ResultItem*)), this, SLOT(run(ResultItem*)));
//.........这里部分代码省略.........