跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k 主題 77.8k 貼文
  • Bind a QML property on JS object through a function

    2
    0 評價
    2 貼文
    2k 瀏覽
    S
    Just stumbled upon this myself. Any idea?
  • Cannot make QQuickView transparent

    5
    0 評價
    5 貼文
    2k 瀏覽
    EddyE
    I would expect to use this in your main before any qml file is loaded. Hope it helps
  • Capture Screen in qml

    1
    0 評價
    1 貼文
    562 瀏覽
    尚無回覆
  • QML thumbnail list

    3
    0 評價
    3 貼文
    2k 瀏覽
    J
    Hi and thanks for replying. Yesterday I've had some success with append() method - I've realized that it shouldn't be that hard if I use underlying C++ for handling file names only - QML's ListModel append() would work just fine if my underlying C++ class could provide it with proper file names and file count, which is really easy to implement - I'll give it a go and post back. What I do find funny is that my whole app blocks when I instantiate the fore-mentioned ListModel without ListElements. My current workaround is to put one ListElement to it and then clear() the list when it's loaded, although this is quite dumb - do you have any idea why ListModel doesn't work when there's no elements in it at startup?
  • Applicaton icon Qt5.2, Windows and Linux, QML

    7
    0 評價
    7 貼文
    5k 瀏覽
    p3c0P
    Is it giving any error now or it is not just displaying icon ? Instead of loading from resource try it from a fixed path. For e.g @ app.setWindowIcon(QIcon("/root/new_blue.png")); @
  • [Solved] How to detect Menu closed or dismissal?

    4
    0 評價
    4 貼文
    2k 瀏覽
    Q
    As per the bug report comment, there seems to be a work around (for now, at least). So closing of this forum post as "Solved". " on__PopupVisibleChanged: console.log("visible " + __popupVisible) The implementation can change without warning in future versions of Qt, but you could use it as a workaround for now. " The issue is being picked up as a feature request, for Qt 5.4.
  • Qml in qt widgets

    11
    0 評價
    11 貼文
    3k 瀏覽
    K
    Hi, I already know where was the problem. I didn't set size of container and thus of that there was no place to display qml object. Strange, because it's hard to set ( probably for me :) ) right size policy between qml object and container widget. If someone have some good examples where qml objects are combined with Qt widgets I will be thankful.
  • Qt installation problem

    3
    0 評價
    3 貼文
    951 瀏覽
    U
    Now it is installed. checked disk space. But installer isn't made properly, because it said firstly that space is available
  • Playing QML Audio or Multimedia from qrc not working on Android

    3
    0 評價
    3 貼文
    3k 瀏覽
    M
    My mistake (of course), the qrc prefix was the same as the folder name and I didn't use both in the url. DOH, sorry folks.
  • How to force update a hidden window?

    4
    0 評價
    4 貼文
    2k 瀏覽
    D
    Thanks for the answer. I destroy the hiddenNode in the destructor of the RenderWidgetHostViewQtDelegateQuick. The problem is that QtWebEngine sends the "loaded" signal, which means that a page been loaded. But when I show the window with webview, it appears with white background for a second or two. It's looks terribly. As I understand, the problem connected to the way of update QSG
  • What is this QML code doing?

    3
    0 評價
    3 貼文
    1k 瀏覽
    M
    Thank you, that is helpful. I did end up going with a QVideoProbe based solution, but it seems like your solution gets around using QML (which is something I'd like to do.) edit: Can you elaborate a bit on what setting SuppressVideo does in the code? I'd just like to verify that you're using your own QAbstractVideoSurface in conjunction with the QVideoProbe and QCamera. I've tried something similar, but I never know if I'm implementing the abstract class correctly.
  • Component works when duplicated but doesn't work if in single file

    2
    0 評價
    2 貼文
    747 瀏覽
    dheerendraD
    I understood that you would like to increase the size of slider when the window size increases. If that is the case you need to put the following line for every component creation. SelectValue {Layout.fillWidth: true; If this is not your case, please do let me know what are you trying to achieve. I can help you on that.
  • Enabling horizontal scroll in TableView (vs. ScrollView)

    2
    0 評價
    2 貼文
    3k 瀏覽
    J
    This seems to have been caused by a valid issue that was recently fixed for 5.3.1 (or 5.2.1 if that is imminent): See https://bugreports.qt-project.org/browse/QTBUG-39393
  • Is there a way to export/save a dynamically created QML scene to a file?

    1
    0 評價
    1 貼文
    543 瀏覽
    尚無回覆
  • Create a list model in c++ with roles

    5
    0 評價
    5 貼文
    3k 瀏覽
    G
    If you have your data in a SQL database you should consider using "QSqlQueryModel":http://qt-project.org/doc/qt-5/QSqlQueryModel.html or "QSqlTableModel":http://qt-project.org/doc/qt-5/qsqltablemodel.html. The process to implement the model in C++ is similar to the example above.
  • How do I get the context of a given component in C++?

    3
    0 評價
    3 貼文
    2k 瀏覽
    B
    Thanks for your anwser! I didn't know I could pass directly a QObject from QML, good to know. But regarding the second thing, I don't understand... how do those methods help me? QObject::property() returns the property with the name passed as parameter, while QObject::metaObject() returns a QMetaObject and I'm not sure what to do with it... I'll tell you a bit what I need to do, maybe it helps. Basically in QML I've got a list with results from searches: the user searches something, and the previous list (if there was) is replaced by a new one with the results. In my application each view (as in component) gives the possibility to make searches, and every view has to show its own searches at any given time (let's just leave it at that, no need to go into details); so every view has a context that differs from the others in order to show different things in every view. When the user searches something, I need to get the context of the view in which the search started, in order to change the model of the list of results so that it only changes in that given view, not in others. So basically when the user searches, I need to set a property containing the new model of the list so that is accessible from the QML view that prompted the search. This way, since the list uses the model obtained from C++, whenever the property is redefined from C++ it will change in QML too. I don't know if I made myself clear... From what I've seen, the QMetaObject that QObject::metaObject() doesn't let me define a new property (or redefine an old one) so that it would be accessible from QML, or maybe I'm missing something...
  • QML Previous selector

    4
    0 評價
    4 貼文
    1k 瀏覽
    JKSHJ
    Hi, Selecting the "previous" object not currently possible in QML. I'm not sure this feature makes sense however, because QML has a declarative structure and the order in which you declare your components should not matter. Anyway, it looks like what you need is a "layout manager":http://qt-project.org/doc/qt-5/qtquicklayouts-index.html
  • Screen orientation QML ApplicationWindow

    4
    0 評價
    4 貼文
    5k 瀏覽
    8
    DonRico: I'm developing for windows platform. I think that JvdGlind's solution works. Thanks 4 replies.
  • Qml delay function problem

    3
    0 評價
    3 貼文
    2k 瀏覽
    p3c0P
    Hi, You can use the "onStopped":http://qt-project.org/doc/qt-5/qml-qtquick-animation.html#stopped-signal event handler so that you can do the operations after the Animation is completed.
  • Undo the setContextProperty

    3
    0 評價
    3 貼文
    901 瀏覽
    dheerendraD
    @CPP Export2QML *obj = new Export2QML; contxt->setContextProperty("abc",obj); viewer.show(); contxt->setContextProperty("abc",NULL);@ @QML if (abc != null) { abc.display(); }else { console.log("Object is null") }@