What does Utf8 means ???
-
What does this means @bgWidget->setObjectName(QString::fromUtf8("bgWidget")); @
-
You can find it "here":http://doc.qt.nokia.com/4.7/qobject.html#objectName-prop in the doumentation
-
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...
-
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.
-
thanks for your reply...
-
This means we are creating this widget ,so that we can use it afterwords when we need it ....Is this correct ????
-
[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.