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


C++ QWidgetAction::setToolTip方法代码示例

本文整理汇总了C++中QWidgetAction::setToolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidgetAction::setToolTip方法的具体用法?C++ QWidgetAction::setToolTip怎么用?C++ QWidgetAction::setToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWidgetAction的用法示例。


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

示例1: createActions

void ReferencesTool::createActions()
{
    QWidgetAction *wAction = 0;

    QAction *action = new QAction(i18n("Insert"), this);
    addAction("insert_tableofcontents", action);
    action->setToolTip(i18n("Insert a Table of Contents into the document."));

    action = new QAction(i18n("Insert Custom..."), this);
    addAction("insert_configure_tableofcontents", action);
    action->setToolTip(i18n("Insert a custom Table of Contents into the document."));

    action = new QAction(koIcon("configure"), i18n("Configure..."), this);
    addAction("format_tableofcontents", action);
    action->setToolTip(i18n("Configure the Table of Contents"));
    connect(action, SIGNAL(triggered()), this, SLOT(formatTableOfContents()));

    action = new QAction(i18n("Insert footnote with auto number"),this);
    addAction("insert_autofootnote",action);
    connect(action, SIGNAL(triggered()), this, SLOT(insertAutoFootNote()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Insert Labeled Footnote"));
    QWidget *w = new LabeledWidget(wAction, i18n("Insert with label:"), LabeledWidget::INLINE, false);
    wAction->setDefaultWidget(w);
    addAction("insert_labeledfootnote", wAction);
    connect(w, SIGNAL(triggered(QString)), this, SLOT(insertLabeledFootNote(QString)));

    action = new QAction(i18n("Insert endnote with auto number"),this);
    addAction("insert_autoendnote",action);
    connect(action, SIGNAL(triggered()), this, SLOT(insertAutoEndNote()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Insert Labeled Endnote"));
    w = new LabeledWidget(wAction, i18n("Insert with label:"), LabeledWidget::INLINE, false);
    wAction->setDefaultWidget(w);
    addAction("insert_labeledendnote", wAction); connect(w, SIGNAL(triggered(QString)), this, SLOT(insertLabeledEndNote(QString)));

    action = new QAction(koIcon("configure"), i18n("Settings..."), this);
    addAction("format_footnotes",action);
    connect(action, SIGNAL(triggered()), this, SLOT(showFootnotesConfigureDialog()));

    action = new QAction(koIcon("configure"), i18n("Settings..."), this);
    addAction("format_endnotes",action);
    connect(action, SIGNAL(triggered()), this, SLOT(showEndnotesConfigureDialog()));

    action = new QAction(i18n("Insert Citation"), this);
    addAction("insert_citation",action);
    action->setToolTip(i18n("Insert a citation into the document."));
    connect(action, SIGNAL(triggered()), this, SLOT(insertCitation()));

    action = new QAction(i18n("Insert Bibliography"), this);
    addAction("insert_bibliography",action);
    action->setToolTip(i18n("Insert a bibliography into the document."));

    action = new QAction(i18n("Insert Custom Bibliography"), this);
    addAction("insert_custom_bibliography", action);
    action->setToolTip(i18n("Insert a custom Bibliography into the document."));

    action = new QAction(i18n("Configure"),this);
    addAction("configure_bibliography",action);
    action->setToolTip(i18n("Configure the bibliography"));
    connect(action, SIGNAL(triggered()), this, SLOT(configureBibliography()));

    action = new QAction(i18n("Insert Link"), this);
    addAction("insert_link", action);
    action->setToolTip(i18n("Insert a weblink or link to a bookmark."));
    connect(action, SIGNAL(triggered()), this, SLOT(insertLink()));

    wAction = new QWidgetAction(this);
    wAction->setText(i18n("Add Bookmark"));
    m_bmark = new LabeledWidget(wAction, i18n("Add Bookmark :"), LabeledWidget::ABOVE, true);
    connect(m_bmark, SIGNAL(lineEditChanged(QString)), this, SLOT(validateBookmark(QString)));
    wAction->setDefaultWidget(m_bmark);
    addAction("insert_bookmark", wAction);
    connect(m_bmark, SIGNAL(triggered(QString)), this, SLOT(insertBookmark(QString)));
    wAction->setToolTip(i18n("Insert a Bookmark. This is useful to create links that point to areas within the document"));

    action = new QAction(i18n("Bookmarks"), this);
    addAction("invoke_bookmark_handler", action);
    action->setToolTip(i18n("Display a pop up that hosts the options to add new Bookmark or handle existing Bookmarks"));

    action = new QAction(i18n("Manage Bookmarks"), this);
    addAction("manage_bookmarks", action);
    action->setToolTip(i18n("Manage your Bookmarks. Check where are they pointing to, Delete or Rename."));
}
开发者ID:woylaski,项目名称:kexi,代码行数:86,代码来源:ReferencesTool.cpp


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