本文整理汇总了C++中QMenu::icon方法的典型用法代码示例。如果您正苦于以下问题:C++ QMenu::icon方法的具体用法?C++ QMenu::icon怎么用?C++ QMenu::icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMenu
的用法示例。
在下文中一共展示了QMenu::icon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: icon
QIcon QMenuProto::icon() const
{
QMenu *item = qscriptvalue_cast<QMenu*>(thisObject());
if (item)
return item->icon();
return QIcon();
}
示例2: init
void XdgMenuWidgetPrivate::init(const QDomElement& xml)
{
Q_Q(XdgMenuWidget);
mXml = xml;
q->clear();
mNeedBuild = true;
if (! xml.attribute("title").isEmpty())
q->setTitle(xml.attribute("title"));
else
q->setTitle(xml.attribute("name"));
q->setToolTip(xml.attribute("comment"));
QIcon parentIcon;
QMenu* parentMenu = qobject_cast<QMenu*>(q->parent());
if (parentMenu)
parentIcon = parentMenu->icon();
q->setIcon(XdgIcon::fromTheme(mXml.attribute("icon"), parentIcon));
if (!qobject_cast<XdgMenuWidget*>(q->parent()))
buildMenu();
}
示例3: createActions
//.........这里部分代码省略.........
advancedFuntionsMenu->setIcon(QIcon(UI_ICON_ADVANCED));
m_SetBSSIDMenu = new QMenu(tr("Switch to alternate BSSID"));
m_SetBSSIDMenu->setIcon(QIcon(UI_ICON_AP));
updateBSSIDMenu();
m_AutoSaveNetworksAction->setCheckable(true);
m_ToggleScanResultsAction->setCheckable(true);
m_ToggleScanResultsAction->setChecked(false);
ui.availableAPGroupBox->setVisible(false);
m_KeepScanResultsAction->setCheckable(true);
m_EnableNetworkAction->setEnabled(false);
m_DisableNetworkAction->setEnabled(false);
m_SwitchNetworkAction->setEnabled(false);
m_ConfigureNetworkAction->setEnabled(false);
m_RemoveNetworkAction->setEnabled(false);
connect(m_RescanNetworksAction, &QAction::triggered, this, &CWirelessSettings::handleRescanRequest);
connect(m_ToggleScanResultsAction, &QAction::toggled, ui.availableAPGroupBox, &QGroupBox::setVisible);
connect(m_SwitchNetworkAction, &QAction::triggered, this, &CWirelessSettings::switchToSelectedNetwork);
connect(m_ConfigureNetworkAction, &QAction::triggered, this, &CWirelessSettings::configureSelectedNetwork);
connect(m_EnableNetworkAction, &QAction::triggered, this, &CWirelessSettings::enableSelectedNetwork);
connect(m_DisableNetworkAction, &QAction::triggered, this, &CWirelessSettings::disableSelectedNetwork);
connect(enableNetworksAction, &QAction::triggered, this, &CWirelessSettings::enableNetworks);
connect(importNetworksAction, &QAction::triggered, this, &CWirelessSettings::importNetworks);
connect(exportNetworkAction, &QAction::triggered, this, &CWirelessSettings::exportSelectedNetwork);
connect(exportMultipleNetworksAction, &QAction::triggered, this, &CWirelessSettings::exportMultipleNetworks);
connect(addNetworkAction, &QAction::triggered, this, &CWirelessSettings::addNetwork);
connect(addAdhocAction, &QAction::triggered, this, &CWirelessSettings::addAdhoc);
connect(m_RemoveNetworkAction, &QAction::triggered, this, &CWirelessSettings::removeSelectedNetwork);
connect(m_SaveNetworksAction, &QAction::triggered, m_Device->getWireless()->getWpaSupplicant(), &CWpaSupplicant::save_config);
connect(reloadNetworksAction, &QAction::triggered, m_Device->getWireless()->getWpaSupplicant(), &CWpaSupplicant::reconfigure);
connect(m_KeepScanResultsAction, &QAction::toggled, this, &CWirelessSettings::keepScanResultsVisible);
connect(reassociateAction, &QAction::triggered, m_Device->getWireless()->getWpaSupplicant(), &CWpaSupplicant::reassociate);
manageNetworksMenu->addAction(enableNetworksAction);
manageNetworksMenu->addSeparator();
manageNetworksMenu->addAction(importNetworksAction);
manageNetworksMenu->addAction(exportNetworkAction);
manageNetworksMenu->addAction(exportMultipleNetworksAction);
advancedFuntionsMenu->addAction(m_SaveNetworksAction);
advancedFuntionsMenu->addAction(reloadNetworksAction);
advancedFuntionsMenu->addSeparator();
advancedFuntionsMenu->addAction(m_AutoSaveNetworksAction);
advancedFuntionsMenu->addAction(m_KeepScanResultsAction);
advancedFuntionsMenu->addSeparator();
advancedFuntionsMenu->addMenu(m_SetBSSIDMenu);
ui.managedView->addAction(m_EnableNetworkAction);
ui.managedView->addAction(m_DisableNetworkAction);
ui.managedView->addAction(getSeparator(this));
ui.managedView->addAction(m_SwitchNetworkAction);
ui.managedView->addAction(m_ConfigureNetworkAction);
ui.managedView->addAction(getSeparator(this));
ui.managedView->addAction(addNetworkAction);
ui.managedView->addAction(addAdhocAction);
ui.managedView->addAction(m_RemoveNetworkAction);
ui.managedView->addAction(getSeparator(this));
ui.managedView->addAction(manageNetworksMenu->menuAction());
ui.managedView->setContextMenuPolicy(Qt::ActionsContextMenu);
ui.availableView->addAction(addNetworkAction);
ui.availableView->addAction(getSeparator(this));
ui.availableView->addAction(m_RescanNetworksAction);
ui.availableView->setContextMenuPolicy(Qt::ActionsContextMenu);
ui.enableNetworkButton->setDefaultAction(m_EnableNetworkAction);
ui.disableNetworkButton->setDefaultAction(m_DisableNetworkAction);
ui.switchNetworkButton->setDefaultAction(m_SwitchNetworkAction);
ui.configureNetworkButton->setDefaultAction(m_ConfigureNetworkAction);
ui.removeNetworkButton->setDefaultAction(m_RemoveNetworkAction);
ui.toggleScanResultsButton->setDefaultAction(m_ToggleScanResultsAction);
ui.manageNetworksButton->setMenu(manageNetworksMenu);
ui.manageNetworksButton->setText(manageNetworksMenu->title());
ui.manageNetworksButton->setIcon(manageNetworksMenu->icon());
ui.manageNetworksButton->setPopupMode(QToolButton::InstantPopup);
ui.addNetworkButton->setDefaultAction(addNetworkAction);
ui.addAdhocButton->setDefaultAction(addAdhocAction);
ui.rescanNetworksButton->setDefaultAction(m_RescanNetworksAction);
ui.advancedFunctionsButton->setMenu(advancedFuntionsMenu);
ui.advancedFunctionsButton->setText(advancedFuntionsMenu->title());
ui.advancedFunctionsButton->setIcon(advancedFuntionsMenu->icon());
ui.advancedFunctionsButton->setPopupMode(QToolButton::InstantPopup);
ui.reassociateButton->setDefaultAction(reassociateAction);
m_SetBSSIDMapper = new QSignalMapper(this);
connect(m_SetBSSIDMapper, static_cast<void(QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped), this, &CWirelessSettings::handleBSSIDSwitchRequest);
}