Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • Pixel subtraction on a video : how to get a serie of images ?

    1
    0 Votes
    1 Posts
    611 Views
    No one has replied
  • TextInput frustration with the cursor

    1
    0 Votes
    1 Posts
    584 Views
    No one has replied
  • 0 Votes
    2 Posts
    886 Views
    D
    Hi, I developed my delegate this way to accomplish it ... @ Component { id: categoryDelegate Text { id: delText x: 25; color: ListView.isCurrentItem ? "white" : "red" text: name; font.family: openSansReg.name font.pointSize: 36 Behavior on color { ColorAnimation {duration: 200 }} } } @
  • My GridView won't select currentItem

    4
    0 Votes
    4 Posts
    1k Views
    D
    Thank you so much guys! It's working perfectly now.
  • Window width and height in QML

    5
    0 Votes
    5 Posts
    9k Views
    L
    maksim1979, it works fine for me: @import QtQuick 2.0 Rectangle { id: root; width: 256; height: 306; MouseArea { anchors.fill: parent onClicked: {console.log(root.width + " " + root.height)} } }@ So, even if width and height are set, showMaximized() will override that here and the correct width and height will be printed to the console. Sorry if I'm misunderstanding what you're trying to say. EDIT: I also don't think you'll need to create the dialog dynamically. If you don't need to move the dialog around, you can just set its anchors.centerIn: parent. If you do need to move it, then its x and y properties like this: @x: (root.width - dialog.width)/2 y: (root.height - dialog.height)/2@
  • These transitions are ignored

    2
    0 Votes
    2 Posts
    598 Views
    Q
    I failed to put the word opacity in quotes. problem solved.
  • [Solved] Singletons in 5.2

    5
    0 Votes
    5 Posts
    3k Views
    M
    The approach that is described here http://qt-project.org/forums/viewthread/34680 works for me, but I don't like that fact that I have to to use absolute path to qml file.
  • QML Object reference question

    1
    0 Votes
    1 Posts
    689 Views
    No one has replied
  • [SOLVED] Changing model property of ListView during animation

    7
    0 Votes
    7 Posts
    2k Views
    D
    Hi, I removed PropertyAction line and used this instead .. @ScriptAction { script: listView.model = model2; }@ That seems to work! thnx
  • [Closed("Solved")]QQuickView Object Property

    1
    0 Votes
    1 Posts
    773 Views
    No one has replied
  • 'L' Shaped Enter Button

    3
    0 Votes
    3 Posts
    1k Views
    J
    I think the easiest solution is just to combine two MouseAreas: @ import QtQuick 2.0 Rectangle { width: 360 height: 360 color: "lightgray" Item { id: button width: 60 height: 60 anchors.centerIn: parent readonly property color color: mouse1.pressed || mouse2.pressed ? "gray" : "white" signal clicked onClicked: print("button clicked") Rectangle { width: 30 height: 60 color: button.color MouseArea { id: mouse1 anchors.fill: parent onClicked: button.clicked() } Rectangle { width: 60 height: 30 color: button.color anchors.bottom: parent.bottom MouseArea { id: mouse2 anchors.fill: parent onClicked: button.clicked() } } } } } @ If you need a button of arbitrary shape, you can also filter the click in the MouseArea:onPressed function and for instance only accept the event if it is inside a certain shape.
  • [Solved] Application crash when updating the text of a label.

    4
    0 Votes
    4 Posts
    2k Views
    O
    It's allright, im glad that i could help. Please add a [Solved] in front of the topic of this thread, thank you.
  • High-dpi Image item

    2
    0 Votes
    2 Posts
    1k Views
    O
    Hey, i never worked with high-res images in QML, but it actually should display it in high-res. I can't see a reason why it should not work. For example: if you've got an image with the resolution of 2560*1440 and you set an QML Image to its size: @Image { width: 2560; height: 1440 source: "image.jpg" }@ then it actually should display it in this resolution. The real size of the image(the size which it would be on --your display) depends on your display resolution.
  • [SOLVED] TextFieldStyle messes up TextField.baseline, workaround?

    2
    0 Votes
    2 Posts
    891 Views
    J
    I verified the issue. Modifying Base/TextFieldStyle.qml to add <code> real baselineOffset: control.__contentHeight <code> in the definition of the "panel" item might be a workaround until we have a proper fix in place.
  • How to replace setInterval

    7
    0 Votes
    7 Posts
    8k Views
    H
    I am a complete newbie in QT/QML but I was doing something recently, and came with that solution. In your specific QML file which can be named "setInterval.qml" : @Timer { interval: 100; //ms running: true; repeat: true; signal onTriggeredState; onTriggered: onTriggeredState(); } @ then in the javascript file you can do: @ var timer = Qt.createQmlObject("setInterval.qml", attachedToObject); var ctx = Qt.createComponent(timer); timer.onTriggeredState.connect( (function() { console.log('foobar');})()); @ Of course you can add this to your logic methods or constructors for reuse. It worked for me.
  • [Solved]Element Template

    8
    0 Votes
    8 Posts
    2k Views
    O
    Yeah currently reading, thank you.
  • Registering Singleton vs Context Property

    4
    0 Votes
    4 Posts
    5k Views
    M
    Thank you very much for your answers, gentlemen.
  • 0 Votes
    3 Posts
    1k Views
    C
    See http://qt-project.org/doc/qt-5.0/qtquick/qtquick-visualcanvas-topic.html#visual-parent for more information about this. The short answer is that there are two different "parenting" concepts in QtQuick (object ownership parenting, and visual item parenting). In most cases, the visual item parent is also the object ownership parent, but there are cases where they can be different. Cheers, Chris.
  • [Solved]Unable to listen to port

    6
    0 Votes
    6 Posts
    5k Views
    dheerendraD
    ooops. You should not have both. May complete posting of the code would helped. It is good that is solved now. Happy ending. Enjoy
  • Item {} to QImage

    1
    0 Votes
    1 Posts
    521 Views
    No one has replied