Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • 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
    860 Views
    No one has replied
  • Draw without paintevent

    2
    0 Votes
    2 Posts
    784 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
    965 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
    939 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
    528 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
    449 Views
    No one has replied
  • Deploying an application using QtQuick controls

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

    3
    0 Votes
    3 Posts
    989 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.
  • How to give a JavaScript function to a qml component [solved]

    3
    0 Votes
    3 Posts
    1k Views
    A
    Hi, i found it. If my component use f(x) and this component is in a file Draw.qml Simply do it @ Draw { function f(x) { return Math.cos(x) } } @ Have a nice day
  • Set size of the a window according to its items

    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    Sorry, my bad, i didn't notice the sub-forum of the question. I currently can't tell from a qml point of view.
  • QML / Akonadi

    2
    0 Votes
    2 Posts
    624 Views
    SGaistS
    Hi and welcome to devnet, Since you want to interface Akonadi, you should rather ask this on the KDE forums. You'll probably have better chances to get a quick answer about that. Looking at the KDE sdk might also give you some hints.
  • 1 Votes
    1 Posts
    899 Views
    No one has replied
  • QML List Model

    2
    0 Votes
    2 Posts
    885 Views
    N
    Right way is to write model in pure C++. QQmlListModel is internal class, so you can not use it from C++.
  • Can't focus on TextField in Intergration Mode

    2
    0 Votes
    2 Posts
    851 Views
    ?
    Someone can help me? Selection doesn't work for the TextInput and TextAreaInput even when it's not read only. this is a bug ?! how can I solve this problem ?