Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • How do I print the "id" attribute of Item?

    2
    0 Votes
    2 Posts
    1k Views
    jeremy_kJ
    Printing the item using its id (rather than the id property of the item) works. If the objectName property is defined, that will also be output. For example: @ Item { id: myItem objectName: "my item" Component.onCompleted: print(myItem) } @ should result in something along the lines of: qml: QQuickItem(0x101e12c60, "my item") edit: The same applies for properties or variables assigned the value of the item using its id
  • 0 Votes
    1 Posts
    588 Views
    No one has replied
  • Problems on how to use 3D noise or texture in ShaderEffect

    2
    0 Votes
    2 Posts
    2k Views
    timdayT
    I find myself wanting to do the same thing as the post above: somehow get an OpenGL 3D texture accessible to sampler3D/texture3D stuff in the GLSL in a ShaderEffect used in some QML... and the above appears to be the one and only Google hit relating to doing this. Sure, I can do what I need to do entirely with C++ and a subclassed QQuickFramebufferObject, but really once the 3D texture is there in the OpenGL domain doing the rest in GLSL in a QML ShaderEffect would be just so much more lightweight it's a bit of a shame to have to resort to the C++ hammer. Is there some workround I'm missing, or is there some undocumented way of getting a 3D texture into a ShaderEffect? If not... tempting to put it in as a Jira wishlist item. Arguments against might be that 3D textures aren't included in un-extended OpenGLES2. On the other hand, apparently more recent iOS and Android devices are ES3 which does support it.
  • Hierarchal or nested model properties are accessible in QML

    1
    0 Votes
    1 Posts
    770 Views
    No one has replied
  • QML GridView and QSortFilterProxyModel

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    6 Posts
    4k Views
    R
    The problem seems to arise from using a Rectangle to encapsulate the Delegates. I want the extra layout provided inside a Rectangle component in order to use different items inside the Delegate to display different fields. This QML code seems sufficient to reproduce the problem: @ ListModel { id: longModel Component.onCompleted: { for ( var i=1; i<=100; i++ ) append({"testName": i}) } } ListView { anchors.fill: parent id: listView model: longModel delegate: Rectangle { height: textComponent.height*2 width: parent.width Text { id: textComponent text: testName } } } @ A workaround is to place the Text component inside a RowLayout instead of a Rectangle. Another workaround is to place the Rectangle inside an Item (i.e. use delegate: Item{ Rectangle{ Text{} }}) But nevertheless, shouldn't it be possible to successfully use a Delegate with Text inside Rectangle, as done in the sample code?
  • QML Item Styling

    1
    0 Votes
    1 Posts
    752 Views
    No one has replied
  • QML ComboBox Separator

    1
    2 Votes
    1 Posts
    787 Views
    No one has replied
  • [Solved] Trouble passing QList<QObject*> to QML

    2
    0 Votes
    2 Posts
    1k Views
    M
    Thanks! Just what I needed.
  • How to hide Quick QML componentes in deliveries?

    1
    0 Votes
    1 Posts
    405 Views
    No one has replied
  • Force Android Style on Windows?

    1
    0 Votes
    1 Posts
    602 Views
    No one has replied
  • How to use QML Bluetooth libraries to send string

    1
    0 Votes
    1 Posts
    645 Views
    No one has replied
  • [SOLVED] QtQuick plugin not loading

    3
    0 Votes
    3 Posts
    3k Views
    T
    Yes it does. This is caused by https://bugreports.qt-project.org/browse/QTBUG-42954.
  • Interaction with OpenGL Verticies in a custom QQuickItem

    2
    0 Votes
    2 Posts
    696 Views
    D
    Hmmm i think this is not a really a QtQuick problem more an OpenGL specific task. With google and words like hit test or collision detection or mouse picking u will find tons of tutorials.
  • How can I combine C++(QtWidget) UI with QtQuick UI in the same app?

    2
    0 Votes
    2 Posts
    1k Views
    D
    Hmm, i think the problem here can be the fact that Android can't handle multiple global windows. But the sample application tried to create two separate windows this can be the problem here.
  • Detecting onComplete of Repeater

    5
    0 Votes
    5 Posts
    2k Views
    S
    Nope this approach doesn't solved the problem. Same behavior as before. The onStatusChanged signal emits another signal which is used to process the repeaters items. But the log shows that the Items in the Repeater still chance after the loader is finished.
  • Disable window maximizing/showing in QML

    3
    0 Votes
    3 Posts
    2k Views
    O
    Hey, like p3c0 already said; the window visibility should do the trick. Example code with a Window-type Component: @import QtQuick 2.2 import QtQuick.Window 2.1 Window { visible: true visibility: "Minimized" }@ For the cpp part where a user shouldn't be able to maximize your application: @void MyApplication::changeEvent(QEvent *e) { if(e->type() == QEvent::WindowStateChange) { e->ignore(); } else { e->accept(); } }@ This should ignore the event by default, i haven't tested it out so you might play around with it a little bit to get it work properly.
  • [SOLVED] Accessing a SequentialAnimation from c++

    2
    0 Votes
    2 Posts
    638 Views
    K
    I've found the solution: @ QObject a1 = this->findChild<QObject>("animation1"); int delay = a1->property("delay").toInt(); @
  • [SOLVED] ProgressBarStyle in a styling Singleton

    3
    0 Votes
    3 Posts
    1k Views
    T
    The solution was to add a qmldir file with: @singleton Style Style.qml@
  • Is Qt Quick the right tool for my app ?

    2
    0 Votes
    2 Posts
    686 Views
    O
    Hello and welcome to devnet, your GUI seems quite sexy so far. I will try to provide you an answer to all the points you mentioned: be able to recursively encapsulate elements Should be possible, you can get a qml object or context from c++ be able to move them in a scene, Yes, you can move elements withhin your application.(Drag and drop-like or by a setting a xyz-position) send signals when they are left- or right- clicked A QML component emits signals when events are triggered(for example: A MouseArea emits clicked when you clicked). Also it is possible to define your own signals easily and catch them. (signal mySignal; onMySignal: doStuff; ) have them draggable and droppable Not from scratch, it would take a little time to implement a drag and drop, you probably could do this fully in qml, it would take more time to implement a grid based drag and drop. be able to manage elements not known at compile-time (there is a plugin system where you can add your own Process) You can dynamically create QML components or load full QML files on run-time! TL;DR It should theoretically work, just give QML a try, work a little bit with it and test it out, if you like it you can try to switch your project to a QML project. One last thing; there was a QtQuick "Bug" a few months ago (haven't worked with QML since then), where your application won't wake up after closing(not quiting) it under android, maybe it's fixed yet, i don't know. If you still have questions then feel free to ask! =)