Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.7k Posts
  • Qml ListView full page smooth transition

    Unsolved
    1
    0 Votes
    1 Posts
    833 Views
    No one has replied
  • Context property function calls and threading

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    MonomixM
    Thanks for the responses - really good info. Think I'll investigate the QML worker thread option.
  • 0 Votes
    3 Posts
    4k 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
  • QQmlListProperty append function called with incomplete object

    Unsolved qml listproperty
    1
    0 Votes
    1 Posts
    459 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Why the type NumberAnimation on x don't work when i change it?

    Solved
    2
    0 Votes
    2 Posts
    573 Views
    stackprogramerS
    i concluded that we should define a property like fg in NumberAnimation and we have property int fg:menuspiral.width/3 in type Window now it works. NumberAnimation on x { property int fg duration:2000 loops: Animation.Infinite running:true from: 0; to:fg }
  • PinchArea and dragging

    Unsolved
    2
    0 Votes
    2 Posts
    579 Views
    N
    Okay, so nobody knows what are the drag and minimumXY properties are for in the PinchArea... but does somebody know where to get more information on how to use them?! Thanks nx7z
  • 0 Votes
    11 Posts
    5k Views
    R
    @SGaist OS X 10.10 and Win 10
  • QQuickitemLayer and textureProvider

    Unsolved
    1
    0 Votes
    1 Posts
    499 Views
    No one has replied
  • Trying to use FontMetrics in own Item

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    speqtrS
    Sorry for misunderstanding. Can you try this one as a MyField? TextInput { id: myField width: (maximumLength + 1) * fm.averageCharacterWidth height: fm.height + 4 maximumLength: 10 selectByMouse: true clip: true FontMetrics { id: fm font: myField.font } } In this case setting font.pixelSize should work perfectly fine. MyField { font.pixelSize: 14 } Sorry for misleading you in a first place.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    43 Views
    No one has replied
  • Poor performance problem

    Unsolved
    2
    0 Votes
    2 Posts
    834 Views
    SGaistS
    Hi, Why not use QFileSystemModel ? It's designed to browse a file system and is threaded to avoid blocking the GUI thread.
  • WebView on OS X

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    SGaistS
    Hi, It's the QtWebView module that offers a wrapper around OS X, iOS and Android web views.
  • Why can't I use ternary operator with onClicked

    Unsolved qml quick
    3
    0 Votes
    3 Posts
    6k Views
    SGaistS
    Hi, There's a conversion done when you set the color property thus currently what you are doing is comparing a color with a string. The solution is: background.color = Qt.colorEqual(background.color, "steelblue") ? "purple" : "steel blue"
  • On-the-fly font substitution is awesome! How to turn it off?

    Unsolved
    1
    0 Votes
    1 Posts
    647 Views
    No one has replied
  • Error: module “QtQuick” is not installed in Android

    Solved
    2
    0 Votes
    2 Posts
    615 Views
    A
    It is solved with Qt 5.5. I do not found this issue in Qt 5.5
  • TextArea with QtRendering? [solved]

    Unsolved
    2
    0 Votes
    2 Posts
    612 Views
    David.GD
    To answer my own question (had more or less an idea on how to solve it just needed to put it in practice). The right way to do it is just styling TextArea. Please refer to http://doc.qt.io/qt-5/qml-qtquick-controls-styles-textareastyle.html The dirty way and not so recommended way as the inners of TextArea could change : // Suppose we have a textarea TextArea { id: mytextarea Component.onCompleted: { mytextarea.__style.renderType = Text.QtRendering; } }
  • Property binding or how to get new Java Script object in QML

    Unsolved
    1
    0 Votes
    1 Posts
    360 Views
    No one has replied
  • Undecorated Window

    2
    0 Votes
    2 Posts
    2k Views
    D
    Hi, I know a way to do so from both QML and C++ Window { width: 800 height: 600 flags: Qt.FramelessWindowHint // This is the part which makes your window undecorated minimumWidth: 800 minimumHeight: 600 visible: true } In C++ code you would use setFlags function. Hope this helps)
  • Urgent!! Unable to create and insert values into database

    Unsolved
    14
    -1 Votes
    14 Posts
    3k Views
    SGaistS
    Again, check the return value of exec and print the content of errorString if the query failed. That will give hints about what is going on.