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

C++ setShortcut函数代码示例

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

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



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

示例1: OpsManager_

	OperationsTab::OperationsTab (const TabClassInfo& tc, QObject *plugin)
	: OpsManager_ (Core::Instance ().GetOpsManager ())
	, TC_ (tc)
	, ParentPlugin_ (plugin)
	, Toolbar_ (new QToolBar (tr ("Poleemery")))
	{
		Ui_.setupUi (this);
		Ui_.OpsView_->setItemDelegate (new EntriesDelegate);
		Ui_.OpsView_->setModel (OpsManager_->GetModel ());

		const auto& fm = fontMetrics ();
		auto setColWidth = [&fm, this] (EntriesModel::Columns col, const QString& str)
			{ Ui_.OpsView_->setColumnWidth (col, fm.width (str) * 1.1); };

		setColWidth (EntriesModel::Columns::Date,
				QDateTime::currentDateTime ().toString ());
		setColWidth (EntriesModel::Columns::Account, "some account name");
		setColWidth (EntriesModel::Columns::Name, "some typical very long product name");
		setColWidth (EntriesModel::Columns::Price, " 9999.00 USD ");
		setColWidth (EntriesModel::Columns::Count, " 0.999 ");
		setColWidth (EntriesModel::Columns::Shop, "some typical shop name");
		setColWidth (EntriesModel::Columns::AccBalance, " 99999.00 USD ");
		setColWidth (EntriesModel::Columns::SumBalance, " 99999.00 USD ");

		auto addAction = Toolbar_->addAction (tr ("Add..."),
				this, SLOT (add ()));
		addAction->setShortcut (Qt::Key_Insert);
		addAction->setProperty ("ActionIcon", "list-add");

		auto removeAction = Toolbar_->addAction (tr ("Remove"),
				this, SLOT (remove ()));
		removeAction->setShortcut (Qt::Key_Delete);
		removeAction->setProperty ("ActionIcon", "list-remove");
	}
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:34,代码来源:operationstab.cpp


示例2: pageAction

void SimplePartWidget::buildContextMenu(const QPoint &point, QMenu &menu) const
{
    menu.addAction(m_findAction);
    auto a = pageAction(QWebPage::Copy);
    a->setIcon(UiUtils::loadIcon(QStringLiteral("edit-copy")));
    menu.addAction(a);
    a = pageAction(QWebPage::SelectAll);
    a->setIcon(UiUtils::loadIcon(QStringLiteral("edit-select-all")));
    menu.addAction(a);
    if (!page()->mainFrame()->hitTestContent(point).linkUrl().isEmpty()) {
        menu.addSeparator();
        a = pageAction(QWebPage::CopyLinkToClipboard);
        a->setIcon(UiUtils::loadIcon(QStringLiteral("edit-copy")));
        menu.addAction(a);
    }
    menu.addSeparator();
    menu.addAction(m_savePart);
    menu.addAction(m_saveMessage);
    if (!page()->mainFrame()->hitTestContent(point).imageUrl().isEmpty()) {
        a = pageAction(QWebPage::DownloadImageToDisk);
        a->setIcon(UiUtils::loadIcon(QStringLiteral("download")));
        menu.addAction(a);
    }
    menu.addSeparator();
    QMenu *colorSchemeMenu = menu.addMenu(UiUtils::loadIcon(QStringLiteral("colorneg")), tr("Color scheme"));
    QActionGroup *ag = new QActionGroup(colorSchemeMenu);
    for (auto item: supportedColorSchemes()) {
        QAction *a = colorSchemeMenu->addAction(item.second);
        connect(a, &QAction::triggered, this, [this, item](){
           const_cast<SimplePartWidget*>(this)->setColorScheme(item.first);
        });
        a->setCheckable(true);
        if (item.first == m_colorScheme) {
            a->setChecked(true);
        }
        a->setActionGroup(ag);
    }

    auto zoomMenu = menu.addMenu(UiUtils::loadIcon(QStringLiteral("zoom")), tr("Zoom"));
    if (m_messageView) {
        zoomMenu->addAction(m_messageView->m_zoomIn);
        zoomMenu->addAction(m_messageView->m_zoomOut);
        zoomMenu->addAction(m_messageView->m_zoomOriginal);
    } else {
        auto zoomIn = zoomMenu->addAction(UiUtils::loadIcon(QStringLiteral("zoom-in")), tr("Zoom In"));
        zoomIn->setShortcut(QKeySequence::ZoomIn);
        connect(zoomIn, &QAction::triggered, this, &SimplePartWidget::zoomIn);

        auto zoomOut = zoomMenu->addAction(UiUtils::loadIcon(QStringLiteral("zoom-out")), tr("Zoom Out"));
        zoomOut->setShortcut(QKeySequence::ZoomOut);
        connect(zoomOut, &QAction::triggered, this, &SimplePartWidget::zoomOut);

        auto zoomOriginal = zoomMenu->addAction(UiUtils::loadIcon(QStringLiteral("zoom-original")), tr("Original Size"));
        connect(zoomOriginal, &QAction::triggered, this, &SimplePartWidget::zoomOriginal);
    }
}
开发者ID:KDE,项目名称:trojita,代码行数:56,代码来源:SimplePartWidget.cpp


