Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • [solved] Dynamically adding items

    3
    0 Votes
    3 Posts
    874 Views
    D
    Oops, you're right! The status is 3 (Component.Error), and the errorString showed there was an error in the qml file I was trying to load. Thanks for the hint!
  • QtQuickItem with custom opengl draw - after first frame, item dissapear

    3
    0 Votes
    3 Posts
    1k Views
    K
    pleas Qt guys, does anyone know where is problem?
  • [SOLVED] QML ScreenSaver element in Qt 5.x?

    9
    0 Votes
    9 Posts
    5k Views
    A
    Fo screensaver I had to go down in java.
  • Rectangle as a root error in QtQuick project

    4
    0 Votes
    4 Posts
    2k Views
    JKSHJ
    You're welcome :) [quote author="freddy311082" date="1401503871"]when is it better use QQmlApplicationEngine and QQuickView ??[/quote]If you want a top-level QML window that has a menubar, statusbar and/or toolbar, then you should use QQmlApplicationEngine (with "ApplicationWindow":http://qt-project.org/doc/qt-5/qml-qtquick-controls-applicationwindow.html as your root). If you want to embed a QML GUI inside a widget GUI, you should use QQuickView (Qt 5.0 -- Qt 5.2) or QQuickWidget (Qt 5.3 and later). But if you don't need either of these, then it doesn't really matter which one you choose.
  • 0 Votes
    12 Posts
    4k Views
    jeremy_kJ
    Input handling can be pretty confusing, for developers and users.
  • Emit is not working when calling on a separate android thread

    2
    0 Votes
    2 Posts
    1k Views
    jeremy_kJ
    I wonder if the problem is due to the use of a static signal. Cross-thread signal delivery uses an event loop in the receiving thread. Intra-thread delivery is a direct call by default. The static use might confuse the detection of the correct connection type.
  • Error in runtime module "Customer" is not installed

    1
    0 Votes
    1 Posts
    534 Views
    No one has replied
  • 0 Votes
    6 Posts
    4k Views
    G
    Hi,shav Thanks for your reply! Here is a sample XML file "XML":http://i.imgur.com/HBdVeZI.png And here is the screenshot I want."view":http://i.imgur.com/QpXjDpJ.png Different components may have different Pins and Bindings in XML. So,I can have 2 LED with different pins. The list items in [Component] list box should be generated dynamically according to Modules.Component in XML. [Binding] column is list box with selection items in XML, and the binding items in list box differs base on the selection of [Component].
  • 0 Votes
    3 Posts
    1k Views
    J
    Hi, thanks a lot for the tip. I found the code I'm using here: http://answer.techwikihow.com/297416/ask-confirmation-before-closing-qquickview-qapplication.html I now tried another approach and installed an eventFilter which filters QEvent::Close. The code now looks like this: @class Window : public QtQuick2ApplicationViewer { QmltoCpp* qmltocpp; public: void setQmlClass(QmltoCpp* &qmlClass) { qmltocpp = qmlClass; } protected: bool eventFilter(QObject *obj, QEvent *ev) { if (ev->type() == QEvent::Close) { qmltocpp->exit(); return true; } else { return false; } } }; int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); Window viewer; viewer.installEventFilter(&viewer); viewer.setMainQmlFile(QStringLiteral("qml/MyApp/main.qml")); viewer.showExpanded(); return app.exec(); } @ The function qmltocpp->exit() writes the settings to database and then closes the app by calling @QGuiApplication::quit();@ It works as before on Windows 7, tomorrow I'll try it on my Windows 8 tablet. I hope it will work now.
  • QML row/column issues - Qt 5.3

    7
    0 Votes
    7 Posts
    2k Views
    J
    try: @brdImg: "qrc:/resources/MANO_Icon_Foto.png"@
  • Question on Animation

    3
    0 Votes
    3 Posts
    871 Views
    p3c0P
    Hi, AFAIK, the animation wont stop even if the visibility is turned to false.
  • Aggregating other QQuickPaintedItem derived Class.

    1
    0 Votes
    1 Posts
    464 Views
    No one has replied
  • How to use normal distribution in qt

    4
    0 Votes
    4 Posts
    4k Views
    JKSHJ
    [quote author="prabhatjha" date="1401269566"]i have already tried this example but in qt its not helpful.[/quote]Why?
  • QML focus iteating with QPlatformInputContext

    1
    0 Votes
    1 Posts
    857 Views
    No one has replied
  • Draw without paintevent

    2
    0 Votes
    2 Posts
    777 Views
    p3c0P
    Hi, Do you mean you want to draw an ellipse without paint() ? What is your class derived from ? Also to call a function from QML you need to register your class and make the function "Q_INVOKABLE":http://qt-project.org/doc/qt-5/qobject.html#Q_INVOKABLE
  • Usage of setContextProperty

    11
    0 Votes
    11 Posts
    5k Views
    ?
    Yes you are right. Qt creator is not able to highlight the context property's name during compile time. But in runtime it works fine. I was trying to find a solution to remove this warning during compile time. But still i didn't find a right soln. I think usage of QStringLiteral will solve this issue in unicode enabled settings.
  • Updating qml child label element text after completing a function in C++

    4
    0 Votes
    4 Posts
    3k Views
    jeremy_kJ
    Another approach is to declare a property in C++ object, register the class or an instance with the QML engine, and emit the property's update signal when the value should be re-read from QML.
  • What is the QML equivalent of QDataWidgetMapper?

    1
    1 Votes
    1 Posts
    962 Views
    No one has replied
  • Using custom QSqlTableModel from QT Quick QML file

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, It requires a little more work than that. Have a look at this "wiki entry":http://qt-project.org/wiki/How_to_use_a_QSqlQueryModel_in_QML
  • How to emit signal with variable as reference from qml to c++

    2
    0 Votes
    2 Posts
    1k Views
    M
    Hi there. I came up with a quick example that does what you want but with strings instead. Should follow the same concept for objects. main.qml @import QtQuick 2.0 Item { width: 800 height: 600 signal listSignal(var list) property variant stringList: ["one", "two", "three"] Timer { interval: 2000 onTriggered: listSignal(stringList) running: true } } @ main.cpp @#include <QtGui/QGuiApplication> #include "qtquick2applicationviewer.h" #include "signalcatcher.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile&#40;QStringLiteral("qml/Testing/main.qml"&#41;); viewer.showExpanded(); SignalCatcher signalCatcher(viewer.rootObject()); return app.exec(); } @ signalcatcher.h @#ifndef SIGNALCATCHER_H #define SIGNALCATCHER_H #include <QObject> #include <QVariant> class QQuickItem; class SignalCatcher : public QObject { Q_OBJECT public: SignalCatcher(QQuickItem *rootItem, QObject *parent = NULL); private slots: void processList(const QVariant &var); }; #endif // SIGNALCATCHER_H @ signalcatcher.cpp @#include <QQuickItem> #include "signalcatcher.h" SignalCatcher::SignalCatcher(QQuickItem *rootItem, QObject *parent) : QObject(parent) { connect(rootItem, SIGNAL(listSignal(QVariant)), this, SLOT(processList(QVariant))); } void SignalCatcher::processList(const QVariant &var) { QStringList list = var.toStringList(); for(int i = 0; i < list.size(); i++) { qDebug(list[i].toStdString().c_str()); } } @