[EN] QtQuick Window default height

In this article I will describe a behavior that is not described in the Qt documentation I read. I used Qt 5.10.1 on an up-to-date Windows 10 system.

When using the Window QtQuick type, the default height of it is 0 and when its property named „visible” is set to true, the height gets transformed into 160 as it is visible. Even if you manually set the height of the Window to 0, when it becomes visible, it still gets transformed into 160. When using another value for height, such as 10, the value is not changed when the Window is shown.

Code:

import QtQuick 2.10
import QtQuick.Window 2.10

Window {
    visible: true

    height: 0
    onHeightChanged: console.log("height", height);
}


Lasă un răspuns

Completează mai jos detaliile tale sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare /  Schimbă )

Fotografie Google

Comentezi folosind contul tău Google. Dezautentificare /  Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare /  Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare /  Schimbă )

Conectare la %s

%d blogeri au apreciat: