Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • [solved] Registering an ENUM in QML

    3
    0 Votes
    3 Posts
    4k Views
    J
    Xander84, your sample about enumerations it has been very useful. To access to the enumerated value is done in the same way as accessing to a property. Test { testEnum: Test.One } Joaquim Duran
  • Dragging between separate windows in Qml

    1
    1 Votes
    1 Posts
    2k Views
    No one has replied
  • Image with radius in QML

    13
    0 Votes
    13 Posts
    26k Views
    A
    [quote author="Brexis" date="1397022356"]Hi you can use an "OpacityMask":http://qt-project.org/doc/qt-5/qml-qtgraphicaleffects-opacitymask.html. Use a rounded image and mask your image with it.[/quote] Yes, that is a good solution!
  • Downloading qml files on Android and dynamically use them with QtQuick

    3
    0 Votes
    3 Posts
    1k Views
    D
    Thanks, I'll try that and hope that the Loader can find the downloaded files :) Edit: Ok, I have downloaded the qml file and now I know where it is saved: "/data/data/org.qtproject.example.MyApp/files" So it is placed into the private app directory. But how can I access this qml file now from my qml application?
  • How to structure qml app with several canvas/screens

    2
    0 Votes
    2 Posts
    921 Views
    J
    You can dynamically load and unload content. I use a mouse area that triggers a javascript function. That function uses "Qt.createComponent" to load a qml file.
  • Building a dynamic namespace for qml files (Qt.createQmlObject)

    1
    0 Votes
    1 Posts
    580 Views
    No one has replied
  • Running tests for key events in the background

    1
    0 Votes
    1 Posts
    560 Views
    No one has replied
  • QML Multimedia Key event

    1
    0 Votes
    1 Posts
    668 Views
    No one has replied
  • Changing width and height

    3
    0 Votes
    3 Posts
    936 Views
    1
    Works! Thank you :)
  • Q_PROPERTY NOTIFY during initialization race condition?

    13
    0 Votes
    13 Posts
    5k Views
    U
    This is frustrating because this is a significant problem for me. In the cases were this fails I can see that QML has already called the property accessor so QML should have connect all signals and slots so I don't feel I'm emitting a signal at an inappropriate time.
  • Camera based QML element

    1
    0 Votes
    1 Posts
    747 Views
    No one has replied
  • How to access listview current item from other item?

    7
    0 Votes
    7 Posts
    9k Views
    X
    hey, I modified your code a little look at this: @ //:D import QtQuick 2.0 Rectangle { id: root; height: 500; width: 500; Column { ListView { id: lv; height: 400; width: root.width; clip: true; orientation: ListView.Horizontal snapMode: ListView.SnapOneItem;// added new :D model: ListModel{ id: model; ListElement{ name :"1"; } ListElement{ name :"2"; } ListElement{ name :"3";} ListElement{ name :"4";} } delegate: com; } Text { id:txt; height:100; width:root.width; text: lv.currentItem.name; // now you can use currentItem.name to access the property of the delegate } } Component { id: com; Rectangle { id: rec property alias name: rectext.text // added this property alias to access the text of the current list item height: 400; width: root.width; Text { id: rectext; anchors.centerIn: parent; text: model.name; } MouseArea { anchors.fill: parent onClicked: { lv.currentIndex = index // you used listView.currentIndex here? } } } } } @ I've added a property to access the text and your MouseArea to the delegate, that works fine and you can use it, see my comments in the code. Might not be perfect because it only changes the index if you click on the item, not on you drag/swipe it, but that is another problem for now I think.. maybe you find a solution to that.
  • Draw ellipse in Qt5 (porting QPainter functionalities using QSG* classes)

    4
    0 Votes
    4 Posts
    2k Views
    X
    Well yes as far as I know the complete Qt scene graph is drawn with OpenGL, so the QSG files are just some interface classes for open GL in the end, to abstract open GL a little bit and reuse common stuff like line drawing etc. But if you really want to draw 1000 or even millions of the same object you should consider doing a native open GL approach if you care about the best performance, that can also be done with QQuickItem (without using any of the QSG* classes), you just need to override the "paint" method, there are some examples somewhere I think.
  • Audio new metadata

    1
    0 Votes
    1 Posts
    636 Views
    No one has replied
  • Canvases update: best practice and advices

    8
    0 Votes
    8 Posts
    5k Views
    D
    Thanks again for your time! I've been out of the office during the last few days. I'll take a look to your references asap. :) Cheers, F.
  • <Unknown File>: QML VisualDataModel: Error creating delegate

    3
    0 Votes
    3 Posts
    4k Views
    M
    I got the same error too, when using a ListView inside a ListView, Any updates?
  • Creating C++ objects in QML [solved]

    5
    0 Votes
    5 Posts
    1k Views
    T
    Done! Enjoy your Saturday!
  • QML Screen incorrect properties at application start up

    2
    0 Votes
    2 Posts
    761 Views
    EddyE
    The answers are in the "QML screen docs":http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick-window2-screen.html#details
  • Automatic enter after line finished

    2
    0 Votes
    2 Posts
    499 Views
    D
    using TextArea item
  • QtQuick2 : OpenGL Stencil issues

    3
    0 Votes
    3 Posts
    2k Views
    N
    Thanks for your reply,. I tried both of your solutions resetOpenGLState() in 5.2, and tried disabling GL_STENCIL_TEST at the end of paint, either of them did no help.