Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • 0 Votes
    4 Posts
    3k Views
    T
    I should also note that the window itself does show, and any components (such as a text area) I put in it will show as well, just not the menu bar. In case it makes a difference I'm on Ubuntu 14.04
  • Increase sampling rate ( interp(); function in MATLAB )

    2
    0 Votes
    2 Posts
    2k Views
    JKSHJ
    Hi, Qt does not offer advanced mathematical functions. You have 3 options (from simplest to hardest): Interpolate your data in MATLAB before passing it to Qt Link your Qt project to a mathematical library like "GSL":http://www.gnu.org/software/gsl/ "Write your own interpolation functions":http://books.google.com/books?id=gwijz-OyIYEC&pg=PA36&dq=interpolation
  • How to preserve TextField binding when user manually edits value

    3
    0 Votes
    3 Posts
    1k Views
    R
    That's exactly what I was looking for. I still don't understand why the binding is lost, but I'm really after the correct way of coding QML and using an alias is much simpler than what I was doing. In fact in my actual code I will create an alias to each top level item (i.e TextField and similar objects) and that way the user of the component can have access to anything they want. Thank you very much.
  • How to get HID device and interact with the hid device

    1
    0 Votes
    1 Posts
    740 Views
    No one has replied
  • Can a QML file refresh a JS import at runtime?

    2
    0 Votes
    2 Posts
    1k Views
    L
    Yes. use Qt.Include() see "this":http://qt-project.org/doc/qt-5/qtqml-javascript-imports.html#including-a-javascript-resource-from-another-javascript-resource
  • Is there a way to change front/back properties in a Flipable?

    3
    0 Votes
    3 Posts
    983 Views
    B
    [quote author="sierdzio" date="1400221623"]Change the source of the image, not the object. Or use a Loader.[/quote] Well, yesterday I tried something like that (not with an Image), but it gave me an error saying that I couldn't modify read-only properties; I figured since the front/back were write-only, they're children properties were read-only. Now I just tried changing the source of the Image and it worked just fine. I don't know what I was doing wrong yesterday. But the Image was just an example. What I really need is a way to change insert a view created and istantiated from C++ into the front/back properties. I was messing with the the Loader a few moments ago, and it might look the thing I need, except that I can't load the new view created from C++ with that because the component is actually instantiated in the C++ side...
  • [SOLVED]Dynamic Binding of QML Object and Factory created C++ object

    5
    0 Votes
    5 Posts
    4k Views
    L
    GOT IT. this worked: @ onClicked: { var component = Qt.createComponent("master_item.qml"); if (component.status == Component.Ready) { var tab = tabview.addTab("tab " + (tabview.count + 1), component); if (tab.status == Loader.Ready) { tab.item.obj = products.get("CR2001W"); } else { tab.loaded.connect(function() { console.log("this will be executed when corresponding tab is on focus"); if (tab.status == Loader.Ready) { tab.item.obj = products.get("CR2001W"); } }); } } } @ by extension, I should be putting callbacks on component.statusChanged as well... this gets ugly pretty fast. Refactor this on different JS file? how about my Products factory object? will it be available from js? Can I even put imports in plain js?
  • 0 Votes
    1 Posts
    796 Views
    No one has replied
  • QML nested items

    1
    0 Votes
    1 Posts
    512 Views
    No one has replied
  • QML Listview subitems

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Can't use "select" html tag with WebView

    1
    0 Votes
    1 Posts
    525 Views
    No one has replied
  • How to generate GUID using QML/Qt Quick?

    3
    0 Votes
    3 Posts
    6k Views
    L
    Hi! Easy way out would be just to generate it with javascript. for example, see "this stackoverflow question":http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript If you wanna do it with QUuid, however, since it's not a QObject you probably need a stub QObject with static method returning new GUID, something like @ #include <QObject> #include <QUuid> class Utils : public QObject { Q_OBJECT public: Q_INVOKABLE static QString generateGUID() const { return QUuid::createUuid().toString(); } } @ then just register that with qmlRegisterType
  • Create a "Identified Module" does not work

    1
    0 Votes
    1 Posts
    512 Views
    No one has replied
  • Bold text disappears when changing translation and default font

    2
    0 Votes
    2 Posts
    697 Views
    U
    This only seems to happen with the Japanese prerendered font bundled with Qt. Other TTF works okay.
  • 0 Votes
    1 Posts
    801 Views
    No one has replied
  • [SOLVED] Crash of app when exchanging objects from C++ to QML

    4
    0 Votes
    4 Posts
    2k Views
    GianlucaG
    I solved setting the parent of TraitObject to the C++ object that creates and maintains it. In this way, the QML does not take ownership because it see that has a parent and it suppose that the parent manages the object.
  • [Solved] How to translate text in a listmodel? (qsTr, QT_TR_NOOP)

    5
    0 Votes
    5 Posts
    9k Views
    N
    You can use plain list of JS object instead of ListModel. Example: @ id: root // define plain JS object list property var model: [ { title: qsTr("Airplane"), descr: qsTr("Some descr 1") }, { title: qsTr("Car"), descr: qsTr("Some descr 2") }, { title: qsTr("Credit Card"), descr: qsTr("Some descr 3") } ] ListView { model: root.model delegate: Rectangle { height: 20 // cross operability with ListModel and plain JS object list property var item: model.modelData ? model.modelData : model Text { text: item.title + " " + item.descr } } } @
  • Module "Qt3D.Shapes" is not installed

    5
    0 Votes
    5 Posts
    4k Views
    G
    ok thanks
  • How to get mouse click event on widget component

    2
    0 Votes
    2 Posts
    1k Views
    A
    Hi, Does your C++ widgets send mouse signal ? If so try to catch it. It is an idéa i have not yet done a customn widget from C++ Sincerely
  • 0 Votes
    2 Posts
    2k Views
    R
    Ok, I found it out by myself. I have to call the createObject() method on the QmlComponent instance. @ var testScreen = Qt.createComponent("TestScreen.qml").createObject(parent); @