示例3: setShortcut

//-----------------------------------------------------------------------------
void UndoRedoGuiCommand::init ()
{
    setShortcut (UNDO_, QKeySequence::Undo);
    setShortcut (REDO_, QKeySequence::Redo);
    setIcon (UNDO_, QIcon (":/images/ic_undo_black_24dp.png"));
    setIcon (REDO_, QIcon (":/images/ic_redo_black_24dp.png"));

    resetActionTriggerSlot (UNDO_, SLOT(undo()));
    resetActionTriggerSlot (REDO_, SLOT(redo()));
}
开发者ID:cbrnr,项目名称:sigviewer,代码行数:11,代码来源:undo_redo_gui_command.cpp


示例4: setShortcut

void ShortcutManager::loadSettings()
{
    _shortcutSettings->beginGroup(QStringLiteral("LocalShortcuts"));
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_NEW, DEF_SHORTCUT_NEW).toString(),
                Config::shortcutNew, Config::localShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_SAVE, DEF_SHORTCUT_SAVE).toString(),
                Config::shortcutSave, Config::localShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_COPY, DEF_SHORTCUT_COPY).toString(),
                Config::shortcutCopy, Config::localShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_OPT, DEF_SHORTCUT_OPT).toString(),
                Config::shortcutOptions, Config::localShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_HELP, DEF_SHORTCUT_HELP).toString(),
                Config::shortcutHelp, Config::localShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_CLOSE, DEF_SHORTCUT_CLOSE).toString(),
                Config::shortcutClose, Config::localShortcut);
    _shortcutSettings->endGroup();

    _shortcutSettings->beginGroup(QStringLiteral("GlobalShortcuts"));
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_FULL, DEF_SHORTCUT_FULL).toString(),
                Config::shortcutFullScreen, Config::globalShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_ACTW, DEF_SHORTCUT_ACTW).toString(),
                Config::shortcutActiveWnd, Config::globalShortcut);
    setShortcut(_shortcutSettings->value(KEY_SHORTCUT_AREA, DEF_SHORTCUT_AREA).toString(),
                Config::shortcutAreaSelect, Config::globalShortcut);
    _shortcutSettings->endGroup();
}
开发者ID:QtDesktop,项目名称:screengrab,代码行数:26,代码来源:shortcutmanager.cpp


示例5: UIActionSimpleNetworkAccessManager

 UIActionSimpleNetworkAccessManager(QObject *pParent)
     : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
 {
     switch (gActionPool->type())
     {
         case UIActionPoolType_Selector:
             setShortcut(gSS->keySequence(UISelectorShortcuts::NetworkAccessManager));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::NetworkAccessManager));
             break;
     }
     retranslateUi();
 }
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:14,代码来源:UIActionPool.cpp


