Porting from QT4.6 to QT5
-
As this 6 year old blog post explains, these styles have moved to the QtStylePlugins module.
@SGaist
how to install the plugin it is still not clear to me if you can directly suggest the code changes -
@SGaist
how to install the plugin it is still not clear to me if you can directly suggest the code changes@Qt-Enthusiast With a short search you can find: https://forum.qt.io/topic/65912/how-to-install-qtstyleplugins/7
-
ui_widget.h:177:119: error: 'UnicodeUTF8' is not a member of 'QApplication'
6987 browser->xt(QApplication::translate("exportWidget", "View in browser after exporting", 0, QApplication::UnicodeUTF8));how to solve this issue and ui_widget.h is generated by uic
-
I am getting a lot of issues when ui files
-
You're using the wrong uic (the one from Qt4) as it seems. Make sure to recreate your Makefiles with qmake for Qt5!
-
One more thing, ensure that your source tree doesn't contain any generated file e.g. ui_*.h, etc. only original sources, .qrc, .ui file etc.
-
I am getting following error
how to solve this error
QString myString
error: 'class QString' has no member named 'toAscii'
execute(myString.toAscii(); -
I am getting following error
how to solve this error
QString myString
error: 'class QString' has no member named 'toAscii'
execute(myString.toAscii();@Qt-Enthusiast
Its in the docs. i linked before.
https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#toAscii.28.29_and_fromAscii.28.29_Methods_are_deprecated -
One more question, I am getting following errors
void myClass::mythod() {
bool x = FALSE;
booly = TRUE;
}error: 'FALSE' was not declared in this scope
any reason why and how to solve this issue
is there FALSE is declared in qt4 source code
-
One more question, I am getting following errors
void myClass::mythod() {
bool x = FALSE;
booly = TRUE;
}error: 'FALSE' was not declared in this scope
any reason why and how to solve this issue
is there FALSE is declared in qt4 source code
@Qt-Enthusiast
just use the c++ versions
true
false
(in small letters) -
what is significance of FALSE and TRUE in Qt4
-
Also I am getting an error
mainwindow.h:17:0: error: "Q_NULLPTR" redefined [-Werror]is Q_NULLPTR defined in SRC of QT5
-
Also I am getting an error
mainwindow.h:17:0: error: "Q_NULLPTR" redefined [-Werror]is Q_NULLPTR defined in SRC of QT5
@Qt-Enthusiast Please post your code (mainwindow.h).
Also it is better to use nullptr from C++11 now. -
@Qt-Enthusiast
just use the c++ versions
true
false
(in small letters)@mrjj
is FALSE and TRUE defined in qt4 code -
@mrjj
is FALSE and TRUE defined in qt4 code -
Then why I am getting this error when I am changing the library to Qt5
-
Then why I am getting this error when I am changing the library to Qt5
@Qt-Enthusiast Do you use same compiler for both Qt versions?
-
Then why I am getting this error when I am changing the library to Qt5
@Qt-Enthusiast said in Porting from QT4.6 to QT5:
Then why I am getting this error when I am changing the library to Qt5
Because you also changed your compiler?
-
@Qt-Enthusiast Do you use same compiler for both Qt versions?
Yes
I changed just the qt version. What is significance of Q_NULLPTR -
Yes
I changed just the qt version. What is significance of Q_NULLPTR@Qt-Enthusiast Well, if you search a bit you will find this in Qt source:
#ifdef Q_COMPILER_NULLPTR # define Q_NULLPTR nullptr #else # define Q_NULLPTR NULL #endif
If you have a C++11 compiler Q_NULLPTR will be nullptr, else it will be the old C/C++ NULL.
You can use Q_NULLPTR if you have to support older C++ compilers which do not know anything about nullptr and newer C++ compilers.