Re: [Interest] Loader refresh
If it's just about language changes, it's pretty easy to fix. Just add a function that updates the string on each text item. Exactly like a ui_xx.h file does it. One hack I've seen but never tried is to have a c++ object that has a string property. The property is actually always empty, but on language switches the c++ object emits the property changed signal. In the qml code you do this: Text { text: qsTr("foo") + cppObject.emptyString } As I said, I never tried this, because it smells a bit. My preferred method of doing live language switches in qml is to have a translate function on every page that sets all strings. You most definitely do not reload the loader ever just to work around something. The loader is for switching the page it holds, not anything else. Bo. Den 14-09-2015 kl. 17:02 skrev m...@rpzdesign.com: > Bo: > > Thanks for the response. > > The only other areas that I can see needing a screen refresh are > ListView and Image (Imageprovider) > > The Text QML object was shared as one example of "changing" after the > loader is when you swap out the language from English to Chinese to Arabic. > > I think this is where we mis-understand each other. What are my > Post-Loader options, not pre-loader. > > The only way I can see now to "reload" using loader, but it is not very > smooth. > > And the component cache will suppress the repeated loading of the same > QmlComponent object after 1 refresh. > > So then you are really forced to make the QML stack see a new > Component so the loading is forced to take. And that heavy handed > requirement causes quite a lot of screen flicker. > > So I would chalk this up to the inability right now to force the QML > engine to Repaint itself. > > Yes, I know, the rebuilding the Scene graph would be expensive, but that > is what I would like to do in a generic way instead of having to set the > text individually for each component (Since each one loads itself based > on Country Language) > > Kind of a catch-22 for text objects based on displayed language. > > Maybe Microsoft flickers when it changes its display language, so I will > just do the same. > > Cheers, > > md > > > On 9/14/2015 1:11 AM, Bo Thorsen wrote: >> Hi md, >> >> I don't know what it is you see, you just say it flickers. We use a lot >> of Loader objects for customer code, and that doesn't flicker. >> >> The only guess I have on how this could happen is if you have lots of >> bindings that keep propagating through the system. >> >> For example, you mentioned a Text object that switches from one string >> to another. This is an indication that your code is the reason for those >> problems. When you activate the loader, set the proper text immediately, >> don't switch it later. >> >> Anything like what you're trying to do below is an attempt to solve the >> symptom rather than the problem. >> >> Den 11-09-2015 kl. 20:37 skrev m...@rpzdesign.com: >>> Someone must have come across this problem before. >>> >>> Loader->sourceComponent is too heavy and causes screen flicker. >>> >>> QMetaObject::invokeMethod(gobj,"doLayout",Qt::QueuedConnection) does not >>> work on QQuickText class objects. >> >> Bo Thorsen, >> Director, Viking Software. >> > Bo Thorsen, Director, Viking Software. -- Viking Software Qt and C++ developers for hire http://www.vikingsoft.eu ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Loader refresh
Bo: Thanks for the response. The only other areas that I can see needing a screen refresh are ListView and Image (Imageprovider) The Text QML object was shared as one example of "changing" after the loader is when you swap out the language from English to Chinese to Arabic. I think this is where we mis-understand each other. What are my Post-Loader options, not pre-loader. The only way I can see now to "reload" using loader, but it is not very smooth. And the component cache will suppress the repeated loading of the same QmlComponent object after 1 refresh. So then you are really forced to make the QML stack see a new Component so the loading is forced to take. And that heavy handed requirement causes quite a lot of screen flicker. So I would chalk this up to the inability right now to force the QML engine to Repaint itself. Yes, I know, the rebuilding the Scene graph would be expensive, but that is what I would like to do in a generic way instead of having to set the text individually for each component (Since each one loads itself based on Country Language) Kind of a catch-22 for text objects based on displayed language. Maybe Microsoft flickers when it changes its display language, so I will just do the same. Cheers, md On 9/14/2015 1:11 AM, Bo Thorsen wrote: > Hi md, > > I don't know what it is you see, you just say it flickers. We use a lot > of Loader objects for customer code, and that doesn't flicker. > > The only guess I have on how this could happen is if you have lots of > bindings that keep propagating through the system. > > For example, you mentioned a Text object that switches from one string > to another. This is an indication that your code is the reason for those > problems. When you activate the loader, set the proper text immediately, > don't switch it later. > > Anything like what you're trying to do below is an attempt to solve the > symptom rather than the problem. > > Den 11-09-2015 kl. 20:37 skrev m...@rpzdesign.com: >> Someone must have come across this problem before. >> >> Loader->sourceComponent is too heavy and causes screen flicker. >> >> QMetaObject::invokeMethod(gobj,"doLayout",Qt::QueuedConnection) does not >> work on QQuickText class objects. > > Bo Thorsen, > Director, Viking Software. > -- No spell checkers were harmed during the creation of this message. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Loader refresh
Hi md, I don't know what it is you see, you just say it flickers. We use a lot of Loader objects for customer code, and that doesn't flicker. The only guess I have on how this could happen is if you have lots of bindings that keep propagating through the system. For example, you mentioned a Text object that switches from one string to another. This is an indication that your code is the reason for those problems. When you activate the loader, set the proper text immediately, don't switch it later. Anything like what you're trying to do below is an attempt to solve the symptom rather than the problem. Den 11-09-2015 kl. 20:37 skrev m...@rpzdesign.com: > Someone must have come across this problem before. > > Loader->sourceComponent is too heavy and causes screen flicker. > > QMetaObject::invokeMethod(gobj,"doLayout",Qt::QueuedConnection) does not > work on QQuickText class objects. Bo Thorsen, Director, Viking Software. -- Viking Software Qt and C++ developers for hire http://www.vikingsoft.eu ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Loader refresh
Ok: Someone must have come across this problem before. Loader->sourceComponent is too heavy and causes screen flicker. QMetaObject::invokeMethod(gobj,"doLayout",Qt::QueuedConnection) does not work on QQuickText class objects. Hopefully someone has already skinned this cat. Cheers, md On 9/11/2015 11:39 AM, m...@rpzdesign.com wrote: > Hello List: > > Anybody have ideas on how to cause a QML refresh to repaint a QML Window > or component. > > I tried setting the sourceComponent value of Loader but it causes a good > amount of screen flicker and has some of optimizations so it will not > reload the same component 2 times in a row, as if the componentCache is > absorbing the successive update requests. > > This problem is generally for Text { text : "English" } -> Text { text: > "Espanol" } language changes, but it could be for most anything. > > And its kind of a pain to consider having to recurse through a component > tree looking for a property an update it. > > Window()->findChildren()->setProperty() is one possibility. > > Some posts have talked about "notify" signal, but messing around with > slots for every GUI component seems incorrect. > > Any ideas? > > md > -- No spell checkers were harmed during the creation of this message. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Loader refresh
Listers: I was able to loop through the children recursively and find that the "QQuickText" Classnames were the candidates to try to execute: QMetaObject::invokemethod(gobj,"doLayout",Qt::QueuedConnection); But it had no effect on the currently displayed text. That has to be some less intrusive way to cause QML gui objects to repaint themselves. Any ideas instead of Loader:sourceComponent, which is very heavy and causes screen flicker. md On 9/11/2015 11:39 AM, m...@rpzdesign.com wrote: > Hello List: > > Anybody have ideas on how to cause a QML refresh to repaint a QML Window > or component. > > I tried setting the sourceComponent value of Loader but it causes a good > amount of screen flicker and has some of optimizations so it will not > reload the same component 2 times in a row, as if the componentCache is > absorbing the successive update requests. > > This problem is generally for Text { text : "English" } -> Text { text: > "Espanol" } language changes, but it could be for most anything. > > And its kind of a pain to consider having to recurse through a component > tree looking for a property an update it. > > Window()->findChildren()->setProperty() is one possibility. > > Some posts have talked about "notify" signal, but messing around with > slots for every GUI component seems incorrect. > > Any ideas? > > md > -- No spell checkers were harmed during the creation of this message. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest