0
Here是程序,這裏是the screenshot。插槽setShowGride不適用於我的應用程序
這裏也是裏面的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
時,它也不會帶我走!這可能是上述選項不起作用的問題的根源。
如何解決它?