January 3, 2011

bunjee bunjee
Lab Rat
122 posts

QML Text item + OSX

 

Greetings Dev Forum,

I’m using dynamically loaded QML components in my application. I’m in 4.7.1.

On OSX my Text items does not seem to be visible when doing so. However if I reload the view once they suddently appear.
This is specific to OSX and my Text items are always visible on Windows.

Moreover I’ve reimplemented my own QML Text component. When adding the following line at the end of my componentComplete() function everything works fine again:

  1. setFlag(QGraphicsItem::ItemHasNoContents, false);

Has anyone got a clue about this ?

6 replies

January 3, 2011

Volker Volker
Ant Farmer
5428 posts

As far as I remember from a DevDays presentation a few years ago, setting this flag is a must (at least on the C++ side, but I doubt it to be different in QML/Quick), otherwise it will be invisible/not drawn.

January 3, 2011

bunjee bunjee
Lab Rat
122 posts

Yes.

That does not explain why I get this odd behavior with Qt’s Text Component though.

January 3, 2011

Volker Volker
Ant Farmer
5428 posts

Do you have a sample that demonstrates the problem?

January 3, 2011

bunjee bunjee
Lab Rat
122 posts

Not yet. I’ll try to come up with something :).

January 3, 2011

Mohsen Mohsen
Lab Rat
747 posts

Do you have same problem with other text objects like TextInput or TextEdit?

 Signature 

www.madagon.com

January 5, 2011

blam blam
Lab Rat
58 posts

It sounds like a bug if Text items are not visible when first created. Could you please file a bug with an example at bugreports.qt.nokia.com?

 
  ‹‹ cannot find QML control page on the wiki      Using a QML model from a QDeclarativeItem subclass ››

You must log in to post a reply. Not a member yet? Register here!