<div dir="ltr"><div>It works. I forgot to add slot to the header file and it wasn't connected :><br></div><div>What a shame...<br></div><div><br></div><div>Sorry for the trouble.</div><div>W.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-24 13:18 GMT+02:00 ekke <span dir="ltr"><<a href="mailto:ekke@ekkes-corner.org" target="_blank">ekke@ekkes-corner.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Am 24.06.16 um 13:03 schrieb Wiktor
      Grębla:<br>
    </div><span class="">
    <blockquote type="cite">
      <div dir="ltr"><span style="font-size:12.8px">Thanks for your
          reply Ekke.</span>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">I've tried <a href="https://wiki.qt.io/QML_orientation_observer" target="_blank"></a><a href="https://wiki.qt.io/QML_orientation_observer" target="_blank">https://wiki.qt.io/QML_orientation_observer</a> and
          it works in QtQuick. <br>
        </div>
      </div>
    </blockquote></span>
    for qml I'm doing it this simple way:<br>
    <br>
    
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#800080">ApplicationWindow</span><span style="color:#c0c0c0"> </span>{</pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#800000">id</span>:<span style="color:#c0c0c0"> </span><span style="font-style:italic;color:#000000">appWindow</span></pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#008000">// ... </span></pre>
    <pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">property</span><span style="color:#c0c0c0"> </span><span style="color:#808000">bool</span><span style="color:#c0c0c0"> </span><span style="color:#800000">isLandscape</span>:<span style="color:#c0c0c0"> </span>width<span style="color:#c0c0c0"> </span>><span style="color:#c0c0c0"> </span>height</pre>
    <br>
    and from C++ orientationChanged() SIGNAL also works<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div style="font-size:12.8px">No luck so far in QtWidgets.</div>
      </div>
    </blockquote></span>
    never done anything with Widgets<span class="HOEnZb"><font color="#888888"><br>
    <br>
    ekke</font></span><div><div class="h5"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">W.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2016-06-24 12:31 GMT+02:00 ekke <span dir="ltr"><<a href="mailto:ekke@ekkes-corner.org" target="_blank">ekke@ekkes-corner.org</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>just did a short test (Qt 5.7, QuickControls2 APP)<br>
                <br>
                tested Android 6.0.1 on BlackBerry PRIV:<br>
                orientation change works between Portrait and Landscape<br>
                but from Landscape to InvertedLandscape or from
                InvertedLandscape to Landscape there was no signal<br>
                for me no problem - don't have to distinguish<br>
                InvertedPortrait couldn't be tested because my device
                doesn't allow this<br>
                <br>
                tested on iOS 9.3 (iPhone 6s)<br>
                all signals are coming in<br>
                <br>
                ciao<br>
                <br>
                ekke<br>
                <br>
                Am 24.06.16 um 11:40 schrieb Wiktor Grębla:<br>
              </div>
              <blockquote type="cite">
                <div>
                  <div>
                    <div dir="ltr">Hi guys.
                      <div><br>
                      </div>
                      <div>I've been trying to use orientationChanged
                        signal to react on orientation changes but
                        somehow can't get it to work. </div>
                      <div><br>
                      </div>
                      <div>I've seen some old threads with similar
                        reports (Qt-5.3) but I'm more keen to believe
                        that I'm doing something wrong rather than it's
                        not working.</div>
                      <div><br>
                      </div>
                      <div>I've tried it on Qt-5.6 and now on Qt-5.7:</div>
                      <div><br>
                      </div>
                      <div>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"mainwindow.h"</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"ui_mainwindow.h"</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><QScreen></span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">MainWindow</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">MainWindow</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">QWidget</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">parent</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">QMainWindow</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">parent</span><span style="color:rgb(0,0,0)">),</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,128,0)">new</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Ui</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">MainWindow</span><span style="color:rgb(0,0,0)">)</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span>setupUi<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,128,0)">this</span><span style="color:rgb(0,0,0)">);</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">QScreen</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">screen</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span>QGuiApplication<span style="color:rgb(0,0,0)">::</span>primaryScreen<span style="color:rgb(0,0,0)">();</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">connect</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">screen</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">SIGNAL</span><span style="color:rgb(0,0,0)">(</span>orientationChanged<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ScreenOrientation</span><span style="color:rgb(0,0,0)">)),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">SLOT</span><span style="color:rgb(0,0,0)">(</span>onRotate<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ScreenOrientation</span><span style="color:rgb(0,0,0)">)));</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">screen</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">setOrientationUpdateMask</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">PortraitOrientation</span><span style="color:rgb(0,0,0)">|</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">LandscapeOrientation</span><span style="color:rgb(0,0,0)">|</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">InvertedPortraitOrientation</span><span style="color:rgb(0,0,0)">|</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">InvertedLandscapeOrientation</span><span style="color:rgb(0,0,0)">);</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">MainWindow</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">onRotate</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">Qt</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ScreenOrientation</span><span style="color:rgb(0,0,0)">)</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">-></span>label<span style="color:rgb(0,0,0)">-></span>setText<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Rotated!"</span><span style="color:rgb(0,0,0)">);</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">MainWindow</span><span style="color:rgb(0,0,0)">::~</span><span style="font-style:italic;color:rgb(0,0,0)">MainWindow</span><span style="color:rgb(0,0,0)">()</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">delete</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">ui</span><span style="color:rgb(0,0,0)">;</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre>
                        <pre style="margin-top:0px;margin-bottom:0px">I'll be grateful for any hints or suggestions.</pre>
                        <pre style="margin-top:0px;margin-bottom:0px">Cheers,</pre>
                        <pre style="margin-top:0px;margin-bottom:0px">W.</pre>
                        <div><br>
                        </div>
                        -- <br>
                        <div data-smartmail="gmail_signature">Talkers
                          are no good doers.<br>
                        </div>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
Android-development mailing list
<a href="mailto:Android-development@qt-project.org" target="_blank">Android-development@qt-project.org</a>
<a href="http://lists.qt-project.org/mailman/listinfo/android-development" target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a>
</pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Android-development mailing list<br>
<a href="mailto:Android-development@qt-project.org">Android-development@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/android-development" rel="noreferrer" target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Talkers are no good doers.<br></div>
</div>