I have created a menu item that is checkable:
Code: Select all
class _SetDebugLevel:
"""Set the debug level"""
def Activated(self, index):
# what is done when the command is clicked
if index == 0:
SetDBLevel(False)
else:
SetDBLevel(True)
def GetResources(self):
# icon and command information
MenuText = QtCore.QT_TRANSLATE_NOOP(
'OneCAM_Main',
'Debug')
ToolTip = QtCore.QT_TRANSLATE_NOOP(
'OneCAM_Main',
'Set Debug Level for OneCAM')
return {
'MenuText': MenuText,
'ToolTip': ToolTip,
'Checkable': True}
so if debug is True i want the mark checked and if debug is False put the mark as unchecked.
At the menu creation the mark is set (it as the little v on it)
How to achieve that?
Regards
Carlo D.
OS: Devuan GNU/Linux 2.0 (ascii)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)