[Qt-interest] QLabel text with colon always puts colon at the front

KC Jones kc at asperasoft.com
Wed Jan 20 20:14:57 CET 2010


There must be some other factor involved.  I cannot reproduce this in
my code in a trivial test.  I was able to call setText("FOO:") on one
of my QLabel widgets in my dialog's constructor immediately after the
setupUi(this) call, and it worked as expected.

Is there anything about the context where you make the call that might
be relevant?  Are there translations built in?  Is this called in a
slot after the dialog has been opened?

On Wed, Jan 20, 2010 at 10:36 AM, Keith Nicewarner
<Keith.Nicewarner at spacex.com> wrote:
> This is very strange.  I set the text with a trailing colon:
>
>     ui.label->setText("FOO:");
>
>     cout << ui.label->text().toStdString() << endl;
>
>
>
> And my printout confirms it’s what I set: “FOO:”.  But the widget has
> “:FOO”.  I set the label text properties to PlainText, thinking maybe
> autotext was screwing it up, but that wasn’t it. If I add a character after
> the colon, it works (“FOO:x”) but not if I add a space (“FOO: “).
>
>
>
> Any ideas what’s going on?
>
>
>
> Keith.
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>




More information about the Qt-interest-old mailing list