本文整理汇总了C++中QMenu::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ QMenu::setVisible方法的具体用法?C++ QMenu::setVisible怎么用?C++ QMenu::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMenu
的用法示例。
在下文中一共展示了QMenu::setVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareActionGroups
void UIMachineLogicFullscreen::prepareActionGroups()
{
/* Call to base-class: */
UIMachineLogic::prepareActionGroups();
/* Adjust-window action isn't allowed in fullscreen: */
gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false);
/* Add the view menu: */
QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
m_pScreenLayout->initialize(pMenu);
pMenu->setVisible(true);
}
示例2: contextMenuEvent
void webview::contextMenuEvent(QContextMenuEvent * event)
{
QMenu * menu = new QMenu();
menu->setVisible(true);
QWebHitTestResult element = this->page()->mainFrame()->hitTestContent(event->pos());
if(!element.linkUrl().isEmpty())
{
QAction * newtab = this->pageAction(QWebPage::OpenLinkInNewWindow);
newtab->setText(tr("open link in new tab"));
menu->addAction(newtab);
menu->addAction(this->pageAction(QWebPage::DownloadLinkToDisk));
menu->addAction(this->pageAction(QWebPage::CopyLinkToClipboard));
}
if(!element.imageUrl().isEmpty())
{
menu->addAction(this->pageAction(QWebPage::DownloadImageToDisk));
menu->addAction(this->pageAction(QWebPage::CopyImageToClipboard));
menu->addAction(this->pageAction(QWebPage::CopyImageUrlToClipboard));
QAction * newimage = this->pageAction(QWebPage::OpenImageInNewWindow);
newimage->setText(tr("open image in new tab"));
menu->addAction(newimage);
}
if(!page()->selectedText().isEmpty())
{
menu->addAction(this->pageAction(QWebPage::Copy));
menu->addAction(this->pageAction(QWebPage::Cut));
menu->addAction(this->pageAction(QWebPage::Paste));
menu->addAction(this->pageAction(QWebPage::Undo));
menu->addAction(this->pageAction(QWebPage::Redo));
menu->addAction(this->pageAction(QWebPage::SelectAll));
}
if(element.element().tagName().toLower() == "input" && element.element().attribute(QLatin1String("type")).toLower() == "text")
{
menu->addAction(this->pageAction(QWebPage::SelectAll));
menu->addAction(this->pageAction(QWebPage::Paste));
menu->addAction(this->pageAction(QWebPage::SetTextDirectionLeftToRight));
menu->addAction(this->pageAction(QWebPage::SetTextDirectionRightToLeft));
menu->addAction(this->pageAction(QWebPage::SetTextDirectionDefault));
menu->addAction(this->pageAction(QWebPage::MoveToNextWord));
}
if(!element.isNull())
{
menu->addAction(this->pageAction(QWebPage::Back));
menu->addAction(this->pageAction(QWebPage::Forward));
menu->addAction(this->pageAction(QWebPage::Reload));
menu->addAction(this->pageAction(QWebPage::Stop));
menu->addAction(this->pageAction(QWebPage::InspectElement));
}
menu->exec(event->globalPos());
}
示例3: prepareActionGroups
void UIMachineLogicSeamless::prepareActionGroups()
{
/* Call to base-class: */
UIMachineLogic::prepareActionGroups();
/* Guest auto-resize isn't allowed in seamless: */
gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->setVisible(false);
/* Adjust-window isn't allowed in seamless: */
gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false);
/* Disable mouse-integration isn't allowed in seamless: */
gActionPool->action(UIActionIndexRuntime_Toggle_MouseIntegration)->setVisible(false);
/* Add the view menu: */
QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
m_pScreenLayout->setViewMenu(pMenu);
pMenu->setVisible(true);
}