2
我正在尝试使其在重做仅在使用撤消后才可见的位置。我似乎无法得到它的工作。我知道我的信号和插槽有问题,我不知道如何使其工作。撤消后触发重做
这里是撤消的代码和重做信号插槽:
cutAct->setEnabled(false);
copyAct->setEnabled(false);
undoAct->setVisible(false);
redoAct->setVisible(false);
connect(textEdit, SIGNAL(copyAvailable(bool)), cutAct, SLOT(setEnabled(bool)));
connect(textEdit, SIGNAL(copyAvailable(bool)), copyAct, SLOT(setEnabled(bool)));
connect(textEdit->document(), SIGNAL(modificationChanged(bool)), undoAct, SLOT(setVisible(bool)));
connect(undoAct, SIGNAL(triggered()), redoAct, SLOT(setVisible(bool)));
一般动作,SIGNAL中的参数可能不会少于(或不同)SLOT中的参数。你应该在命令行中发出警告,说出类似的话。除此之外,opc0de的答案应该是解决您的问题。 –