Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • QOpenglWidget and QML

    Unsolved
    2
    0 Votes
    2 Posts
    249 Views
    dheerendraD
    Not possible.
  • 0 Votes
    1 Posts
    256 Views
    No one has replied
  • Qt quick miss some styles?

    Unsolved
    1
    0 Votes
    1 Posts
    126 Views
    No one has replied
  • Rectangle with dynamic text size doesn't center

    Solved
    4
    0 Votes
    4 Posts
    364 Views
    D
    @GrecKo Thank you for your answer. It works perfectly !
  • This topic is deleted!

    Solved
    2
    0 Votes
    2 Posts
    37 Views
  • GUI freezing despite using incubateObject

    Unsolved
    1
    0 Votes
    1 Posts
    157 Views
    No one has replied
  • How do I access items created by a DelegateChoice inside a TableView?

    Unsolved
    5
    0 Votes
    5 Posts
    719 Views
    K
    @J-Hilk thank you! I did end up finding an alternative solution. I created a signal on my TableView and wired it to each button. Then, when the ComboBox changes, I call a function on the TableView that fires the signal, triggering the print buttons to reevaluate if they should be enabled or not.
  • What attributes are set to ListView so that data can be inserted from the bottom?

    Unsolved
    2
    0 Votes
    2 Posts
    202 Views
    KroMignonK
    @mirro Did you try verticalLayoutDirection? (cf. https://doc.qt.io/qt-5/qml-qtquick-listview.html#verticalLayoutDirection-prop)
  • Hide console with QApplication

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    Puppy BearP
    if theres 2 console, then remember to delete 'return a.exec', 'system pause'
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • Structure array sharing between QML and c++

    Solved
    2
    0 Votes
    2 Posts
    486 Views
    CP71C
    Ok. At the end, I found a solution. I want to share this solution with you. struct channelStr { Q_GADGET Q_PROPERTY(QString Text MEMBER Text) ... Q_PROPERTY(int data MEMBER data) public: QString Text; ... int data; }; Q_DECLARE_METATYPE(channelStr ) struct myStructData { Q_GADGET Q_PROPERTY(QString exampleMyVersion MEMBER exampleMyVersion ) ... Q_PROPERTY(int exampleMyData MEMBER exampleMyData ) public: channelStr ch[4]; Q_INVOKABLE QVariant getCh( int index ) { return QVariant::fromValue(ch[index]); } QString exampleMyVersion; ... int exampleMyData }; Q_DECLARE_METATYPE(myStructData ) I'm still coding and testing it, but at the moment seems to work well. Does anyone see any problem in this way? Thank in advance CP71
  • A couple Qt various questions

    Unsolved
    11
    0 Votes
    11 Posts
    923 Views
    KroMignonK
    @qcoderpro said in A couple Qt various questions: If that method returning a value is not mentioned in Q_PROPERTY, we simply define it in the public slots and it returns the value without a Q_INVOKABLE. Yes you can use public slots if you want, my personnal preferrence is to use Q_INVOKABLE for methods which I want to be accessible from QML. I found this more readable.
  • Qt6.2.2 MessageDialog and FileDialog QML Type issue

    Solved
    2
    0 Votes
    2 Posts
    867 Views
    F
    I need to use Qt.labs.platform, rather QtQuick.Dialogs module because former contains MessageDialog and FileDialog both but latter is not. So I removeed "import QtQuick.Dialogs" above code. However, FileDialog from Qt.labs.platform does not contain "selectedFile" property, so I switch it to "currentFile" and it works.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    12 Views
    No one has replied
  • weird behavior from future and promise

    Locked Unsolved
    2
    0 Votes
    2 Posts
    151 Views
    SGaistS
    Hi, Please don't post the same question in multiple sub-forum. One is enough. Duplicate Closing this one.
  • Javascript Image is not defined in QML

    Solved javascript image canvas
    4
    0 Votes
    4 Posts
    2k Views
    M
    You're right. Thanks for answering. I finally ended with a QImageProvider. My image provider takes a filename followed by a question mark and a color (image://myimageprovider/myicon.svg?red). I can then colorize my svg file (this is why i needed a new Image() ) from my image provider. This is the qml part. import QtQuick 2.11 Canvas { width: 200 height: 200 property string imageUrl: "image://myimageprovider/myicon.svg?red" Component.onCompleted: loadImage(imageUrl) onImageLoaded: requestPaint(); onPaint: { var ctx = getContext("2d"); ctx.drawImage(imageUrl, 0, 0, 32, 32); } }
  • QList change color of rectangle in QML

    Unsolved qml c++ rectangle color change qlist
    3
    0 Votes
    3 Posts
    797 Views
    T
    @dheerendra thsnls for your reponse. But how do I get the onChanged of param to run the if statements? Thanks
  • Why it doesnt emit ?

    Solved
    8
    0 Votes
    8 Posts
    560 Views
    J.HilkJ
    @Montanaro said in Why it doesnt emit ?: I tryed to change "unsolved tag" into "solved tag but" but I m not able :/ bottom right, topic tools -> mark as solved
  • QML Defines reusable types issue.

    Unsolved
    2
    0 Votes
    2 Posts
    212 Views
    sierdzioS
    @fromis_9 said in QML Defines reusable types issue.: Column { anchors.fill: parent HeaderSlider { Layout.fillWidth: true; Layout.fillHeight: true Column is not a layout, so Layout.fillWidth will not work! Use ColumnLayout instead.
  • Question about accessing QML Objects from C++

    Solved
    5
    0 Votes
    5 Posts
    339 Views
    SGaistS
    I was merely ensuring that I understood your intentions correctly. As @GrecKo wrote, and I would have given the same advice, your detection code should be independent of your UI. Mixing the information you gather with states rather than creating different QML files looks to be a good way to get your application working the way you want.