本文整理汇总了C++中QAction::whatsThis方法的典型用法代码示例。如果您正苦于以下问题:C++ QAction::whatsThis方法的具体用法?C++ QAction::whatsThis怎么用?C++ QAction::whatsThis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAction
的用法示例。
在下文中一共展示了QAction::whatsThis方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: whatsThis
QString QActionProto::whatsThis() const
{
QAction *item = qscriptvalue_cast<QAction*>(thisObject());
if (item)
return item->whatsThis();
return QString();
}
示例2: f
KoGroupButton *addViewButton(KoGroupButton::GroupPosition pos,
Kexi::ViewMode mode, QWidget *parent, const char *slot,
const QString &text, QHBoxLayout *btnLyr)
{
if (!window->supportsViewMode(mode)) {
return 0;
}
QAction *a = new KexiToggleViewModeAction(mode, q);
toggleViewModeActions.insert(mode, a);
KoGroupButton *btn = new KoGroupButton(pos, parent);
toggleViewModeButtons.insert(mode, btn);
connect(btn, SIGNAL(toggled(bool)), q, slot);
btn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
btn->setText(text);
btn->setIcon(a->icon());
QFont f(KGlobalSettings::toolBarFont());
f.setPixelSize(KexiUtils::smallFont().pixelSize());
btn->setFont(f);
btn->setToolTip(a->toolTip());
btn->setWhatsThis(a->whatsThis());
btn->setCheckable(true);
btn->setAutoRaise(true);
btnLyr->addWidget(btn);
return btn;
}
示例3: retranslateUi
void TopLevel::retranslateUi()
{
setPlainCaption( i18n( "System Monitor" ) );
mRefreshTabAction->setText(i18n("&Refresh Tab"));
mNewWorksheetAction->setText(i18n( "&New Tab..." ));
mInsertWorksheetAction->setText(i18n( "Import Tab Fr&om File..." ));
mTabExportAction->setText( i18n( "Save Tab &As..." ) );
mTabRemoveAction->setText( i18n( "&Close Tab" ) );
mMonitorRemoteAction->setText( i18n( "Monitor &Remote Machine..." ) );
mHotNewWorksheetAction->setText( i18n( "&Download New Tabs..." ) );
mHotNewWorksheetUploadAction->setText( i18n( "&Upload Current Tab..." ) );
mConfigureSheetAction->setText( i18n( "Tab &Properties" ) );
if(mQuitAction) {
QAction *tmpQuitAction = KStandardAction::quit( NULL, NULL, NULL );
mQuitAction->setText(tmpQuitAction->text());
mQuitAction->setWhatsThis(tmpQuitAction->whatsThis());
mQuitAction->setToolTip(tmpQuitAction->toolTip());
delete tmpQuitAction;
} else
mQuitAction = KStandardAction::quit( this, SLOT(close()), actionCollection() );
}
示例4: event
bool RunWdgView::event( QEvent *event )
{
//> Force event's process
switch(event->type())
{
case QEvent::Paint:
if(permView()) break;
//> Paint message about access denied
if(dynamic_cast<RunPageView*>(this))
{
QPainter pnt(this);
//>> Fill page and draw border
pnt.fillRect(rect(),QBrush(QColor("black"),Qt::Dense4Pattern));
pnt.setPen(QPen(QBrush(QColor("black")),1));
pnt.drawRect(rect().adjusted(0,0,-1,-1));
//>> Draw message
QTextOption to;
pnt.setPen(QColor("red"));
to.setAlignment(Qt::AlignCenter);
to.setWrapMode(QTextOption::WordWrap);
if( rect().width() > 500 && rect().height() > 100 )
{
QFont cfnt = pnt.font();
cfnt.setPointSize( 16 );
pnt.setFont( cfnt );
}
pnt.drawText(rect(),QString(_("Page: '%1'.\nView access is not permitted.")).arg(id().c_str()),to);
}
return true;
case QEvent::MouseButtonRelease:
if(((QMouseEvent*)event)->button() == Qt::RightButton && !property("contextMenu").toString().isEmpty() &&
property("active").toBool() && permCntr() && isVisible(mapFromGlobal(cursor().pos())))
{
QAction *actTmp;
QMenu popup;
string sln;
for(int off = 0; (sln=TSYS::strSepParse(property("contextMenu").toString().toAscii().data(),0,'\n',&off)).size(); )
{
actTmp = new QAction(TSYS::strSepParse(sln,0,':').c_str(),this);
actTmp->setWhatsThis(TSYS::strSepParse(sln,1,':').c_str());
popup.addAction(actTmp);
}
if(!popup.isEmpty())
{
actTmp = popup.exec(QCursor::pos());
if(actTmp && !actTmp->whatsThis().isEmpty()) attrSet("event","usr_"+actTmp->whatsThis().toStdString());
popup.clear();
return true;
}
}
break;
default: break;
}
//> Call to shape for event process
if(WdgView::event(event) || (shape&&shape->event(this,event))) return true;
//> Key events process for send to model
string mod_ev;
map<string,string> attrs;
if(property("active").toBool() && permCntr())
switch(event->type())
{
case QEvent::Paint: return true;
case QEvent::KeyPress:
mod_ev = "key_pres";
case QEvent::KeyRelease:
if(((QKeyEvent*)event)->key() == Qt::Key_Tab) { mod_ev = ""; break; }
if(mod_ev.empty()) mod_ev = "key_rels";
if(QApplication::keyboardModifiers()&Qt::ControlModifier) mod_ev += "Ctrl";
if(QApplication::keyboardModifiers()&Qt::AltModifier) mod_ev += "Alt";
if(QApplication::keyboardModifiers()&Qt::ShiftModifier) mod_ev += "Shift";
if(((QKeyEvent*)event)->nativeScanCode())
attrs["event"] = mod_ev+"SC#"+TSYS::int2str(((QKeyEvent*)event)->nativeScanCode(),TSYS::Hex);
switch(((QKeyEvent*)event)->key())
{
case Qt::Key_Escape: mod_ev+="Esc"; break;
case Qt::Key_Backspace: mod_ev+="BackSpace"; break;
case Qt::Key_Return: mod_ev+="Return"; break;
case Qt::Key_Enter: mod_ev+="Enter"; break;
case Qt::Key_Insert: mod_ev+="Insert"; break;
case Qt::Key_Delete: mod_ev+="Delete"; break;
case Qt::Key_Pause: mod_ev+="Pause"; break;
case Qt::Key_Print: mod_ev+="Print"; break;
//case Qt::Key_SysReq: mod_ev+="SysReq"; break;
//case Qt::Key_Clear: mod_ev+="Clear"; break;
case Qt::Key_Home: mod_ev+="Home"; break;
case Qt::Key_End: mod_ev+="End"; break;
case Qt::Key_Left: mod_ev+="Left"; break;
case Qt::Key_Up: mod_ev+="Up"; break;
case Qt::Key_Right: mod_ev+="Right"; break;
case Qt::Key_Down: mod_ev+="Down"; break;
case Qt::Key_PageUp: mod_ev+="PageUp"; break;
case Qt::Key_PageDown: mod_ev+="PageDown"; break;
case Qt::Key_F1: mod_ev+="F1"; break;
case Qt::Key_F2: mod_ev+="F2"; break;
case Qt::Key_F3: mod_ev+="F3"; break;
case Qt::Key_F4: mod_ev+="F4"; break;
case Qt::Key_F5: mod_ev+="F5"; break;
case Qt::Key_F6: mod_ev+="F6"; break;
//.........这里部分代码省略.........