Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • ProgressBar doesn't redraw until function returns control

    4
    0 Votes
    4 Posts
    3k Views
    A
    Make sure the intensive C++ code runs in a separate thread then?
  • QML ListView and QSqlTableModel

    3
    0 Votes
    3 Posts
    4k Views
    L
    OK, maybe I should start with easier questions. What kind of QML type is the name of the column that I'm sending to the delegate - variant or string? Also, where is the variable visible - only in the delegate, in the file that contains the delegate and ListView or elsewhere as well? I can't make other files see it and I don't know why. This prevents me from making my ListBox a generalized component. As it stands, I would have to make three different ListBox "classes" with the only difference being the data they pull from the database. There has to be a better way to do this, but how? Could I do it from C++ and how would I go about doing that? Any pointers in the right direction would be really welcome. Cheers, Lucijan
  • Qt Assistant print selection

    1
    0 Votes
    1 Posts
    746 Views
    No one has replied
  • Trigger several overlaping sounds .

    1
    0 Votes
    1 Posts
    645 Views
    No one has replied
  • 0 Votes
    3 Posts
    4k Views
    T
    Thank you, you're amazing :D myGrid.model = myModel; was all I needed, and I don't know why I didn't think of trying that, it just makes sense when I saw it in your post. And I actually was making my ListModels and GridViews as arrays, I just posted a very very simplified version of what I'm doing, and I thought of having separate QML files for my dynamic objects, but the way I'm making it this made the most sense, I need to be able to add variables, like so: @ //Pretend this is inside a Qt.createQmlObject() '//MyDynamicQmlStuff' + i + '//MyDynamicQMLStuffContinued' @ The way I'm creating my app having these components dynamically created is crucial (at least in my head :P ), it's not too difficult though, I just get stuck on these simple little things.
  • MapObjectView is not recognised as a type

    1
    0 Votes
    1 Posts
    599 Views
    No one has replied
  • How to import QtQml.Models 2.1

    1
    0 Votes
    1 Posts
    969 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
    3k 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