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. UnicodeUTF8 not member QApplication - generated with Qt5 Designer
QtWS25 Last Chance

UnicodeUTF8 not member QApplication - generated with Qt5 Designer

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 30.3k Views
  • 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.
  • S Offline
    S Offline
    snake8080
    wrote on 7 Jun 2013, 16:38 last edited by
    #1

    So I upgraded to Qt5...I loaded my apps from QT4 and I fixed a # of issues like #includes to the Qt5 style. So it gets through most of files now without error. BUT, when it generates the UI headers, Qt actually generates the incorrect code like so:
    iHighlightButton->setText(QApplication::translate("DoubleGraphicView", "Highlight Items", 0, QApplication::UnicodeUTF8));
    iUnHighlightButton->setText(QApplication::translate("DoubleGraphicView", "Unhighlight Items", 0, QApplication::UnicodeUTF8));

    So why would Qt5 generate this which are deprecated values in Qt5...? Am I missing a setting?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pwnstar23
      wrote on 7 Jun 2013, 18:28 last edited by
      #2

      A hack to get this working is to create a qt 5 application and then copy your projects source files to it.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        snake8080
        wrote on 8 Jun 2013, 00:51 last edited by
        #3

        Thanks...what I actually did was install the qt4 libraries/core and this seemed to get past this. But yes if you start with a fresh qt5 project your good to go.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          creatron
          wrote on 27 Jul 2013, 20:54 last edited by
          #4

          QCoreApplication::UnicodeUTF8 is deprecated

          This enum type used to define the 8-bit encoding of character string arguments to translate(). This enum is now obsolete and UTF-8 will be used in all cases. So remove all instances of QCoreApplication::UnicodeUTF8. For example:

          Href_Gui->setWindowTitle(QApplication::translate("Href_Gui", "Url / www", 0, QApplication::UnicodeUTF8));
          label->setText(QApplication::translate("Href_Gui", "Text:", 0, QApplication::UnicodeUTF8));
          label_2->setText(QApplication::translate("Href_Gui", "Url:", 0, QApplication::UnicodeUTF8));
          label_3->setText(QApplication::translate("Href_Gui", "Target / Name:", 0, QApplication::UnicodeUTF8));
          

          to

          Href_Gui->setWindowTitle(QApplication::translate("Href_Gui", "Url / www", 0));
          label->setText(QApplication::translate("Href_Gui", "Text:", 0));
          label_2->setText(QApplication::translate("Href_Gui", "Url:", 0));
          label_3->setText(QApplication::translate("Href_Gui", "Target / Name:", 0));
          

          This solved my problem

          1 Reply Last reply
          1
          • H Offline
            H Offline
            hisoft
            wrote on 20 Jan 2014, 17:49 last edited by
            #5

            Hi,

            This is an old post but i've the same problem (as described by snake8080). Is there any other/logical solution (without hacking anything) ?

            Thanks.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Al__
              wrote on 31 Dec 2014, 12:50 last edited by
              #6

              True. an old post; I found it since I had the same issue. In case someone still needs a solution: I had to manually delete the old intermediate files (moc_*, *.o) that were in the same directory as the source code, then run qmake (from QtCreater menu). Now solved.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Al__
                wrote on 31 Dec 2014, 12:50 last edited by
                #7

                True. an old post; I found it since I had the same issue. In case someone still needs a solution: I had to manually delete the old intermediate files (moc_*, *.o) that were in the same directory as the source code, then run qmake (from QtCreater menu). Now solved.

                1 Reply Last reply
                0

                • Login

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