forked from qt-creator/qt-creator
Support modes with context menus.
If modes provide a QMenu, a little arrow is shown next to the mode icon. If the user clicks there, the menu is shown instead of changing the mode. Limitations: Modes need to provide some QMenu instance already when they are added to the object pool. Setting or removing the menu later will not update the UI. Change-Id: Ic4ef709e6200afcff14f41054a5dd98c37b0b849 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -32,6 +32,12 @@ IMode::IMode(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
IMode::~IMode()
|
||||
{
|
||||
if (m_menu)
|
||||
delete m_menu;
|
||||
}
|
||||
|
||||
void IMode::setEnabled(bool enabled)
|
||||
{
|
||||
if (m_isEnabled == enabled)
|
||||
|
||||
Reference in New Issue
Block a user