本文整理汇总了C++中KShortcut::append方法的典型用法代码示例。如果您正苦于以下问题:C++ KShortcut::append方法的具体用法?C++ KShortcut::append怎么用?C++ KShortcut::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KShortcut
的用法示例。
在下文中一共展示了KShortcut::append方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shortcutForKey
// public static
KShortcut kpTool::shortcutForKey (int key)
{
KShortcut shortcut;
if (key)
{
shortcut.append (KKeySequence (KKey (key)));
// (CTRL+<key>, ALT+<key>, CTRL+ALT+<key>, CTRL+SHIFT+<key>
// all clash with global KDE shortcuts)
shortcut.append (KKeySequence (KKey (Qt::ALT + Qt::SHIFT + key)));
}
return shortcut;
}
示例2: containsSingleKeyTrigger
// public static
bool kpTool::containsSingleKeyTrigger (const KShortcut &shortcut,
KShortcut *shortcutWithoutSingleKeyTriggers)
{
if (shortcutWithoutSingleKeyTriggers)
*shortcutWithoutSingleKeyTriggers = shortcut;
KShortcut newShortcut;
bool needNewShortcut = false;
for (int i = 0; i < (int) shortcut.count (); i++)
{
const KKeySequence seq = shortcut.seq (i);
if (containsSingleKeyTrigger (seq))
{
needNewShortcut = true;
}
else
{
newShortcut.append (seq);
}
}
if (needNewShortcut && shortcutWithoutSingleKeyTriggers)
*shortcutWithoutSingleKeyTriggers = newShortcut;
return needNewShortcut;
}
示例3: initXMLUI
/**
* create the action events create the gui.
*/
void KJezzball::initXMLUI()
{
m_newAction = KStdGameAction::gameNew( this, SLOT(newGame()), actionCollection() );
// AB: originally KBounce/KJezzball used Space for new game - but Ctrl+N is
// default. We solve this by providing space as an alternative key
KShortcut s = m_newAction->shortcut();
s.append(KKeySequence(QKeySequence(Key_Space)));
m_newAction->setShortcut(s);
KStdGameAction::quit(this, SLOT(close()), actionCollection() );
KStdGameAction::highscores(this, SLOT(showHighscore()), actionCollection() );
m_pauseButton = KStdGameAction::pause(this, SLOT(pauseGame()), actionCollection());
KStdGameAction::end(this, SLOT(closeGame()), actionCollection());
KStdGameAction::configureHighscores(this, SLOT(configureHighscores()),actionCollection());
new KAction( i18n("&Select Background Folder..."), 0, this, SLOT(selectBackground()),
actionCollection(), "background_select" );
m_backgroundShowAction =
new KToggleAction( i18n("Show &Backgrounds"), 0, this, SLOT(showBackground()),
actionCollection(), "background_show" );
m_backgroundShowAction->setCheckedState(i18n("Hide &Backgrounds"));
m_backgroundShowAction->setEnabled( !m_backgroundDir.isEmpty() );
m_backgroundShowAction->setChecked( m_showBackground );
m_soundAction = new KToggleAction( i18n("&Play Sounds"), 0, 0, 0, actionCollection(), "toggle_sound");
}
示例4: shortcutDefault3
KShortcut shortcutDefault3(StdAccel id)
{
KShortcut cut;
KStdAccelInfo *pInfo = infoPtr(id);
if(pInfo)
{
if(pInfo->cutDefault)
cut.init(pInfo->cutDefault);
// FIXME: if there is no cutDefault, then this we be made the primary
// instead of alternate shortcut.
if(pInfo->cutDefault3B)
cut.append(KKey(pInfo->cutDefault3B));
}
return cut;
}
示例5: shortcutDefault4
KShortcut shortcutDefault4(StdAccel id)
{
KShortcut cut;
KStdAccelInfo *pInfo = infoPtr(id);
if(pInfo)
{
KStdAccelInfo &info = *pInfo;
KKeySequence key2;
cut.init((info.cutDefault4) ? QKeySequence(info.cutDefault) : QKeySequence(info.cutDefault4));
if(info.cutDefault4B)
key2.init(QKeySequence(info.cutDefault4B));
else if(info.cutDefault3B)
key2.init(QKeySequence(info.cutDefault3B));
if(key2.count())
cut.append(key2);
}
return cut;
}
示例6: emptyMask
//-------------------------------------------------------------------------
KJSDebugWin::KJSDebugWin(QWidget *parent, const char *name) : KMainWindow(parent, name, WType_TopLevel), KInstance("kjs_debugger")
{
m_breakpoints = 0;
m_breakpointCount = 0;
m_curSourceFile = 0;
m_mode = Continue;
m_nextSourceUrl = "";
m_nextSourceBaseLine = 1;
m_execs = 0;
m_execsCount = 0;
m_execsAlloc = 0;
m_steppingDepth = 0;
m_stopIcon = KGlobal::iconLoader()->loadIcon("stop", KIcon::Small);
m_emptyIcon = QPixmap(m_stopIcon.width(), m_stopIcon.height());
QBitmap emptyMask(m_stopIcon.width(), m_stopIcon.height(), true);
m_emptyIcon.setMask(emptyMask);
setCaption(i18n("JavaScript Debugger"));
QWidget *mainWidget = new QWidget(this);
setCentralWidget(mainWidget);
QVBoxLayout *vl = new QVBoxLayout(mainWidget, 5);
// frame list & code
QSplitter *hsplitter = new QSplitter(Qt::Vertical, mainWidget);
QSplitter *vsplitter = new QSplitter(hsplitter);
QFont font(KGlobalSettings::fixedFont());
QWidget *contextContainer = new QWidget(vsplitter);
QLabel *contextLabel = new QLabel(i18n("Call stack"), contextContainer);
QWidget *contextListContainer = new QWidget(contextContainer);
m_contextList = new QListBox(contextListContainer);
m_contextList->setMinimumSize(100, 200);
connect(m_contextList, SIGNAL(highlighted(int)), this, SLOT(slotShowFrame(int)));
QHBoxLayout *clistLayout = new QHBoxLayout(contextListContainer);
clistLayout->addWidget(m_contextList);
clistLayout->addSpacing(KDialog::spacingHint());
QVBoxLayout *contextLayout = new QVBoxLayout(contextContainer);
contextLayout->addWidget(contextLabel);
contextLayout->addSpacing(KDialog::spacingHint());
contextLayout->addWidget(contextListContainer);
// source selection & display
QWidget *sourceSelDisplay = new QWidget(vsplitter);
QVBoxLayout *ssdvl = new QVBoxLayout(sourceSelDisplay);
m_sourceSel = new QComboBox(toolBar());
connect(m_sourceSel, SIGNAL(activated(int)), this, SLOT(slotSourceSelected(int)));
m_sourceDisplay = new SourceDisplay(this, sourceSelDisplay);
ssdvl->addWidget(m_sourceDisplay);
connect(m_sourceDisplay, SIGNAL(lineDoubleClicked(int)), SLOT(slotToggleBreakpoint(int)));
QValueList< int > vsplitSizes;
vsplitSizes.insert(vsplitSizes.end(), 120);
vsplitSizes.insert(vsplitSizes.end(), 480);
vsplitter->setSizes(vsplitSizes);
// evaluate
QWidget *evalContainer = new QWidget(hsplitter);
QLabel *evalLabel = new QLabel(i18n("JavaScript console"), evalContainer);
m_evalEdit = new EvalMultiLineEdit(evalContainer);
m_evalEdit->setWordWrap(QMultiLineEdit::NoWrap);
m_evalEdit->setFont(font);
connect(m_evalEdit, SIGNAL(returnPressed()), SLOT(slotEval()));
m_evalDepth = 0;
QVBoxLayout *evalLayout = new QVBoxLayout(evalContainer);
evalLayout->addSpacing(KDialog::spacingHint());
evalLayout->addWidget(evalLabel);
evalLayout->addSpacing(KDialog::spacingHint());
evalLayout->addWidget(m_evalEdit);
QValueList< int > hsplitSizes;
hsplitSizes.insert(hsplitSizes.end(), 400);
hsplitSizes.insert(hsplitSizes.end(), 200);
hsplitter->setSizes(hsplitSizes);
vl->addWidget(hsplitter);
// actions
KPopupMenu *debugMenu = new KPopupMenu(this);
menuBar()->insertItem("&Debug", debugMenu);
m_actionCollection = new KActionCollection(this);
m_actionCollection->setInstance(this);
// Venkman use F12, KDevelop F10
KShortcut scNext = KShortcut(KKeySequence(KKey(Qt::Key_F12)));
scNext.append(KKeySequence(KKey(Qt::Key_F10)));
m_nextAction = new KAction(i18n("Next breakpoint", "&Next"), "dbgnext", scNext, this, SLOT(slotNext()), m_actionCollection, "next");
//.........这里部分代码省略.........