Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Help!!! Object text display error

    Mobile and Embedded
    5
    15
    4341
    Loading More Posts
    • 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.
    • P
      peterl last edited by

      Platform: N8-00, NokiaSDK 1.0.2 (Qt for Symbian 4.6.3 + QtMobility 1.0.2)
      Project: Simple "Hello" QLabel + "Quit" PushButton demo, first step demo

      Result: Simulator runs ok, but installed to N8-00, got issues:

      • MainWindow Title and Bottom Pushbutton Text displayed correct

      • Objects in window text displayed error --> "Hello" became "Fcjjm", "Quit" became "Qsgr", looks like Every Character value subtracted 2.

        'H'-2='F' 'e'-2='c' ... "Hello" became "Fcjjm"

      !http://cdupload.com/pthumbs/small/74960/hello.png(form)! !http://cdupload.com/pthumbs/small/74959/Screenshot0001.jpg(mobile)!
      [url=http://cdupload.com/public/view/74960][img]http://cdupload.com/pthumbs/small/74960/hello.png[/img][/url]
      [url=http://cdupload.com/public/view/74959][img]http://cdupload.com/pthumbs/small/74959/Screenshot0001.jpg[/img][/url]

      • create new QLabel on Mainwindow construction:
        @
        QLabel *l = new QLabel(this);
        l->setText("Aba");
        l->setGeometry(QRect(10,10,100,20));
        @
        -> "Aba" became "?`_" :confused:

      Question:
      Anyone could help me? any inputs are welcome:)

      1 Reply Last reply Reply Quote 0
      • F
        florent.revelut last edited by

        No clue about it, but it looks like a damn-cool bug!!!

        Does using an explicit QString help ?

        I would try using

        • creating the string on stack
        • displaying it
        • outputtingit in debug (or looking directly into pointed ram to know if it's a string corruption or a display issue)
        1 Reply Last reply Reply Quote 0
        • P
          peterl last edited by

          String is right in memory

          I putted QLineEdit inside, default text string "Hello"

          1. "Fcjjm"
          2. Tap edit box, enter IME mode, "Hello" appear ...

          So, only displaying error, string in memory is still right....

          1 Reply Last reply Reply Quote 0
          • G
            giesbert last edited by

            you could try using QLatin1String() instead of QString("").
            might be a code page error...

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply Reply Quote 0
            • F
              florent.revelut last edited by

              on standard characters (ascii), codepage issues should not happen... especially, not with such an offset

              1 Reply Last reply Reply Quote 0
              • G
                giesbert last edited by

                Theoretically not, but who can guarantee?
                It's worth a try

                Nokia Certified Qt Specialist.
                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                1 Reply Last reply Reply Quote 0
                • F
                  florent.revelut last edited by

                  Clearly, that was my point about looking at memory : if pointed data is correct and formatting metadata as well, it's even more fun !

                  1 Reply Last reply Reply Quote 0
                  • G
                    giesbert last edited by

                    ok, ok.
                    I see, you love to do the hard way...

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply Reply Quote 0
                    • P
                      peterl last edited by

                      I tested
                      @l->setText(QLatin1String("Aba")); @

                      even

                      @
                      main()
                      {
                      ...
                      QTextCodec::setCodecForLocale(QTextCodec::codecForName("System"));
                      QTextCodec::setCodecForCStrings(QTextCodec::codecForName("System"));
                      QTextCodec::setCodecForTr(QTextCodec::codecForName("System"));
                      }
                      @

                      and
                      @
                      main()
                      {
                      ...
                      QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
                      QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
                      QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
                      }
                      @

                      all the result are the same

                      1 Reply Last reply Reply Quote 0
                      • G
                        giesbert last edited by

                        Strange, no more ideas currently.

                        Nokia Certified Qt Specialist.
                        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                        1 Reply Last reply Reply Quote 0
                        • F
                          florent.revelut last edited by

                          Funny thing, on your screenshot, it seems to work with a button or another graphical primitive...
                          I'm starting to be stuck (and stunned (and damn interested)), too bad I don't have a target to start looking in depth...

                          1 Reply Last reply Reply Quote 0
                          • V
                            vinb last edited by

                            Can you try it with a checkbox or radiobutton
                            and a lineedit and post the output here?

                            1 Reply Last reply Reply Quote 0
                            • P
                              peterl last edited by

                              added checkbox, radiobutton and a lineedit,

                              !http://cdupload.com/pthumbs/large/74977/Screenshot0006.jpg(6)!

                              Avoid conflict, uninstalled Qt4.7 for Desktop, QtSDK 1.0, then installed QtSDK 1.1 beta, got the same result....

                              So, maybe it isn't complier environment problem, is target device problem???? But if so, why other applications run properly???

                              who knows

                              ...OMG

                              1 Reply Last reply Reply Quote 0
                              • V
                                vinb last edited by

                                seems like it is shifting 2 chars, so you can work around it and get the good result. But it is a strange case indeed and im very interested in the solution. If you find any.

                                1 Reply Last reply Reply Quote 0
                                • G
                                  goetz last edited by

                                  It's high time for a new ticket in the "bug tracker":http://bugreports.qt.nokia.com, I would say... (and leave a link to the ticket here, please).

                                  http://www.catb.org/~esr/faqs/smart-questions.html

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post