Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • QML thumbnail list

    3
    0 Votes
    3 Posts
    2k Views
    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 Votes
    7 Posts
    5k Views
    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 Votes
    4 Posts
    2k Views
    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 Votes
    11 Posts
    3k Views
    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 Votes
    3 Posts
    931 Views
    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 Votes
    3 Posts
    3k Views
    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 Votes
    4 Posts
    2k Views
    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 Votes
    3 Posts
    1k Views
    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 Votes
    2 Posts
    724 Views
    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 Votes
    2 Posts
    3k Views
    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
  • 0 Votes
    1 Posts
    531 Views
    No one has replied
  • Create a list model in c++ with roles

    5
    0 Votes
    5 Posts
    3k Views
    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 Votes
    3 Posts
    2k Views
    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 Votes
    4 Posts
    1k Views
    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 Votes
    4 Posts
    4k Views
    8
    DonRico: I'm developing for windows platform. I think that JvdGlind's solution works. Thanks 4 replies.
  • Qml delay function problem

    3
    0 Votes
    3 Posts
    1k Views
    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 Votes
    3 Posts
    878 Views
    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") }@
  • Qt Quick GridView variable cellWidth depending on Model is not working

    5
    0 Votes
    5 Posts
    2k Views
    jeremy_kJ
    There should be an "Application Output" box at the bottom of the Creator window. Clicking that opens a pane that displays the standard output and error streams from the application, as well as some execution information. It might not be open by default.
  • Releasing in QObjectList-based model

    4
    0 Votes
    4 Posts
    1k Views
    sierdzioS
    If the objects are needed for the whole duration of the execution, then no parent is strictly needed: the memory will be cleaned by the operating system after you close the application. It would be much better to provide an example that does set a parent, you are right. You can file a bug report.
  • Component in pure QML or C++ : What is the fastest rendering solution?

    2
    0 Votes
    2 Posts
    696 Views
    jeremy_kJ
    Eventually pure QML ends up invoking code written in C++, perhaps with GLSL and assembly language thrown in. You'll never beat going directly to the source with added layers of indirection. Whether the added cost of convenience is worth the performance penalty is something for you to decide. If you have access to target devices, benchmark a few implementations and decide which works for the use case. If they're close enough to equivalent, consider which is easier to work with for the likely set of maintainers. Another angle is to examine which is easier to adapt for reuse. Sorry about the soul searching answer.