Solved Many compiler warnings after update of Qt and Qt Creator to newest version
-
Code that compiled earlier on 5.11.1 without any warnings now throws many errors such as the following:
/home/bob/code/SBBL/../../Qt/5.12.8/gcc_64/include/QtWidgets/qstyleoption.h:392: warning: implicitly-declared ‘QStyleOptionDockWidget& QStyleOptionDockWidget::operator=(const QStyleOptionDockWidget&)’ is deprecated [-Wdeprecated-copy] 392 | QStyleOptionDockWidget(const QStyleOptionDockWidget &other) : QStyleOption(Version, Type) { *this = other; } | ^~~~~
I upgraded my laptop from Ubuntu 18.04 to 20.04 and installed the open source Qt 5.12.8 with Qt Creator 4.12.3.
GCC version is 9.3.8. All of the warnings seem to be exactly the same type but for different Qt classes, and there are about 3500 of these...
How can I at least turn them off?
-
Hi
I think you also got a new compiler.I assume its not RED remarks in the side where line numbers are, but actual
warnings in the compiler output ?It lists pr warning what controls it
[-Wdeprecated-copy]
so like
QMAKE_CXXFLAGS += -Wno-deprecated-copy
(in your . pro file )but 3500 sounds alot.
All the same or many, many different ?
-
@mrjj Thank you, that works!
-
Looks like https://bugreports.qt.io/browse/QTBUG-75210 is relevant here.