示例6: UIActionSimpleContents

 UIActionSimpleContents(QObject *pParent)
     : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon))
 {
     switch (gActionPool->type())
     {
         case UIActionPoolType_Selector:
             setShortcut(gSS->keySequence(UISelectorShortcuts::HelpShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::HelpShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:14,代码来源:UIActionPool.cpp


示例7: ShowWebAction

 ShowWebAction(QObject *pParent)
     : UISimpleAction(pParent, ":/site_16px.png")
 {
     switch (gActionPool->type())
     {
         case UIActionPoolType_Offline:
             setShortcut(gSS->keySequence(UISelectorShortcuts::WebShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::WebShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:14,代码来源:UIActionPool.cpp


示例8: UIActionSimpleResetWarnings

 UIActionSimpleResetWarnings(QObject *pParent)
     : UIActionSimple(pParent, ":/reset_16px.png")
 {
     switch (gActionPool->type())
     {
         case UIActionPoolType_Selector:
             setShortcut(gSS->keySequence(UISelectorShortcuts::ResetWarningsShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::ResetWarningsShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:14,代码来源:UIActionPool.cpp


示例9: UIActionSimpleCheckForUpdates

 UIActionSimpleCheckForUpdates(QObject *pParent)
     : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
 {
     setMenuRole(QAction::ApplicationSpecificRole);
     switch (gActionPool->type())
     {
         case UIActionPoolType_Selector:
             setShortcut(gSS->keySequence(UISelectorShortcuts::UpdateShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::UpdateShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:15,代码来源:UIActionPool.cpp


示例10: UIActionSimpleAbout

 UIActionSimpleAbout(QObject *pParent)
     : UIActionSimple(pParent, ":/about_16px.png")
 {
     setMenuRole(QAction::AboutRole);
     switch (gActionPool->type())
     {
         case UIActionPoolType_Selector:
             setShortcut(gSS->keySequence(UISelectorShortcuts::AboutShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::AboutShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:15,代码来源:UIActionPool.cpp


示例11: QAbstractButton

QVistaBackButton::QVistaBackButton(QWidget *widget)
    : QAbstractButton(widget)
{
    setFocusPolicy(Qt::NoFocus);
    // Native dialogs use ALT-Left even in RTL mode, so do the same, even if it might be counter-intuitive.
    setShortcut(QKeySequence(Qt::ALT | Qt::Key_Left));
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:7,代码来源:qwizard_win.cpp


示例12: qWarning

	void Plugin::handleUnclose ()
	{
		auto action = qobject_cast<QAction*> (sender ());
		if (!action)
		{
			qWarning () << Q_FUNC_INFO
					<< "sender is not an action:"
					<< sender ();
			return;
		}

		if (!UncloseAct2Data_.contains (action))
			return;

		action->deleteLater ();

		auto data = UncloseAct2Data_.take (action);
		if (UncloseMenu_->defaultAction () == action)
		{
			auto nextAct = UncloseMenu_->actions ().value (1);
			if (nextAct)
			{
				UncloseMenu_->setDefaultAction (nextAct);
				nextAct->setShortcut (QString ("Ctrl+Shift+T"));
			}
		}
		UncloseMenu_->removeAction (action);

		data.Plugin_->RecoverTabs (QList<TabRecoverInfo> () << data.RecInfo_);
	}
开发者ID:tehnick,项目名称:leechcraft,代码行数:30,代码来源:tabsessmanager.cpp


示例13: QAction

ContextMenuAction::ContextMenuAction(const QString &label, const QString &id, const QKeySequence &shortcut,
                                     QObject *parent)
    : QAction(label, parent),
      m_id(id)
{
    setShortcut(shortcut);
}
开发者ID:KeeganRen,项目名称:qt-creator,代码行数:7,代码来源:contextmenuaction.cpp


示例14: VcsDiffWidget

void VcsEventWidgetPrivate::diffRevisions()
{
    QModelIndexList l = m_ui->eventView->selectionModel()->selectedRows();
    KDevelop::VcsEvent ev1 = m_logModel->eventForIndex( l.first() );
    KDevelop::VcsEvent ev2 = m_logModel->eventForIndex( l.last() );
    KDevelop::VcsJob* job = m_iface->diff( m_url, ev1.revision(), ev2.revision() );

    VcsDiffWidget* widget = new VcsDiffWidget( job );
    widget->setRevisions( ev1.revision(), ev2.revision() );

    auto dlg = new QDialog( q );
    dlg->setWindowTitle( i18n("Difference between Revisions") );

    widget->connect(widget, &VcsDiffWidget::destroyed, dlg, &QDialog::deleteLater);

    auto mainLayout = new QVBoxLayout(dlg);
    auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
    auto okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    dlg->connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept);
    dlg->connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
    mainLayout->addWidget(buttonBox);
    mainLayout->addWidget(widget);
    dlg->show();
}
开发者ID:mali,项目名称:kdevplatform,代码行数:26,代码来源:vcseventwidget.cpp


示例15: QAction

 QAction* MainWindow::createAction(QMenu* menu, const QKeySequence &shortcut)
 {
     auto action = new QAction(this);
     menu->addAction(action);
     action->setShortcut(shortcut);
     return action;
 }
开发者ID:Bananattack,项目名称:overbrew,代码行数:7,代码来源:mainwindow.cpp


示例16: KisColorTransformationFilter

KisHSVAdjustmentFilter::KisHSVAdjustmentFilter()
        : KisColorTransformationFilter(id(), categoryAdjust(), i18n("&HSV Adjustment..."))
{
    setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)));
    setSupportsPainting(true);
    setSupportsIncrementalPainting(false);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:7,代码来源:kis_hsv_adjustment_filter.cpp


示例17: QDialog

ApplyChangesWidget::ApplyChangesWidget(QWidget* parent)
    : QDialog(parent), d(new ApplyChangesWidgetPrivate(this))
{
    setSizeGripEnabled(true);

    auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
    auto mainLayout = new QVBoxLayout(this);
    auto okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, &QDialogButtonBox::accepted, this, &ApplyChangesWidget::accept);
    connect(buttonBox, &QDialogButtonBox::rejected, this, &ApplyChangesWidget::reject);

    QWidget* w=new QWidget(this);
    d->m_info=new QLabel(w);
    d->m_documentTabs = new QTabWidget(w);
    connect(d->m_documentTabs, &QTabWidget::currentChanged,
            this, &ApplyChangesWidget::indexChanged);

    QVBoxLayout* l = new QVBoxLayout(w);
    l->addWidget(d->m_info);
    l->addWidget(d->m_documentTabs);

    mainLayout->addWidget(w);
    mainLayout->addWidget(buttonBox);

    resize(QSize(800, 400));
}
开发者ID:KDE,项目名称:kdevplatform,代码行数:28,代码来源:applychangeswidget.cpp


示例18: QWidget

ShortcutEditor::ShortcutEditor(QMLPlugin * plugin, 
                               QWidget * parent) : QWidget(parent),
    layout_(this), 
    labelShortcut_(this),
    plugin_(plugin),
    activable_(true)
{
    layout_.addWidget(&labelShortcut_);
    layout_.addWidget(&iconView_);

    editTimer_.setSingleShot(true);
    editTimer_.setInterval(SHORTCUT_EDITOR_EDIT_INTERVAL);

    if(plugin_->clipboard()) setShortcut(plugin_->clipboard()->shortcut());

    QObject::connect(&KeyLogger::instance(), 
                     &KeyLogger::sequence, 
                     this, &ShortcutEditor::onKeyDown);

    QObject::connect(&editTimer_, &QTimer::timeout,
                     this, &ShortcutEditor::onEditTimeout);

    QObject::connect(plugin, &QMLPlugin::activableChanged,
                     this, &ShortcutEditor::onActivableChanged);
    onActivableChanged(plugin->activable());

#ifdef GLASS_EFFECT
    setStyleSheet(fromResource(":/Transparent/Widget"));
#endif
}
开发者ID:Globidev,项目名称:ClipboardOne,代码行数:30,代码来源:ShortcutEditor.cpp


示例19: PerformRegisterAction

 PerformRegisterAction(QObject *pParent)
     : UISimpleAction(pParent, ":/register_16px.png", ":/register_disabled_16px.png")
 {
     setEnabled(vboxGlobal().virtualBox().
                GetExtraData(VBoxDefs::GUI_RegistrationDlgWinID).isEmpty());
     switch (gActionPool->type())
     {
         case UIActionPoolType_Offline:
             setShortcut(gSS->keySequence(UISelectorShortcuts::RegisterShortcut));
             break;
         case UIActionPoolType_Runtime:
             setShortcut(gMS->keySequence(UIMachineShortcuts::RegisterShortcut));
             break;
     }
     retranslateUi();
 }
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:16,代码来源:UIActionPool.cpp


示例20: KisColorTransformationFilter

KisLevelFilter::KisLevelFilter()
        : KisColorTransformationFilter(id(), categoryAdjust(), i18n("&Levels..."))
{
    setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
    setSupportsPainting(false);
    setColorSpaceIndependence(TO_LAB16);
}
开发者ID:ChrisJong,项目名称:krita,代码行数:7,代码来源:kis_level_filter.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setSize函数代码示例发布时间:2022-05-30
下一篇:
C++ setShaderProgram函数代码示例发布时间: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