在Qt中设置切换操作

时间:2014-03-13 19:00:11

标签: c++ qt

我在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)));

由于

0 个答案:

没有答案