Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Porting from QT4.6 to QT5
Forum Updated to NodeBB v4.3 + New Features

Porting from QT4.6 to QT5

Scheduled Pinned Locked Moved Unsolved General and Desktop
44 Posts 8 Posters 15.4k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 2 Jun 2018, 10:42 last edited by mrjj 6 Feb 2018, 10:43
    #2

    Hi
    They changed the includes so make sure you include the right ones.
    Also they renamed UnicodeUTF8. But hard to guess at without code context where error comes.
    if using old project, make sure to delete ANY left over ui_xxx files

    https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5

    Its most likely inside the ui_ files you get it.

    1 Reply Last reply
    5
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 2 Jun 2018, 11:06 last edited by
      #3

      And make sure to not include the qt4 headers by accident - this can happen easily and create a lot of strange compiler errors...

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      5
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on 14 Jun 2018, 21:08 last edited by
        #4

        Hi All
        https://forum.qt.io/topic/91657/compilation-errors-when-porting-from-qt4-to-qt5/2

        Can someone guide me how to install plugin for QMotifyStyle

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Jun 2018, 21:16 last edited by
          #5

          As this 6 year old blog post explains, these styles have moved to the QtStylePlugins module.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Q 1 Reply Last reply 14 Jun 2018, 21:43
          1
          • S SGaist
            14 Jun 2018, 21:16

            As this 6 year old blog post explains, these styles have moved to the QtStylePlugins module.

            Q Offline
            Q Offline
            Qt Enthusiast
            wrote on 14 Jun 2018, 21:43 last edited by Qt Enthusiast
            #6

            @SGaist
            how to install the plugin it is still not clear to me if you can directly suggest the code changes

            J 1 Reply Last reply 15 Jun 2018, 04:25
            0
            • Q Qt Enthusiast
              14 Jun 2018, 21:43

              @SGaist
              how to install the plugin it is still not clear to me if you can directly suggest the code changes

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 15 Jun 2018, 04:25 last edited by
              #7

              @Qt-Enthusiast With a short search you can find: https://forum.qt.io/topic/65912/how-to-install-qtstyleplugins/7

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • Q Offline
                Q Offline
                Qt Enthusiast
                wrote on 17 Jun 2018, 04:07 last edited by
                #8

                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

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  Qt Enthusiast
                  wrote on 17 Jun 2018, 04:48 last edited by
                  #9

                  I am getting a lot of issues when ui files

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 17 Jun 2018, 06:11 last edited by
                    #10

                    You're using the wrong uic (the one from Qt4) as it seems. Make sure to recreate your Makefiles with qmake for Qt5!

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    2
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 17 Jun 2018, 20:08 last edited by
                      #11

                      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.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      3
                      • Q Offline
                        Q Offline
                        Qt Enthusiast
                        wrote on 20 Jun 2018, 14:29 last edited by
                        #12

                        I am getting following error

                        how to solve this error

                        QString myString
                        error: 'class QString' has no member named 'toAscii'
                        execute(myString.toAscii();

                        M 1 Reply Last reply 20 Jun 2018, 14:59
                        0
                        • Q Qt Enthusiast
                          20 Jun 2018, 14:29

                          I am getting following error

                          how to solve this error

                          QString myString
                          error: 'class QString' has no member named 'toAscii'
                          execute(myString.toAscii();

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 20 Jun 2018, 14:59 last edited by
                          #13

                          @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

                          1 Reply Last reply
                          2
                          • Q Offline
                            Q Offline
                            Qt Enthusiast
                            wrote on 20 Jun 2018, 15:31 last edited by Qt Enthusiast
                            #14

                            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

                            M 1 Reply Last reply 20 Jun 2018, 15:41
                            0
                            • Q Qt Enthusiast
                              20 Jun 2018, 15:31

                              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

                              M Offline
                              M Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on 20 Jun 2018, 15:41 last edited by
                              #15

                              @Qt-Enthusiast
                              just use the c++ versions
                              true
                              false
                              (in small letters)

                              Q 1 Reply Last reply 21 Jun 2018, 05:44
                              2
                              • Q Offline
                                Q Offline
                                Qt Enthusiast
                                wrote on 21 Jun 2018, 03:44 last edited by
                                #16

                                what is significance of FALSE and TRUE in Qt4

                                1 Reply Last reply
                                0
                                • Q Offline
                                  Q Offline
                                  Qt Enthusiast
                                  wrote on 21 Jun 2018, 03:45 last edited by
                                  #17

                                  Also I am getting an error
                                  mainwindow.h:17:0: error: "Q_NULLPTR" redefined [-Werror]

                                  is Q_NULLPTR defined in SRC of QT5

                                  J 1 Reply Last reply 21 Jun 2018, 04:42
                                  0
                                  • Q Qt Enthusiast
                                    21 Jun 2018, 03:45

                                    Also I am getting an error
                                    mainwindow.h:17:0: error: "Q_NULLPTR" redefined [-Werror]

                                    is Q_NULLPTR defined in SRC of QT5

                                    J Online
                                    J Online
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on 21 Jun 2018, 04:42 last edited by
                                    #18

                                    @Qt-Enthusiast Please post your code (mainwindow.h).
                                    Also it is better to use nullptr from C++11 now.

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • M mrjj
                                      20 Jun 2018, 15:41

                                      @Qt-Enthusiast
                                      just use the c++ versions
                                      true
                                      false
                                      (in small letters)

                                      Q Offline
                                      Q Offline
                                      Qt Enthusiast
                                      wrote on 21 Jun 2018, 05:44 last edited by
                                      #19

                                      @mrjj
                                      is FALSE and TRUE defined in qt4 code

                                      JKSHJ 1 Reply Last reply 21 Jun 2018, 05:55
                                      0
                                      • Q Qt Enthusiast
                                        21 Jun 2018, 05:44

                                        @mrjj
                                        is FALSE and TRUE defined in qt4 code

                                        JKSHJ Offline
                                        JKSHJ Offline
                                        JKSH
                                        Moderators
                                        wrote on 21 Jun 2018, 05:55 last edited by
                                        #20

                                        @Qt-Enthusiast said in Porting from QT4.6 to QT5:

                                        is FALSE and TRUE defined in qt4 code

                                        No.

                                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                        1 Reply Last reply
                                        1
                                        • Q Offline
                                          Q Offline
                                          Qt Enthusiast
                                          wrote on 21 Jun 2018, 05:56 last edited by
                                          #21

                                          Then why I am getting this error when I am changing the library to Qt5

                                          J JKSHJ 2 Replies Last reply 21 Jun 2018, 05:57
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved