Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • How to use singleton in another singleton

    1
    0 Votes
    1 Posts
    761 Views
    No one has replied
  • [SOLVED]how to enable QtQuick.Controls 1.3

    1
    0 Votes
    1 Posts
    706 Views
    No one has replied
  • Showing information database

    6
    0 Votes
    6 Posts
    1k Views
    JKSHJ
    Hi, [quote author="aemgborges" date="1416605355"]Oops, I have not tried anything, I do not know how I can do this, can give me a help?[/quote]Break your problem into small parts. Learn how to "create a program with a screen":http://qt-project.org/doc/qt-5/gettingstartedqt.html first. After that, learn "basic SQL":http://www.sqlcourse.com/intro.html. After that, learn "how to use SQL in Qt":http://qt-project.org/doc/qt-5/sql-programming.html. After that, combine all of the above.
  • Can all Qml files be loaded from memory?

    2
    0 Votes
    2 Posts
    837 Views
    timdayT
    One gotcha (admittedly extreme conditions): I have a Qt app with about 2GByte of resources (a LOT of jpgs and mp4 contents). Baking them into a qrc (for convenience) worked great on my 64bit desktops but failed on iOS, apparently because the qrc is accessed by memory mapping and there's not enough (contiguous) address space on 32bit iOS for the monster I had. Bit more at http://qt-project.org/forums/viewthread/41012/
  • Facebook connect with Qt 5.3

    10
    0 Votes
    10 Posts
    6k Views
    GianlucaG
    I started to collect my code for using Facebook SDK into the following project: https://github.com/GMaxera/QtFacebook For now there is only the login for iOS platform. During the next week, I'll add more functionality and Android support. Take a look. Of course, it's very small respect to other project but... Respect to V-play plugin, it's free ... but require more effort for you to use, because you need to install it manually. Respect to Nemo Mobile project, you don't have to write any OAuth2 code for login and it will support the latest open graph API because I directly use the native Facebook SDK. So, it's easier.
  • [SOLVED] How to disable screen rotation on condition

    6
    0 Votes
    6 Posts
    2k Views
    M
    [quote author="p3c0" date="1416553159"]I think it will require using QAndroidJniObject and calling the native api as the screen rotation is handled by OS. [/quote] Yeah, thanks, i set it with JNI call of setRequestedOrientation. [quote author="mcm_qt" date="1416582887"] In AndroidManifest.xml you have option, on which all orientation does the app have to work on. When you check You can see similar like, <activity android:name="com.android" android:label="text" android:screenOrientation="portrait". ... </activity>[/quote] I know that orientation can be set in manifest, but that about how to change it at runtime.
  • Do not have Charts module in qml (solved)

    3
    0 Votes
    3 Posts
    873 Views
    M
    Or else You can check Qt Plot ... see here "http://www.qcustomplot.com/" :)
  • Scroll TextArea to end

    4
    0 Votes
    4 Posts
    4k Views
    p3c0P
    I haven't come across any built-in property will always display TextArea with contents scrolled to Bottom. Another way would be to do some math and set TextArea's flickableItem.contentY.
  • Troubles passing a list<> from Qml to C++

    2
    0 Votes
    2 Posts
    1k Views
    C
    Hi, I cannot reproduce your issue, using Qt 5.3 Here is my code: listprop.pro: @ QT += qml quick SOURCES += main.cpp HEADERS += ListPropTest.h FILES += test.qml TARGET=listprop @ ListPropTest.h: @ #ifndef LISTPROPTEST_H #define LISTPROPTEST_H #include <QObject> #include <QVariant> #include <QQmlListReference> #include <QtDebug> class ListPropTest : public QObject { Q_OBJECT Q_PROPERTY(QVariant listRef READ listRef WRITE setListRef NOTIFY listRefChanged) public: ListPropTest(QObject *parent = 0) : QObject(parent) {} Q_INVOKABLE void doTest(const QVariant &listprop) { m_listref = listprop.value<QQmlListReference>(); for (int i = m_listref.count() - 1; i >= 0; --i) { qDebug() << "CPP: new list: " << m_listref.at(i); } emit listRefChanged(); } QVariant listRef() const { return QVariant::fromValue<QQmlListReference>(m_listref); } void setListRef(const QVariant &listprop) { doTest(listprop); } Q_SIGNALS: void listRefChanged(); private: QQmlListReference m_listref; }; #endif @ main.cpp: @ #include <QtGui/QGuiApplication> #include <QQmlContext> #include <QQmlEngine> #include <QQuickView> #include <qqml.h> #include <QtDebug> #include "ListPropTest.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQuickView viewer; ListPropTest test; viewer.engine()->rootContext()->setContextProperty("listPropTest", &test); viewer.setSource(QStringLiteral("test.qml")); viewer.show(); return app.exec(); } @ test.qml @ import QtQuick 2.0 Item { id: root property list<QtObject> objectsA: [ QtObject { id: aOne; objectName: "aOne" }, QtObject { id: aTwo; objectName: "aTwo" } ] property list<QtObject> objectsB: [ QtObject { id: bOne; objectName: "bOne" }, QtObject { id: bTwo; objectName: "bTwo" } ] onObjectsAChanged: { console.log("ObjectsA Changed!") for (var a in objectsA) { console.log(objectsA[a]) } } onObjectsBChanged: { console.log("ObjectsB Changed!") for (var b in objectsB) { console.log(objectsB[b]) } } Timer { running: true interval: 2000 repeat: true property int triggerCount: 0 onTriggered: { triggerCount++ if (triggerCount == 1) { listPropTest.listRef = objectsA //or: listPropTest.doTest(objectsA) } else if (triggerCount == 2) { listPropTest.listRef = objectsB //or: listPropTest.doTest(objectsB) // check that objectsA is still valid, not cleared for (var a in objectsA) console.log("QML: old list: " + objectsA[a]) } else { // ensure that there was no delete-later style delayed deletion for (var a in objectsA) console.log("QML: old list: " + objectsA[a]) repeat = false; running = false; } } } } @ After running for 6 seconds, the objects in the objectsA list remain valid and not deleted. Perhaps the object which you reference the list property from somehow goes out of scope or otherwise gets deleted, rendering the list property invalid? Cheers, Chris.
  • Rotate and new coordinate

    1
    0 Votes
    1 Posts
    440 Views
    No one has replied
  • [SOLVED] Qml Deployment Problem

    2
    0 Votes
    2 Posts
    2k Views
    E
    Well, possible solution is Use QQuickView instead of QQmlApplicationEngine For static build create "QtQuick.2" dir with "qmldir" file and this content: @module QtQuick plugin qtquick2plugin classname QtQuick2Plugin typeinfo plugins.qmltypes@
  • 0 Votes
    3 Posts
    20k Views
    S
    [quote author="shav" date="1416474756"]Hi Stavros Filippidis, For Qt Quick you must use this format of command: @ macdeployqt <application_bundle> -qmldir=<path_to_root_folder_of application_qml_files> -execute=<application_bundle>/Contents/MacOS/<app_name> @ where: qmldir - this argument need to macdeployqt for analyse your mL files and find all plugins which you used in your app. All plugins will be copy to your app bundle. execute - I use scrip so I'm not sure about this argument. For mo information you could fine in "this topic":http://qt-project.org/forums/viewthread/48391/.[/quote] Thanks! Actually, only the -qml parameter was enough! @macdeployqt <application_bundle> -qmldir=<path_to_root_folder_of_application_qml_files>@ It gives a number of warnings such as @File exists, skip copy: "/Users/<username>/build-<app_name>-Desktop_Qt_5_3_0_clang_64bit-Release/<app_name>.app/Contents/Resources/qml/QtQuick/Layouts/qmldir"@ but, other than that, it works! I had previously tried the -qml parameter, but it was using a relative path such as @~/<qml_folder>@ and it didn't work! This time I used an absolute path such as @/Users/<username>/<qml_folder>@ and it worked just fine!
  • After installing Qt I have no compilers set

    2
    0 Votes
    2 Posts
    750 Views
    SGaistS
    Hi and welcome to devnet, This question has been asked many times, please search the forum. You likely don't have Visual Studio 2012 installed on your computer. You must first get it from Microsoft's web site. If you'd like to avoid that, then install the MinGW package
  • [Solved] Access violation when creating a Qt Quick component

    2
    0 Votes
    2 Posts
    2k Views
    J
    I figured it out. It turns out that I used some version of the following DLL files: Qt5Qml.dll Qt5Quick.dll Qt5QuickParticles.dll Qt5Core.dll Qt5Gui.dll Qt5Network.dll icuuc52.dll icudt52.dll icuin52.dll libEGL.dll libGLESv2.dll These files were copied from this location: D:\Qt\Qt5.3.1\5.3\msvc2013\bin. However, the same files also exist in D:\Qt\Qt5.3.1\Tools\QtCreator\bin. While they are tagged with the same version, some have the same size, but different content. Using the files from the first location produces the crash (on the target PC only, not on my workstation), while copying them from the second location runs fine everywhere. I am quite unlucky with these DLLs, as previously I already had text rendering issues with libEGL.dll and libGLESv2.dll. I wonder why two "versions" of these files exist.
  • Mixed QML and c++ object

    2
    0 Votes
    2 Posts
    689 Views
    p3c0P
    Hi, Did you try animating the opacity property ?
  • [Solved] Does anyone know how to solve this error I get in c++

    1
    0 Votes
    1 Posts
    586 Views
    No one has replied
  • How to create two rectangle side by side in Qt Quick

    1
    0 Votes
    1 Posts
    705 Views
    No one has replied
  • Module "QtSystemInfo" is not installed.

    1
    1 Votes
    1 Posts
    2k Views
    No one has replied
  • How to create array of similar graphical objects in qml?

    1
    0 Votes
    1 Posts
    687 Views
    No one has replied
  • 0 Votes
    1 Posts
    558 Views
    No one has replied