<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.size
        {mso-style-name:size;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-AU" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Ah… it might have something to do with the fact that the engine (and context, etc.) are destroyed in the meantime, and callLater being called from QML. The QML team would know more
 about that. So I guess you have to stick to delaying the call in C++.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Interest <interest-bounces@qt-project.org> on behalf of randomslap--- via Interest <interest@qt-project.org><br>
<b>Date: </b>Wednesday, 15 June 2022 at 18:04<br>
<b>To: </b>Interest <interest@qt-project.org><br>
<b>Subject: </b>Re: [Interest] QML Runtime Style Change<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">  Thank you Mitch! But about the latter, I tried it out by basically 1. getting rid of styleChange, 2. writing the line of code you mentioned but calling doStyleChange and 3. making doStyleChange Q_INVOKABLE.<br>
<br>
  At first the window opens, I also change the style once but on the second try it produces a segmentation fault (core dumped). Maybe I need to change more code. I also tried adding engine->exit(0); before deleting. The difference is that now it will produce
 the fault on the first try to change style.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">    Perhaps I should consider not using this program's concept. It's pretty faulty and may not work on whole environment. Thanks for the advice, again.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Jun 15, 2022, 06:04 by mitch.curtis@qt.io:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #93A3B8 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">> The program will not maintain the same position between window re-appearances.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">If by position you mean window position, you can use Settings to store it:</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"><a href="https://doc.qt.io/qt-6/qml-qt-labs-settings-settings.html#details" target="_blank">https://doc.qt.io/qt-6/qml-qt-labs-settings-settings.html#details</a></span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">> I'd also like to ask, is there any way to get rid of the "special"  class function used only to invoke the other function? It
 really sounds like something that can be improved.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">If you mean the invokable that does a queued invoke of doStyleChange, you could probably shift it to QML instead:</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    onClicked: Qt.callLater(function() { App.styleChange(text); })</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">So you could merge doStyleChange into styleChange, but you still need the queued call.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span class="size"><b><span style="font-size:12.0pt;color:black">From:
</span></b></span><span class="size"><span style="font-size:12.0pt;color:black">Interest <interest-bounces@qt-project.org> on behalf of randomslap--- via Interest <interest@qt-project.org></span></span><span style="font-size:12.0pt;color:black"><br>
<span class="size"><b>Date: </b>Wednesday, 15 June 2022 at 03:09</span><br>
<span class="size"><b>To: </b>Interest <interest@qt-project.org></span><br>
<span class="size"><b>Subject: </b>[Interest] QML Runtime Style Change</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">Hello again</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    IMPORTANT: This mail is an UPDATE to the "Change QML Application Style on Runtime" mails.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">I should also note I run on GNOME Wayland sessions.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    I finally managed to create a stupidly small application which is able to change to a whole different style only by renewing
 the QML engines. I send an image that shows all the code used as well as the app running and a compressed file containing all relevant files.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">-> What was the problem:</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    Indeed there a was a need for a queued connection as it was suggested but that wasn't causing the warning at that time. It
 was rather the engine probably causing weird reactions. The solution was to simply change the engine to a pointer and delete and re-new every time I want to change the app's style. Also, the .close() function was causing a Wayland protocol fatal error but
 when I removed '()' it didn't complain. The engine.exit(0); might also not be necessary.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">-> Important notes:</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    The program will not maintain the same position between window re-appearances. Items that are not bound by C++ data won't also
 maintain their states between re-appearances either.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    I just hope I can still reach a point to implement my idea even in a compositor and solve the above problems. I also hope memory
 is not leaking but I did not catch any related processes on my system monitor ( maybe I missed something ).</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">    I'd also like to ask, is there any way to get rid of the "special"  class function used only to invoke the other function?
 It really sounds like something that can be improved.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt"> </span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="size"><span style="font-size:11.0pt">Thank you for helping me. I'd appreciate any ideas to improve this "concept" if possible.</span></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>