这也是函数(in )showGridAction
中(我看到问题的地方)的代码:void MainWindow::createActions()
MainWindow.cpp
showGridAction = new QAction(tr("&Show Grid"), this);
showGridAction -> setCheckable(true);
showGridAction -> setChecked(spreadsheet -> showGrid());
showGridAction -> setStatusTip(tr("Show or hide the spreadsheet's"
" grid"));
connect(showGridAction, SIGNAL(toggled(bool)),
spreadsheet, SLOT(setShowGride(bool)));
#if QT_VERSION < 0x040102
// workaround for a QTableWidget bug in Qt 4.1.1
connect(showGridAction, SIGNAL(toggled(bool)),
spreadsheet->viewport(), SLOT(update()));
#endif
我的问题:
1-首先我认为不再需要#if QT_VERSION < 0x040102
直到部分#endif
,因为我使用的是Qt 5.9。你也这么认为吗?
2-该代码无效。正如您从上面的屏幕截图中看到的那样,选中和取消选中该Show Grid
选项不会改变!请问如何使它适用于应用程序?
3-代码中有一个名为setShowGride(bool)
. 这个从哪里来?当我点击它时它不会被突出显示,当我按下它时也不会带我去任何地方F2
!这可能是上述选项不起作用的问题根源。
请问怎么修?