跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • Bindings bug or feature

    5
    0 評價
    5 貼文
    1k 瀏覽
    C
    Hi, One important feature of a declarative language is that you don't know in which order the declarations will be applied in, or the order the side-effects (signal handlers, binding expressions) will be evaluated in. In practice, there is an order defined by the engine implementation, but it is best not to rely on that, as it is an implementation detail rather than a well-specified behaviour (ie, API contract). To ensure that an imperative expression is evaluated after a binding evaluation occurs, you can trigger the imperative function via a Timer started as a side-effect of the binding expression. Example: @ property bool triggerUpdate: false property var someProperty: { var newValue = Math.random(); if (triggerUpdate) { timer.start(); } return newValue; } Timer { id: timer interval: 0 // will trigger upon returning to the Qt Event Loop onTriggered: { updateViews() // or whatever } } Component.onCompleted: triggerUpdate = true; // will trigger re-evaluation of someProperty binding, and anything bound to someProperty @ In the preceding case, the updateViews() function is guaranteed to be called after ALL binding expressions involving someProperty have been re-evaluated, since the Timer's onTriggered handler will be invoked at some point in the future via the Qt Event Loop. I hope this helps! Cheers, Chris Adams. http://www.qinetic.com.au - The Qt And QML Experts
  • [SOLVED] How to use QML to test which OS/platform the app is running on?

    5
    0 評價
    5 貼文
    3k 瀏覽
    Q
    Awesome. Thanks. Must have missed it.
  • QML MessageBox onYes called two times after click

    3
    0 評價
    3 貼文
    2k 瀏覽
    K
    @ MessageDialog { id: messageDialog text: "Czy chcesz pobrać ten wiersz?" onYes: { console.log("MessageDialog onYes") } standardButtons: StandardButton.Yes | StandardButton.No Component.onCompleted: visible = false }@ and this gives me such log @DefaultMessageBox onClicked MessageDialog onYes MessageDialog onYes@ I added debug message in the DefaultMessageDialog.qml to be sure that there is only one MessageDialog and only one Button. As I said before, the dialog works correct on my Mac that I started the project, but whenever I clone repo to any other computer the issue exists. I tried to update Qt, Qt Creator but with no effect.
  • [SOLVED] Canvas and Context2D

    4
    0 評價
    4 貼文
    895 瀏覽
    D
    So please add solved to the thread title
  • Error "use of undeclared identifier 'qmlRegisterType'"

    10
    0 評價
    10 貼文
    16k 瀏覽
    jeremy_kJ
    [quote author="beanhead" date="1411234589"]as soleyla suggested, I tried: @#include <QtQml>@ For me, this worked without having to make any of the other changes listed above in the previous posts...[/quote] That's the intended route. The documentation is confusing. The various incarnations of qmlRegisterType are documented as related non-members of QQmlEngine (For Qt 5.3 anyway). Searching and then scrolling to the top of the page leads to the impression that <QQmlEngine> in the correct header file. Some of the qmlRegister* function documentation snippets do mention including <QtQml>. It is easy to overlook, and violates the usual pattern.
  • Audio stops unexpectedly

    1
    0 評價
    1 貼文
    460 瀏覽
    尚無回覆
  • [solved] problem with the DropShadow

    6
    0 評價
    6 貼文
    1k 瀏覽
    A
    thank you guys
  • [SOLVED]How to limit the text width with the restriction of parent width

    4
    0 評價
    4 貼文
    2k 瀏覽
    A
    Hi Vikas, "clip:true" worked fine for me. "elide" didn't solve the issue. This Label used inside Column. Thanks.
  • Problem with DropShadow radius

    1
    0 評價
    1 貼文
    764 瀏覽
    尚無回覆
  • Access variables declare in qml function

    3
    0 評價
    3 貼文
    1k 瀏覽
    V
    I think you should return variable instead of accessing the variable inside the function.
  • Bug: TableView doesn't set key.accepted on Key_Up or Key_Down

    3
    0 評價
    3 貼文
    901 瀏覽
    C
    Yes, I'm using 5.3.1, apparently I was looking at the wrong source code. However, the correct code you linked to is problematic - the documentation for KeyEvent says "Generally, if the item acts on the key event then it should be accepted so that ancestor items do not also respond to the same event" which definitely applies in this case. So either the author of this code made a mistake (in which case they should fix it) or they have something very clever in mind where they deliberately went against the documentation (in which case they need to add a comment and also explain in the documentation what is happening. You have an interesting suggestion - that maybe this was done deliberately so that users could also implement Keys.onUpPressed and perform some actions, but the actions I perform will be different depending on whether TableView has already acted on the keypress or not - and the only way to find that out is by TableView.onUpPressed setting event.accepted to true ...
  • Show animated progress inidicator while doing time consuming c++ stuff.

    4
    0 評價
    4 貼文
    1k 瀏覽
    dheerendraD
    I know you told about not starting the thread. But starting the thread is elegant way it avoids lot of stuff. I have tried earlier and move to thread finally.
  • [SOLVED] Problem with anchors within tabs

    3
    0 評價
    3 貼文
    740 瀏覽
    J
    Thanks! Works like a charm!
  • [solved] TextFieldStyle: Height of Rectangle does not correspond font size...

    7
    0 評價
    7 貼文
    2k 瀏覽
    D
    I've downloaded Qt 5.3.2, now the problem is gone!
  • Application Window is empty - Windows 8 - Default project

    4
    0 評價
    4 貼文
    1k 瀏覽
    IamSumitI
    That's g8.. please modify thread title as (SOLVED) . Thanks..
  • Qml works fine on dev machine, crashes on others.

    5
    0 評價
    5 貼文
    1k 瀏覽
    dheerendraD
    You may be missing some plugins and qml directory. @1. Please go to your installation take plugins like platform etc. 2. Go to qml directory and get some directories like QtQml, QtQuick.2 etc. @ These need to be there in the directory where you are placing your executable. This should fix your issue.
  • Dynamic text using QString::arg() in QML

    9
    0 評價
    9 貼文
    21k 瀏覽
    S
    Appears that the .arg function does not allow you to set a fieldWidth from QML.
  • Are Qt Quick Enterprise Controls only available under Commercial License?

    3
    0 評價
    3 貼文
    1k 瀏覽
    D
    Thank You Jens.
  • Touch and text selection problem

    1
    0 評價
    1 貼文
    518 瀏覽
    尚無回覆
  • High level object VS Scene graph rendering

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