Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.2k Posts
  • How to import QtQml.Models 2.1

    1
    0 Votes
    1 Posts
    960 Views
    No one has replied
  • QML sqlite question

    8
    0 Votes
    8 Posts
    4k Views
    L
    OK I will try your suggestion. Thank you all the same.
  • Bypassing binding loops

    3
    0 Votes
    3 Posts
    1k Views
    B
    What I've ended up with is @ Component.onCompleted: { width = modelData.duration * pixelSecondWidth x = modelData.seconds * pixelSecondWidth + 1 } Connections { target: modelData onDurationChanged: { if (!mouse.drag.active) { property.width = modelData.duration * pixelSecondWidth } } onSecondsChanged: { if (!mouse.drag.active) { property.x = modelData.seconds * pixelSecondWidth + 1 } } } onWidthChanged: { if(mouse.drag.active) modelData.duration = width / pixelSecondWidth } onXChanged: { if (mouse.drag.active) modelData.seconds = (x - 1) / pixelSecondWidth } @ I figure there must be a way to do this with Bindings somehow. May play around later. Thinking something like: @ Binding on width { when: mouse.drag.active; value: ...} @
  • 0 Votes
    3 Posts
    2k Views
    T
    Well it looks like my last post was deleted when the server went down last night, so let me sum it up. The problem was my javascript was originally in my QML file, in 'Component.onCompleted: {CODE WAS HERE}', in my javascript code I had a multiline quote such as this: @ Qt.createQmlObject(' DYNAMICALLY GENERATED QML GOES HERE ', parent, myObject); @ When I copied and pasted the javascript into it's own file I needed to escape the literal newlines such as this: @ Qt.createQmlObject(' DYNAMICALLY GENERATED QML GOES HERE ', parent, myObject); @ And that sums it up - _ -
  • ListView with Checkbox and FolderListModel

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Reimplementing keyPressEvent for TextInput?

    2
    0 Votes
    2 Posts
    1k Views
    A
    You can always create your own widget and export it to QML.... I don't think it is possible to reimplement functions on existing QML-Widgets etc...
  • Change states.

    5
    0 Votes
    5 Posts
    2k Views
    O
    “go out of state” is known "change from state1 to state2". in onStateChange() know state2, but not know state1. not need making other pages invisible because default value of PropertyChanges.restoreEntryValues is true.
  • Flickable and Button

    16
    0 Votes
    16 Posts
    5k Views
    T
    Question be solved,a ha...
  • Need help to make line graph in QML

    2
    0 Votes
    2 Posts
    2k Views
    sierdzioS
    Hey, let me google that for you: "link":http://lmgtfy.com/?q=qml+graph.
  • [SOLVED]Scroll issue in Qlistview

    13
    0 Votes
    13 Posts
    4k Views
    M
    Yes..Sure.Thanks a lot
  • [Solved] How to QML Graph layout ?

    6
    0 Votes
    6 Posts
    4k Views
    L
    Short example @ import QtQuick 2.0 Rectangle { width: 300 height: 200 color : "#ddf" ListView { anchors.fill: parent interactive: false model : ListModel { // nodes ListElement { nx:50; ny:100; } // node position is (nx, ny) ListElement { nx:150; ny:50; } ListElement { nx:250; ny:100; } ListElement { nx:150; ny:150; } } delegate : Item { x:0; y:0; width:0; height:0 // here is the "trick" Rectangle { x: nx; y:ny; width:10; height:10; radius: 5; border.color: "#113" MouseArea { anchors.fill: parent; drag.target: parent; } } } } } @
  • Problem with drag and drop in qtquick 2

    2
    0 Votes
    2 Posts
    2k Views
    C
    Here how I solve your problem... @import QtQuick 2.0 Rectangle { id: rootTarget width: 800 height: 800 DropArea { id: dragTarget1 property alias dropProxy: dragTarget1 width: 200; height: 200 y: 100; x: 100 Rectangle { id: target anchors.fill: parent color: "lightgreen" } states: [ State { when: dragTarget1.containsDrag PropertyChanges { target: target color: "green" } } ] } DropArea { id: dragTarget2 width: 200; height: 200 y: 400; x: 100 Rectangle { id: target2 anchors.fill: parent color: "lightgreen" } states: [ State { when: dragTarget2.containsDrag PropertyChanges { target: target2 color: "green" } } ] } Rectangle { id: debut width: 120; height: 120 x: 600; y: 600 color: "red" MouseArea { id: maDrag drag.target: carre width: 100; height: 100 anchors.centerIn: parent onReleased: { console.log('onReleased') parent = carre.Drag.target !== null ? carre.Drag.target : debut } Rectangle { id: carre color: "blue" width: 100; height: 100 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter Drag.active: maDrag.drag.active Drag.source: maDrag Drag.hotSpot.x: width/2 Drag.hotSpot.y: height/2 states: [ State { when: maDrag.drag.active PropertyChanges { target: carre opacity: 0.5 } ParentChange { target: carre parent: debut } AnchorChanges { target: carre; anchors.horizontalCenter: undefined; anchors.verticalCenter: undefined } } ] } } } }@
  • Some kind of GridView with groupable items and subheaders???

    5
    0 Votes
    5 Posts
    2k Views
    A
    GridView does not seem to handle visual grouping and sections as ListView does. On the other hand, laying items in a grid in a ListView might not be so straight-forward.
  • Need help to make a smooth animation

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • ReferenceError: Can't find variable: because area is overlapped

    9
    0 Votes
    9 Posts
    5k Views
    W
    Thanks. Yes, there is more code, not relevant to this issue. When I show all, it becomes hard to read/find the relevant code. Meanwhile I have made some more signal/functions. They all generate errors, but they do work. I have the feeling that is some kind timing problem. First, the variable cannot be found, and possibly it is instantiated or resolved just a split second later... But I am just guessing here.
  • QtMultimediaKit in Windows XP

    6
    0 Votes
    6 Posts
    2k Views
    J
    It works now, maybe a Windows restart was needed. Anyway thanks for your help.
  • Font Loading Issues on OSX Qt5.1 Beta Qt Quick 2.0

    6
    0 Votes
    6 Posts
    3k Views
    R
    Hey Thanks we can close this one as solved, I filed a bug report. Your right forums are bad places to post bugs. I will likely post if asking if someone gets similar behaviour and then file a bug report. Anyways heres the report if your interested I will likely post more bugs as I go along https://bugreports.qt-project.org/browse/QTBUG-31359 thanks again!
  • QQuickView fullscreen glitch OSX?

    5
    0 Votes
    5 Posts
    4k Views
    R
    Yeah got the same issue here
  • How to access v8's debug API in QJSEngine

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • how two connect two qml file using simple buttom

    11
    0 Votes
    11 Posts
    5k Views
    W
    Aha. So, I'll create one main.qml with the specific UI pages based on components and use visible as switch. Thanks.