跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k 主題 77.7k 貼文
  • Error when adding chart to main.qml

    已移動 Solved
    3
    0 評價
    3 貼文
    526 瀏覽
    D
    @GrecKo thank you very much. This error took a lot of my time.
  • Cannot select from multiple available GPUs used by QQuickWindow.

    Unsolved
    3
    0 評價
    3 貼文
    407 瀏覽
    GrecKoG
    I would post this in https://lists.qt-project.org/listinfo/interest if I were you.
  • QOpenglWidget and QML

    Unsolved
    2
    0 評價
    2 貼文
    259 瀏覽
    dheerendraD
    Not possible.
  • QQmlApplicationEngine failed to load component (module "Qt5Compat.GraphicalEffects" is not installed)

    Unsolved
    1
    0 評價
    1 貼文
    264 瀏覽
    尚無回覆
  • Qt quick miss some styles?

    Unsolved
    1
    0 評價
    1 貼文
    139 瀏覽
    尚無回覆
  • Rectangle with dynamic text size doesn't center

    Solved
    4
    0 評價
    4 貼文
    388 瀏覽
    D
    @GrecKo Thank you for your answer. It works perfectly !
  • 此主題已被刪除!

    Solved
    2
    0 評價
    2 貼文
    37 瀏覽
  • GUI freezing despite using incubateObject

    Unsolved
    1
    0 評價
    1 貼文
    164 瀏覽
    尚無回覆
  • How do I access items created by a DelegateChoice inside a TableView?

    Unsolved
    5
    0 評價
    5 貼文
    750 瀏覽
    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 評價
    2 貼文
    215 瀏覽
    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 評價
    6 貼文
    2k 瀏覽
    Puppy BearP
    if theres 2 console, then remember to delete 'return a.exec', 'system pause'
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    8 瀏覽
    尚無回覆
  • Structure array sharing between QML and c++

    Solved
    2
    0 評價
    2 貼文
    502 瀏覽
    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 評價
    11 貼文
    941 瀏覽
    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 評價
    2 貼文
    918 瀏覽
    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.
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    12 瀏覽
    尚無回覆
  • weird behavior from future and promise

    已鎖定 Unsolved
    2
    0 評價
    2 貼文
    157 瀏覽
    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 評價
    4 貼文
    2k 瀏覽
    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 評價
    3 貼文
    859 瀏覽
    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 評價
    8 貼文
    577 瀏覽
    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