我在QAction
中有3 QToolBar
个。问题是广告位setChecked()
不起作用。我错了什么?
这是代码:
actionSetCursorAddDeletePoint = new QAction(MainWindowClass);
actionSetCursorAddDeletePoint->setCheckable(true);
actionSetCursorMovePoint = new QAction(MainWindowClass);
actionSetCursorMovePoint->setCheckable(true);
actionSetCursorSelect = new QAction(MainWindowClass);
actionSetCursorSelect->setCheckable(true);
QObject::connect(actionSetCursorSelect, SIGNAL(changed()), MainRenderAreaUi, SLOT(/*SetMouseAction(SELECT)*/SetMouseActionSelect()));
QObject::connect(actionSetCursorSelect, SIGNAL(changed()), actionSetCursorMovePoint, SLOT(setChecked(true)));
QObject::connect(actionSetCursorSelect, SIGNAL(changed()), actionSetCursorAddDeletePoint, SLOT(setChecked(true)));
QObject::connect(actionSetCursorAddDeletePoint, SIGNAL(changed()), MainRenderAreaUi, SLOT(/*SetMouseAction(PUTDELETE)*/SetMouseActionPutDelete()));
QObject::connect(actionSetCursorAddDeletePoint, SIGNAL(changed()), actionSetCursorSelect, SLOT(setChecked(true)));
QObject::connect(actionSetCursorAddDeletePoint, SIGNAL(changed()), actionSetCursorMovePoint, SLOT(setChecked(true)));
QObject::connect(actionSetCursorMovePoint, SIGNAL(changed()), MainRenderAreaUi, SLOT(/*SetMouseAction(DRAGDROP)*/SetMouseActionDragDrop()));
QObject::connect(actionSetCursorMovePoint, SIGNAL(changed()), actionSetCursorSelect, SLOT(setChecked(true)));
QObject::connect(actionSetCursorMovePoint, SIGNAL(changed()), actionSetCursorAddDeletePoint, SLOT(setChecked(true)));
由于