Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Camera

    2
    0 Votes
    2 Posts
    652 Views
    SGaistS
    Hi and welcome to devnet, You should add what OS/Qt version you are running and which board your using
  • How to replace text with picture

    2
    0 Votes
    2 Posts
    568 Views
    A
    solved it by handling from model. added new role (bool) to display text or image.
  • 0 Votes
    7 Posts
    5k Views
    T
    Thank you for your answer!!! You suggestion does not work for me. I'm using Qt 5.3.2. And I've found another way to fix it) The problem was caused in [code] flickable.contentHeight - flickable.height [/code] As my flickable element that is passed to the scrollbar is a child element of Item with its own height and width, I made an additional [code] property int flick_width; [/code] in my ScrollBar.qml. So I've just replaced flickable.height by flick_width.
  • Connections to attached signal

    3
    0 Votes
    3 Posts
    918 Views
    P
    Dear JKSH! Thanks for your advice! I did the same for now and it works. I develop some application framework, and it is good for me to catch this signal directly, because in other way I have to ask users to implement that custom signal. In my situation, we control the base object, "MyWindow". So I put that custom signal there. It looks almost same as onCompleted in MyWindow user's descendant.
  • [solved] sqlite database location

    8
    0 Votes
    8 Posts
    3k Views
    SGaistS
    You're welcome ! That's what Qt does ;) Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)
  • [SOLVED] QML Text position versus Adobe Photoshop text position

    8
    0 Votes
    8 Posts
    3k Views
    X
    I just found the way to do it thanks to a new feature of Qt 5.4 : QtQuick.TextMetrics element With TextMetrics::tightBoundingRect property we can get the same bounding box that Photoshop is based on and with TextMetrics::boundingRect property we get the bounding box that Qt use to position the Text element. With these two informations we can now compute the right horizontal & vertical offset we need to match exactly the position on Photoshop. To encapsulate the conversion we can create a custom Qml Component based on QtQuick.Text for instance: @<PhotoshopText.qml> import QtQuick 2.4 Text { id: root property real xPS: 0 property real yPS: 0 // convert from Photoshop coordinates to Qt coordinates x: xPS - textMetrics.tightBoundingRect.x y: yPS - (textMetrics.tightBoundingRect.y - textMetrics.boundingRect.y) TextMetrics { id: textMetrics font: root.font text: root.text } } @ Now we can use this new component to position any text with Photoshop coordinates: @<main.qml> import QtQuick 2.4 Item { PhotoshopText { text: "Hello world!" xPS : <x value extracted from Photoshop> yPS : <y value extracted from Photoshop> } } @ Thanks @Juergen for your help on this issue, you put me into the right direction ;) I can now finalize my PSD => QML converter :D Best regards Krys
  • Can I use action to tie 2 buttons?

    1
    0 Votes
    1 Posts
    472 Views
    No one has replied
  • How to seperate QML components

    7
    0 Votes
    7 Posts
    1k Views
    A
    i got it, thank you a lot :-)
  • In QML, QLabel: no such file or directory (solved)

    3
    0 Votes
    3 Posts
    3k Views
    R
    Are you trying to create the GUI in QML and asking what you use instead of a QLabel? In QML you could just use a Text object for a label. It's hard to know exactly what you're doing when you say "move a class ... to Qt QML". If you're new to QML you might benefit from my my latest Pluralsight course on "Qt Quick Fundamentals":bit.ly/qtquickfun on Pluralsight. Pluralsight is a subscription service but if you send me an email through the forum I can give you a free week long VIP pass good for unlimited hours of watching, including offline.
  • [SOLVED] Scrollview on android device

    6
    0 Votes
    6 Posts
    3k Views
    p3c0P
    +1 Jens for the exact solution.
  • 0 Votes
    3 Posts
    2k Views
    U
    What worries me is the fact the echo() slot is never triggered. Not even as the application is closed. This leads me to believe such objects returned to QML are practically leaking, and I am not a big fan of believing somehow this is not the case. I don't like memory leaks. And somehow QML seems to be full of those. I've already encountered situations where QML doesn't release resources and memory usage climbs to hundreds of MB and never drops down.
  • How can I set center anchors for ScrollView property "contentitem"?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Pixel perfect with scaling

    2
    0 Votes
    2 Posts
    1k Views
    V
    Hi, I can not reproduce your issue. Could you elaborate little bit more. It would be perfect if you could show the exact code that shows the problem. @ Item { x: 200 y: 200 width: 200 height: 200 scale: 2 Rectangle { border.color: "black" border.width: 2 anchors.fill: parent } Rectangle { id: item1 x: 10 width: 5 height: 100 color: "red" Rectangle { x: /*item1.x +*/ item1.width width: 5 color: "green" height: 100 } } } @ This didn't show any gaps. Do you have rotations on your items and/or are they Images?
  • [SOLVED ] Using (empty) TextFieldStyle alters size of the TextField

    5
    0 Votes
    5 Posts
    1k Views
    K
    I marked the tread as SOLVED, as the problem is now understand. Would still be interesting to know if this behavior s intended or not, might be the Mailing List will answer this.
  • QML interface not fully initialised when main window is shown

    3
    0 Votes
    3 Posts
    937 Views
    C
    Unfortunately creating a sample application won't be possible because the application is quite complex. For now I am using a sleep() just before showing the application.
  • Calling QML functions from C++ [SOLVED]

    12
    0 Votes
    12 Posts
    11k Views
    N
    Problem is finaly solved!
  • Issue with qml files and designer tab of QtCreator of Qt5.4mingwRC1

    1
    0 Votes
    1 Posts
    522 Views
    No one has replied
  • VideoOutput and Camera never ready

    1
    0 Votes
    1 Posts
    961 Views
    No one has replied
  • Memory management of objects handed back to QML

    6
    0 Votes
    6 Posts
    6k Views
    U
    [quote author="chriadam" date="1332833133"]QML already does this. A QObject which is returned to QML from an invokable function as a return value has its ownership semantics set to JavaScriptOwnership if it has not previously been explicitly set to CppOwnership. [/quote] How does this work considering QObject can't be returned by value?
  • What is the "Qt Quick Compiler build tool"

    3
    0 Votes
    3 Posts
    5k Views
    J
    To summarize: The compiler adds the option of letting you compile QML and javascript into efficient C++ code, giving you the option of more effectively hiding/obfuscating your QML in commercial applications and improving the initial startup time of QML applications as it takes away the compilation step at runtime. It does not affect what is currently available in the open source edition.