Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • 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()); } } @
  • Event handling

    2
    0 Votes
    2 Posts
    915 Views
    M
    Take a look at "this":http://qt-project.org/doc/qt-5/qml-qtquick-flickable.html Especially the components that inherit this class ie: "ListView":http://qt-project.org/doc/qt-5/qml-qtquick-listview.html
  • Troubles with QtclConsole

    1
    0 Votes
    1 Posts
    526 Views
    No one has replied
  • TypeError: Type error ?

    4
    0 Votes
    4 Posts
    5k Views
    p3c0P
    Ok, Questions: What is position_cursor and number_inputted ? What are its Data Types ? How are they declared ?
  • 0 Votes
    1 Posts
    447 Views
    No one has replied
  • Deploying an application using QtQuick controls

    1
    0 Votes
    1 Posts
    527 Views
    No one has replied
  • How to change source

    3
    0 Votes
    3 Posts
    978 Views
    mrdebugM
    I have used Loader to embed in the main qml file the new files, as pages but I don't like so mutch this approach. With Declarative I can change the screen as I want.