跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • close on click event in design studio

    Unsolved
    1
    0 評價
    1 貼文
    108 瀏覽
    尚無回覆
  • How do I add an alarm sound(Audio)?

    Unsolved
    2
    0 評價
    2 貼文
    421 瀏覽
    ndiasN
    Hello @LeoWillian, You ca create a 1 second timer object to get system current time and play a sound when current times equal to your alarm time: property var hms: {'hours': 0, 'minutes': 0, 'seconds': 0 } // (object containing integer numbers representing hours, minutes, seconds) Timer { interval: 1000; running: true; repeat: true onTriggered: { var dt = new Date() currentTime = dt.toLocaleTimeString(Qt.locale('EN'), "hh:mm:ss") hms = {'hours': dt.getHours(), 'minutes': dt.getMinutes(), 'seconds': dt.getSeconds()} if (hms.hours === alarmTime.hours && hms.minutes === alarmTime.minutes && hms.seconds === 0) { console.info("ALARM!!!") alarmSound.play() } } } MediaPlayer { id: alarmSound source: "./sounds/pager-beeps.wav" loops: SoundEffect.Infinite audioOutput: AudioOutput {} } To stop alarm sound you can use: alarmSound.stop() Best regards
  • Clustering QtLocation markers technique

    Unsolved
    4
    0 評價
    4 貼文
    757 瀏覽
    E
    @tomaslov I found QGeoView, an interesting and small/simple slippy map for Qt (No qml BS). I have forked the project and made a class (in a branch called draft) that manages a set of POIs and support clustering : https://github.com/embeddedmz/QGeoView/tree/draft it's in the "demo" directory. In 2022, I will continue working on that project.
  • Loader "progress" property always showing 1

    Solved
    3
    0 評價
    3 貼文
    351 瀏覽
    V
    @J-Hilk : Thanks ! it works now Updated code: Window { id: root width: Screen.desktopAvailableWidth height: Screen.desktopAvailableHeight visible: true title: qsTr("Hello World") Component { id: imageComponent Image { source: "https://images.pexels.com/photos/1115090/pexels-photo-1115090.jpeg?cs=srgb&dl=beautiful-flowers-bloom-blossom-1115090.jpg&fm=jpg" } } Loader { id: _loader anchors.fill: parent sourceComponent: imageComponent asynchronous: true } Rectangle { width: parent.width * _loader.item.progress height: 30 color:"red" } }
  • Forcing a state cycle

    Unsolved
    4
    0 評價
    4 貼文
    305 瀏覽
    GrecKoG
    Or don't use states at all. use a Behavior or just start an SequentialAnimation manually when the text changes.
  • QML Dynamic width rectangle from content webengine

    Unsolved
    1
    0 評價
    1 貼文
    202 瀏覽
    尚無回覆
  • Underline(shortcut) is not getting displayed on changing the text on a button

    Unsolved
    6
    0 評價
    6 貼文
    618 瀏覽
    J.HilkJ
    @MaruthiMarsh I have no idea what &Ois supposed to do and when I test it, id does nothing but print the & char. <u></u> are rich text tags and the QMLl Text elements supports that, so I suggested to that :D
  • QQmlContext::setContextProperty: refrence error

    Solved
    4
    0 評價
    4 貼文
    523 瀏覽
    KroMignonK
    @UbiMiles Your welcome... I also had done this kind of mistake days ago, don't be too rude to yourself ;)
  • Grid layout doesn't work well

    Solved
    5
    0 評價
    5 貼文
    806 瀏覽
    Y
    @Tassos Thanks you for answering. It is very cool implementation and very helpful.
  • Cannot run/preview qml files from qtcreator, but works from terminal

    Unsolved
    1
    0 評價
    1 貼文
    764 瀏覽
    尚無回覆
  • Order of QML property's dependency evaluation

    Solved qml binding properties
    5
    0 評價
    5 貼文
    2k 瀏覽
    B
    @b-arun-kumar said in Order of QML property's dependency evaluation: Response from Qt Support: As per this old article: https://www.kdab.com/qml-engine-internals-part-2-bindings/, static value assignments happen during creation phase and binding value assignments happen at the end of creation phase. That is how it should be, literals first, then functions. But it is not actually documented so in theory it could change. This is also only true for simple literal assignments. Anything even slightly hinting about complexity makes QML engine postpone them together with all those needing the evaluation. For example it happens if you wrap the value with {} like this: p2: {true} Case 1: CustomQMLComponent{} In this case, based on the above article, p1 & p2 values are set by the time p3 value is set. The order in which these "static" properties are set is undefined and also the order in which more complex expressions are done are undefined. So it is best to avoid making assumptions about the order. Case 2: CustomQMLComponent{ p1: "my_string" p2: true } What happens in this case? In a more general sense, what happens when properties of a component are set when creating an instance of the component? Are the properties initialized with default values and then overridden by the new instance's values? Or, the properties are initialized just once with the default/new values. Just once. Although the properties do of course have some default value before the value in QML is assigned. The initial value set in constructor of a C++ class, or in case of QML defined property, default constructed value of the type (empty string, 0, false or null in case it is QObject* type). And why this could be important is because something like onXXXChanged signals are handled immediately when they occur and thus it could be ran before all those "static" assignment are done. Consider for example: onP1Changed: if (p2) {...} else {...} QML engine does not know that there is some dependency to p2 on p1 value change and in case p1 gets assigned before p2, this could take unexpected path and if p2 value change is not explicitly also handled properly in this case, could lead to mismatched state.
  • QML TreeView - handle Keyboard array events

    Unsolved
    1
    0 評價
    1 貼文
    198 瀏覽
    尚無回覆
  • Reference Error appears, but the program runs normally.

    Unsolved
    11
    0 評價
    11 貼文
    670 瀏覽
    W
    @KroMignon Sorry, It's just a typo...
  • How can i Know SwitchDelegate is checked or not?

    Solved
    4
    0 評價
    4 貼文
    332 瀏覽
    E
    Great @lemons this is Works :D
  • Append text Gui freezed

    Unsolved qml
    1
    0 評價
    1 貼文
    138 瀏覽
    尚無回覆
  • ScrollView far too sensitive for touchpad scrolling

    Unsolved
    3
    0 評價
    3 貼文
    463 瀏覽
    MarkkyboyM
    There doesn't appear to be any control over velocity with ScrollView. Perhaps to have a look at Flickable which does offer control over velocity; https://doc.qt.io/qt-5/qml-qtquick-flickable.html I could be wrong, but a good search for 'velocity' kept coming back to Flickable. I saw 'maximumFlickVelocity' for ListView mentioned in an Android thread, but it doesn't seem to apply to ListView in qml.
  • Error building QtCreator from source

    Unsolved
    2
    0 評價
    2 貼文
    192 瀏覽
    SGaistS
    Hi, It looks like you are using your distribution provided Qt. If so, then you have to install the development packages that provide the private parts of Qt.
  • Handwriting Recognition lipi toolkit , Myscript, T9

    Unsolved
    1
    0 評價
    1 貼文
    229 瀏覽
    尚無回覆
  • QT QML UI is not refreshing on embedded Linux Display Unit

    Unsolved
    1
    0 評價
    1 貼文
    164 瀏覽
    尚無回覆
  • How to set the position in QML List view

    Solved
    3
    0 評價
    3 貼文
    518 瀏覽
    P
    @sierdzio Thank You ListView { id: listView anchors.fill: parent model: contactModel delegate: Text { font.pixelSize: 14 text: name + ": " + number } onCountChanged: listView.contentY = 52 }