Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.5k Posts
  • Submenu animations?

    Unsolved
    1
    0 Votes
    1 Posts
    103 Views
    No one has replied
  • Creating a new window by dragging page itself in QML? (and vice versa)

    Unsolved
    1
    0 Votes
    1 Posts
    156 Views
    No one has replied
  • 0 Votes
    4 Posts
    374 Views
    K
    Is it possible to dynamically create QML Rectangle/Image/Item in sperate plugin and attach to existing QtQuick Window. This Rectangle/Image must be like overlay on top of the window. Is this possible on EGLFS platform. Thanks in Advance!
  • Load QML plugin without changing code in the application code base

    Unsolved
    1
    0 Votes
    1 Posts
    102 Views
    No one has replied
  • QtCreator Crash after open Designer

    Unsolved
    3
    0 Votes
    3 Posts
    904 Views
    G
    Same issue, updating to QtCreator 9.0.1 generate this kind of issue as soon as defining a ListElement. Any help will be appreciated.
  • dashed lines qtquickgeometry

    Unsolved
    3
    0 Votes
    3 Posts
    393 Views
    johngodJ
    Hi The easy solution for dashed lines is to apply a texture to your line, where the texture data has two colors, one being equal to the background color. I have done this, check here: https://bitbucket.org/joaodeusmorgado/techdrawstudio/src/master/qml/qmlEntities/Line_dashed.qml where the texture data is defined here https://bitbucket.org/joaodeusmorgado/techdrawstudio/src/master/entities/linetexture.cpp Other option is to play around with shaders and discard some pixels of the line, making a dashed pattern. Regardin the squares, maybe you can use their coordinates and display there a Model with geometry source set to #Sphere ?
  • ListView inside Menu

    Solved
    3
    0 Votes
    3 Posts
    433 Views
    A
    I finally got it rendering, I used anchors.fill: parent on the ListView, which caused nothing to be rendered. This will render the same as when the ListView is not used: Menu { id: testMenu width: 150; height: 150 MenuItem { text: "New..." } MenuItem { text: "Open..." } MenuItem { text: "Save" } contentItem: ListView { model: testMenu.contentModel } } Why would I want to do that? I assume that the point is to use a delegate in the ListView to render imaginary menu elements, no? But adding the delegate, nothing is rendered: Menu { id: testMenu width: 150; height: 150 MenuItem { text: "New..." } MenuItem { text: "Open..." } MenuItem { text: "Save" } contentItem: ListView { model: testMenu.contentModel delegate: Rectangle { color: "blue" width: 150 height: 30 Text { text: modelData.text } } } } EDIT: Ok, added anchors.fill: parent to the delegate, and it started rendering. Now it renders exactly also like when the ListView is not used, and the delegate is not showing at all, it is just a normal menu: Menu { id: testMenu width: 150; height: 150 title: qsTr("TestMenu Root") MenuItem { text: "New..." } MenuItem { text: "Open..." } MenuItem { text: "Save" } contentItem: ListView { model: testMenu.contentModel delegate: Rectangle { anchors.fill: parent color: "blue" width: 150 height: 30 Text { text: modelData.text } } } } What is the point, and is there some use for this ListView as contentItem mechanic? The delegate seems not to be used. EDIT 2: Ok, so it looks like the ListView can be used to modify how the MenuItems flow and so on, by setting properties and so on. A horizontal menu can be achieved like this: Menu { id: testMenu width: 150; height: 150 title: qsTr("TestMenu Root") MenuItem { text: "New..." } MenuItem { text: "Open..." } MenuItem { text: "Save" } contentItem: ListView { model: testMenu.contentModel orientation: Qt.Horizontal } } However, the ListView delegate can't be used, and I am not sure how to customize MenuItem visuals in other ways without rolling out your own menus. EDIT 3: Ok, found how to do that, but mildly disappointed that the ListView delegate can't be used. The trick is to set up a custom MenuItem as the delegate of the Menu itself. https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#customizing-menu Anyways, I hope this thread helps someone who is wondering about the same thing.
  • Porting from Widgets to QML: suggestions needed on how objects interact

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    M
    @Bob64 It was very clear, thanks :)
  • custom QQuickPaintedItem in SwipeView cannot accept key event

    Solved
    6
    0 Votes
    6 Posts
    447 Views
    Z
    I'm sure it is retalted to the version. I set swipeview's focus to true and upgradd to Qt 5.14, it work. (in Qt 5.12 not work). @jeremy_k @dheerendra
  • Controls appear to break bindings when interacted with

    Unsolved
    2
    0 Votes
    2 Posts
    274 Views
    I
    I dont know if this helps you now, since noone has responded... but the way i solve this (and i've had to do it on multiple ui elements) is as follows: Create custom qml type where the base item is the same as the original (CheckBox in this case) Add property var checkedBinding Add Component.onCompleted:{if(typeof checkedBinding==='function' checked=Qt.binding(checkedBinding)} Add onClicked:{if(typeof checkedBinding==='function' checked=Qt.binding(checkedBinding)} Then when using the component, instead of setting checked:model.value you can use checkedBinding:function(){return model.value} This is really annoying behavior and i wish qt would fix it. it's not as bad in this simple case, but it can cause a lot of issues when you are doing multiple components put together with custom behavior. The example that bothers me the most is making a DoubleSpinbox item , since the act of changing the binding itself to handle doubles automatically conflicts with using the element itself (even ignoring outside bindings) and will thus automatically unbind itself from the original implementation of the double spin box.
  • Qt6: tickmarks for Dial and more

    Unsolved
    3
    0 Votes
    3 Posts
    305 Views
    J
    Thanks! I guess so indeed. I hope the Styles will be included again in further development of Qt6. It was very easy to set up.
  • Create an empty QStringList in a QML file

    Unsolved
    3
    0 Votes
    3 Posts
    468 Views
    S
    Thank you. This helped me a lot!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    12 Views
    No one has replied
  • QImageWriter not working - QML

    Unsolved
    7
    0 Votes
    7 Posts
    454 Views
    D
    Minor update, Narrowed down the issue to Q_OBJECT in the class being a problem during compiling. Looking into other options for exposing the function properly
  • Propblem with blurry text on custom QQuickPaintedItem

    Unsolved
    1
    0 Votes
    1 Posts
    196 Views
    No one has replied
  • set index of ListView from Delegate

    Solved
    3
    0 Votes
    3 Posts
    241 Views
    mzimmersM
    @JoeCFD thank you. MouseArea { anchors.fill: parent onClicked: { activityView.currentIndex = index } }
  • Getting Slow Motion Video while using QML Media Player

    Unsolved qmediaplayer video qml gstreamer
    2
    0 Votes
    2 Posts
    894 Views
    Q
    I have the same issue. It's soo slow with rtsp and buggy.
  • QML Video Qt6 - Cannot make QOpenGLContext current in a different thread

    Unsolved
    5
    0 Votes
    5 Posts
    726 Views
    M
    @RobHills @Myko1a I'm here because I had this problem and I solved upgrading to Qt6.4.2...but I have another issue, MediaPlayer for Android works only for the first video, then it not shows anymore videos but it emits stopped on videos end. Same code compiled for Windows works good. Have you also this problem?
  • Correct syntax for setting C++ property in QML

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    JoeCFDJ
    @GrecKo In C++ the way of mode access in QML like opMode.mode = mode is like public access and is not preferred in C++. That is what I meant. Contrary to what JoeCFD is saying, this is more encapsulated than calling setMode. You are not acting on the C++ variable anyway, you are going through the QML engine and it can make use of this for stuff like behaviors for example. Good to know. When doing opMode.mode = mode the modeChanged signal WILL be called (provided that your WRITE method is correctly coded).