Examples: Fix unused variable warnings by Clang
mainwindow.cpp(59,11): warning: unused variable 'ROWS' [-Wunused-const-variable] const int ROWS = 2; mainwindow.cpp(60,11): warning: unused variable 'COLUMNS' [-Wunused-const-variable] const int COLUMNS = 3; mainwindow.cpp(76,19): warning: unused variable 'message' [-Wunused-const-variable] Task-number: QTBUG-60635 Change-Id: I97c31462ffa826da9baa32c33c0ff0140bf46dfc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
01c12a5c1a
commit
3e4b7223f1
@ -187,6 +187,13 @@ void MainWindow::setupMenuBar()
|
||||
#endif
|
||||
|
||||
dockWidgetMenu = menuBar()->addMenu(tr("&Dock Widgets"));
|
||||
|
||||
QMenu *aboutMenu = menuBar()->addMenu(tr("About"));
|
||||
QAction *aboutAct = aboutMenu->addAction(tr("&About"), this, &MainWindow::about);
|
||||
aboutAct->setStatusTip(tr("Show the application's About box"));
|
||||
|
||||
QAction *aboutQtAct = aboutMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
|
||||
aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
|
||||
}
|
||||
|
||||
void MainWindow::setDockOptions()
|
||||
@ -476,3 +483,8 @@ void MainWindow::destroyDockWidget(QAction *action)
|
||||
if (destroyDockWidgetMenu->isEmpty())
|
||||
destroyDockWidgetMenu->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::about()
|
||||
{
|
||||
QMessageBox::about(this, tr("About MainWindows"), message);
|
||||
}
|
||||
|
@ -77,6 +77,8 @@ public slots:
|
||||
void createDockWidget();
|
||||
void destroyDockWidget(QAction *action);
|
||||
|
||||
void about();
|
||||
|
||||
private:
|
||||
void setupToolBar();
|
||||
void setupMenuBar();
|
||||
|
@ -55,10 +55,6 @@
|
||||
#include <QStandardItem>
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
||||
const int ROWS = 2;
|
||||
const int COLUMNS = 3;
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user