Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • ListView with flow layout

    3
    0 Votes
    3 Posts
    1k Views
    O
    So I'm trying this in a GridView, where I show previews of photos (Image element in delegate). I'm testing on a set of 433 photos. My test application with GridView consumes 1.5 GB directly after start. Which is weird, because QAbstractItemModel::data() in my model is called only for a couple of first items after start (then again when GridView is scrolled).
  • [SOLVED] UTF-8 and special character decoding

    8
    0 Votes
    8 Posts
    4k Views
    sierdzioS
    Great, thank you for sharing!
  • VXYModelMapper Example for chart

    6
    0 Votes
    6 Posts
    3k Views
    M
    I set up a quick example to keep it simple: @ import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 import QtQuick.Particles 2.0 import QtQuick.Layouts 1.1 import QtCharts 2.0 Rectangle { anchors.fill: parent ListModel { id: testModel ListElement { x: 0; y: 10 } ListElement { x: 1; y: 11 } ListElement { x: 2; y: 14 } ListElement { x: 3; y: 10 } ListElement { x: 4; y: 11 } ListElement { x: 5; y: 17 } ListElement { x: 6; y: 14 } ListElement { x: 7; y: 13 } ListElement { x: 8; y: 10 } } ChartView { anchors.fill: parent antialiasing: true SplineSeries { VXYModelMapper { id: mapper model: testModel /*myModel*/ // QAbstractItemModel derived implementation // series: spline // firstRow: 1 xColumn: 0 yColumn: 1 Component.onCompleted: console.log("loaded VXYModelMapper: xColumn " + mapper.xColumn + " yColumn " + mapper.yColumn) } } } } @ The example just works if I set the xColumn and yColumn property to 0. If I set the properties to 0 the Mapper just use the second values (in this example the y values) all time long... Any ideas?
  • error in SignalSpy

    1
    0 Votes
    1 Posts
    353 Views
    No one has replied
  • TextField within ListView

    4
    0 Votes
    4 Posts
    1k Views
    T
    Hi, Your delegates have access to a special property "index". I refer to the link below for more explanation. https://qt-project.org/doc/qt-5-snapshot/qtquick-modelviewsdata-modelview.html#models But if you do something like, you can see it: @ onValueChanged: { console.log("index = " + index) } @ Changing the value of the model can be done like so: @onAccepted: {console.log("accepted"); myModel.set(index, {...})}@ Also ListView has a currentIndex and currentItem property if you need those. Good luck!
  • [SOLVED] Size of text is different on Windows OS and Mac OS

    14
    0 Votes
    14 Posts
    12k Views
    X
    I am not sure if you can even do that, certainly not with Qt functions at the moment. You have to use your own Java classes and read values from there if that is possible with Android (I guess it is, never tried it myself) and then access it via JNI.. but that is not very easy to do from QML, even with some helper classes Qt provides for JNI support. :/
  • QAbstractVideoSurface with QOpenGLTexture

    1
    0 Votes
    1 Posts
    737 Views
    No one has replied
  • [SOLVED] Exception when closing the program during an animation

    4
    0 Votes
    4 Posts
    1k Views
    sierdzioS
    That is good news. Happy coding! :-)
  • [SOLVED] Disable/Enable CheckBox

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    That's not a stupid question, it's a beginner one plus I've missed the fact that you where asking for QtQuick ;) Happy coding !
  • Qt Quick (QML) GridView with different cell size

    1
    1 Votes
    1 Posts
    1k Views
    No one has replied
  • Bear cannot move in sprite, Help !!

    1
    0 Votes
    1 Posts
    448 Views
    No one has replied
  • Android: Modulus returns NaN

    1
    0 Votes
    1 Posts
    577 Views
    No one has replied
  • Focus and FocusScope

    1
    0 Votes
    1 Posts
    559 Views
    No one has replied
  • Error: Tracer is not a type in Quick.Particles(solved)

    2
    0 Votes
    2 Posts
    2k Views
    sierdzioS
    Indeed, this type is no part of Qt. I suspect it is a custom element created for the purpose of that book - to show the parent item (notice the green rectangle in the picture). Please search the book for more information about it. Most probably it is something simple like: @ // Tracer.qml Rectangle { anchors.fill: parent } @
  • Dashboard

    2
    0 Votes
    2 Posts
    799 Views
    J
    sorry could be with the member function QWindow::QWindow(QWindow * parent)? but how i coul limit the position of this window to the parent area window?
  • Listview delgate signal and C++

    3
    0 Votes
    3 Posts
    2k Views
    A
    Thank you very much for this perfect answer. However I would like to use a solution like this: The delegate is composed by: @Component{ id: song_Tab_Delegate Rectangle { id: itemDelegate property string arg: Filename //sets by list model .... MouseArea { anchors.fill: parent onClicked: { song_Tab_Delegate.ListView.view.currentIndex = index } ..... @ I've make a itemClick(string) signal in library_page, then in the listview i inserted @onCurrentIndexChanged: { if(currentIndex>=0) library_page.itemClick(currentItem.itemDelegate.arg) }@ But it doesn't find currentItem.itemDelegate. What is wrong? Thanks a lot Regards Andrea EDIT: I've solved the issue was that I had to write currentItem.arg. Well done for your book
  • [SOLVED] Problem with macdeployqt on Qt 5.4 RC

    5
    0 Votes
    5 Posts
    20k Views
    C
    Hey shav, that worked. Thanks!
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • Opengl underlay

    7
    0 Votes
    7 Posts
    3k Views
    sajis997S
    It will be fun then. Here goes the link to the repository: https://sajis997@bitbucket.org/sajis997/teapottessellationqt.git I am using Qt 5.2 with QtCreator 3.0.1 at ubuntu 14.04 at my end. Thanks
  • 0 Votes
    1 Posts
    453 Views
    No one has replied