Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. What does Utf8 means ???
Forum Updated to NodeBB v4.3 + New Features

What does Utf8 means ???

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 4 Posters 4.2k Views 1 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.
  • P Offline
    P Offline
    prajnaranjan.das
    wrote on last edited by
    #1

    What does this means @bgWidget->setObjectName(QString::fromUtf8("bgWidget")); @

    Prajnaranjan Das

    e mail: prajnaranjan.das@gmail.com

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qtrahul
      wrote on last edited by
      #2

      It is used in creating music widget, or something like, for setting the object name.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vcsala
        wrote on last edited by
        #3

        You can find it "here":http://doc.qt.nokia.com/4.7/qobject.html#objectName-prop in the doumentation

        1 Reply Last reply
        0
        • P Offline
          P Offline
          prajnaranjan.das
          wrote on last edited by
          #4

          Thanks for your reply...

          @QWidget *bgWidget = new QWidget(this);
          bgWidget->setObjectName(QString::fromUtf8("bgWidget"));@

          Can you please tell me why are we using in the above coding

          @QString::fromUtf8("bgWidget"))@

          and also tell me about this fromUtf8...

          Prajnaranjan Das

          e mail: prajnaranjan.das@gmail.com

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vcsala
            wrote on last edited by
            #5

            It hard to tell you from this snippet, usually as the documentation says (above link) this is mainly used if you want to find the object later among childwidgets, etc.

            Regarding the fromUtf8 I beleive this also should be described in the documentation, I really do not see why it is required here.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              prajnaranjan.das
              wrote on last edited by
              #6

              thanks for your reply...

              Prajnaranjan Das

              e mail: prajnaranjan.das@gmail.com

              1 Reply Last reply
              0
              • P Offline
                P Offline
                prajnaranjan.das
                wrote on last edited by
                #7

                This means we are creating this widget ,so that we can use it afterwords when we need it ....Is this correct ????

                Prajnaranjan Das

                e mail: prajnaranjan.das@gmail.com

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  [quote author="Prajnaranjan Das" date="1293434549"]Thanks for your reply...

                  @QWidget *bgWidget = new QWidget(this);
                  bgWidget->setObjectName(QString::fromUtf8("bgWidget"));@

                  Can you please tell me why are we using in the above coding
                  [/quote]
                  Line 1 creates the widget. This is a must.

                  Line 2 gives the object a name, this completely optional. It's mainly used in debug output. It is completely different from the variable name, although often both are the same.

                  [quote author="Prajnaranjan Das" date="1293434549"]

                  @QString::fromUtf8("bgWidget"))@

                  and also tell me about this fromUtf8...[/quote]

                  QString internally uses unicode for the strings. Unfortunately the world is not unicode in every place. Source code often contains only 8-bit strings. If your source code is in UTF-8 unicode, then you have to tell QString in order to do the right decoding.

                  If you're not sure about Unicode and UTF-8, just ask a search engine - it is a quite big topic and would be out of scope for the Qt forum. Wikipedia would be a good start too.

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

                  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