跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • ListView example

    Unsolved
    4
    0 評價
    4 貼文
    413 瀏覽
    GrecKoG
    Do you read the doc? https://doc.qt.io/qt-6/qml-qtquick-listview.html#currentIndex-prop
  • Diffrences between Q_PROPERTY and Q_INVOKABLE

    Unsolved
    1
    0 評價
    1 貼文
    194 瀏覽
    尚無回覆
  • How to make spin win whell?

    Unsolved
    2
    0 評價
    2 貼文
    886 瀏覽
    MarkkyboyM
    I would imagine, it would be more cost effective (cpu and gpu time) if the Win Wheel was a PNG or JPG, especially when it comes to animation (spinning/slowing/stopping/etc). But how to build that using QtQML, good question!. For instance, you could use the image you have given, this may well mean using something like Photoshop/GIMP/etc to get things looking how you want. With regard to the animation; once you have your component image (the spinwheel), you can look at animation, here might be a good place to get started; https://qmlbook.github.io/ch01-meetqt/meetqt.html#digesting-a-user-interface Using the very image you've provided, I put this together. It's a demo, not a complete app, but perhaps a good starting point? Built using SailfishSDK on Sony Xperia 10 II Dual SIM. Screenshot directly from device. Column { id: column spacing: 20 width: parent.width anchors.centerIn: parent Label { text: "\u25BC" font.pixelSize: 144 anchors.horizontalCenter: parent.horizontalCenter } Image { id: wheel source: "../images/win-wheel.png" anchors.horizontalCenter: parent.horizontalCenter PropertyAnimation on rotation { id: spinAnimation from: 0 to: 3610 duration: 10000 running: false easing.type: Easing.InOutQuint } MouseArea { anchors.fill: parent onClicked: { spinAnimation.running = true timer.start() label.opacity = 0.0 console.log(spinAnimation.duration) } } } Label { id: hint text: "Tap wheel to start" anchors.horizontalCenter: parent.horizontalCenter } Rectangle { width: wheel.width/2 radius: 20 height: 200 color: "white" border { width: 4 color: "green" } anchors.horizontalCenter: parent.horizontalCenter Label { id: label //visible: false opacity: 0.0 text: "WIN!" color: "black" font { bold: true pixelSize: 108 } anchors.centerIn: parent } Timer { id: timer interval: spinAnimation.duration running: false repeat: true onTriggered: { label.opacity = 1.0 } } } } [image: 687a606d-0970-47b9-866e-958c72acfd87.png]
  • Access members of `QVariant(PySide::PyObjectWrapper)` on QML

    Unsolved
    1
    0 評價
    1 貼文
    483 瀏覽
    尚無回覆
  • qml FileDialog, does not want to open the selected image for me

    Unsolved
    1
    0 評價
    1 貼文
    148 瀏覽
    尚無回覆
  • Transfer QQuickObject via Drag'n'Drop

    Unsolved
    1
    0 評價
    1 貼文
    122 瀏覽
    尚無回覆
  • Qt Webassembly via conan package manager - "Could NOT find Qt6Quick"

    Unsolved
    3
    0 評價
    3 貼文
    751 瀏覽
    J
    A quick update : this https://bugreports.qt.io/browse/QTBUG-94524 (Introduce a QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH variable) will solve the issue above.
  • RowLayout in a Flickable containing 2 ColumnLayouts - how to snap to appropriate ColumnLayout

    Unsolved
    1
    0 評價
    1 貼文
    160 瀏覽
    尚無回覆
  • Displaying Realsense camera stream using QT quick

    Unsolved
    1
    0 評價
    1 貼文
    259 瀏覽
    尚無回覆
  • destroy filedialog does not clear the memory usage in qml

    Unsolved
    1
    0 評價
    1 貼文
    130 瀏覽
    尚無回覆
  • problem with get values from QHash in qml

    Solved
    3
    0 評價
    3 貼文
    425 瀏覽
    Q
    @sierdzio thanks for answer, my problem solved thank you
  • How to keep ApplicationWindow aspect ratio

    Unsolved
    2
    0 評價
    2 貼文
    567 瀏覽
    K
    Is it any solution for this?
  • Dialogs in Qt 6 using CMake

    Solved
    10
    0 評價
    10 貼文
    1k 瀏覽
    Q
    Still the problem with a property of FileDialog to bring the explorer window to select the file exits: Cannot assign to non-existent property "folder". I also tried currentfolder but the same error message!
  • Skip animation if its target is null

    Unsolved
    5
    1 評價
    5 貼文
    384 瀏覽
    M
    @KH-219Design yes, it's a segmentation fault. Would you please tell me how to capture the backtrace/callstack? When debugging I can see only a lot of disassembled code, but no one function (in any thread) is my code. I can prepare a sample project for you. In the meanwhile, can we generalize a bit the question? How to skip a step in a SequentialAnimation if some conditions are met?
  • What is the rectangle over the QML Button?

    Unsolved
    2
    0 評價
    2 貼文
    275 瀏覽
    MarkkyboyM
    Looks like you're using an OpacityMask on your Button but without radius being taken into account. Otherwise, post the snippet of code that produces the effect you show in your image, it might be easier to assess what's happening.
  • 0 評價
    1 貼文
    167 瀏覽
    尚無回覆
  • QtQuick.VirtualKeyboard, slow language change

    Unsolved
    7
    0 評價
    7 貼文
    755 瀏覽
    sierdzioS
    @juvf said in QtQuick.VirtualKeyboard, slow language change: Why? The startup passed a long time ago. I guess layouts are loaded via a Loader element. So when it's sourceComponent is changed (to another layout), the data is loaded fresh. So this implies you could create a custom layout, make it small and fast and it will load fast. Or make it lazy-load and it will also look faster than it is (here I mean: initially load just empty rectangle, then fill in all the keys). A lot of the details are described here: https://doc.qt.io/qt-6/technical-guide.html
  • Lets play a game... thermonuclear wa...sorry QDate to JS Date conversion!

    Solved
    4
    0 評價
    4 貼文
    471 瀏覽
    D
    My approach was lossy. QDate loses time information. Changing data type for C++ to QDateTime keeps the time info even if I don't need that. The time zones have an affect. It seems JS Date can interchange between C++ QDate or QDateTime. QDateTime is the preferred and doesn't cause errors.
  • QML ReferenceError within Drawer

    Unsolved
    4
    0 評價
    4 貼文
    328 瀏覽
    J
    I've decided to move all properties to c++ and not use properties within QML itself. As such, this issue isn't relevant anymore, but I'd still be interested to understand what's going on here. I suspect it's due to the Drawer's parent being the Overlay, rather than the mainItem itself.
  • Provide markdown styling to QML Markdown Text?

    Unsolved
    1
    0 評價
    1 貼文
    563 瀏覽
    尚無回覆