Skip to content
  • 0 Votes
    10 Posts
    3k Views
    dheerendraD

    Boiler plate code which you are trying to implement is already taken care by Qt using Signals/Slots across threads. It is better to use tried & tested inbuilt mechanism. It is good with code maintainability & readability as well. Suggest to use signals/slots.

  • 0 Votes
    4 Posts
    743 Views
    J.HilkJ

    @diredko
    you can take a look at the Scalability section of the documentation

    The calculating scaling ratio section has an example that used to help me a lot when I first was confronted with this issue.

  • 0 Votes
    6 Posts
    2k Views
    J.HilkJ

    @MrCrackPotBuilder said in Detecting the removal of a screen and modifying the app accordingly.:

    Its also saying the same as before so I.m definitely going to have to use the QGuiApplication but how that i cant figure out... Yet

    you #include <QGuiApplication> in your class that than allows you access to the (unique) application instance pointer qApp than you can use that to update your Layout.

    QObject::connect(qApp, &QGuiApplication::screenCountChanged, this, &myClass::screenCountSlot);
  • Flexible layout

    Unsolved QML and Qt Quick
    1
    0 Votes
    1 Posts
    798 Views
    No one has replied
  • 0 Votes
    3 Posts
    2k Views
    cemaldemir07C

    QML ile birlik oldukça etkili layoutlar, görseller tasarlayabiliyorsun. Qt ile yapılan uygulamalarda,

    Mesela ben Samsung Galaxy A5 ve Samsung t562 tablet üzerinde aynı kodları geliştirmeye çalışıyorum. Logicaldpi ile işlerimi halletmeye çalışıyorum ancak henüz halledemedim. Tam Olarak sorunu çözemedim. Yalnız Şu var; Fontlarda Hiç bir sıkıntı çıkmıyor. Font Büyüklükleri Güzel çıkıyor ancak Bir button koyduğumda güzel A5te bunu tablete açtığım neredeyse ekranın yarsını kapyalayacak. sebebibini bilemedim. Bazı Hatalar olduğunu düşünüyorum Qt ile Çok fazla Büyüdüğü için Muhtemelen ama Bi eşdeğeri henüz yok bu kütüphanenin. Bu Arada ingilizceyi biraz geliştirirsen sana çok faydası olur.

  • 0 Votes
    3 Posts
    3k Views
    johngodJ

    One of the tricks I use is to set all dimensions in milimeters instead of pixels, something like this:

    property real mm: Screen.pixelDensity property real btnSize: 8 * mm Rectangle { width: btnSize height: btnSize }

    This, in a perfect world, would give you a rectangle with the same size in devices with different pixel density. But please note that Screen.pixelDensity is the QML version of the c++ QScreen.physicalDotsPerInch, wich according the docs:
    "This value represents the pixel density on the screen's display. Depending on what information the underlying system provides the value might not be entirely accurate". My experience shows that in laptops and screen monitors que values are very good, you can measure the screen with a ruler and check that the rectangle is 8mm, however I have had bad experiences in mobile android devices, probably because of poor screen/drivers quality. So I usually in my applications I do something like:

    property real calibrationFactor: 1.0 property real mm: Screen.pixelDensity * calibrationFactor

    where calibrationFactor is a value that the user can change in some Settins menu to "calibrate" the overall size of the buttons/elements of the app.

    Also there's more than this to do a one size fits all screens app. Usually there's a all lot of tricks like trying to find the screen dimension and loading different UI's at run time, or using flickable elements and listview elements that can scale up more or less ok with different screen sizes.

    ALso check this very interesting video https://www.youtube.com/watch?v=nNyhsdX6BsI&list=PLizsthdRd0YwgXOHoXxBrIEgBdzACclcg&index=3