Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Rotated Quick WebView Clipping Problem

    1
    0 Votes
    1 Posts
    683 Views
    No one has replied
  • Multi-User Touch input on Multiple Areas

    1
    0 Votes
    1 Posts
    554 Views
    No one has replied
  • Reusable SequentialAnimation

    3
    0 Votes
    3 Posts
    2k Views
    J
    And it's so obvious is retrospect. Thanks!
  • Qt Quick 2.0 how to publish viewer class to QML [ SOLVED ]

    4
    0 Votes
    4 Posts
    2k Views
    sierdzioS
    Pleasure. Happy further coding!
  • Howto protect my app from xml bombs?

    1
    0 Votes
    1 Posts
    550 Views
    No one has replied
  • QQuickView vs QDeclarativeView

    5
    0 Votes
    5 Posts
    5k Views
    S
    Hi, Thanks for the tip! I derived from your source that using QQmlComponent was the way to go. I have implemented that now, and added QMetaObject::connectSlotsByName to boot, so now everything - loading the plugin, creating the QML, connecting slots and signals between the two - is handled in just one method. Very nice! Now all I need is just slot names that correspond with the signal in the QML file.
  • QtQuick 2 application crash

    2
    0 Votes
    2 Posts
    1k Views
    C
    I assume the Q_PROPERTY(SubClass sub...) was actually Q_PROPERTY(SubClass *sub...) as required for QObjects exposed to QML? The backtrace suggests that the crash actually occurs due to a bound signal handler (an onSomethingChanged function). Are you certain that it's the resolution of root.sub.listofsubobjects which is causing the crash? (If so, the backtrace suggests that it is identifying the QList<QObject*> as a QObject* ... which seems unlikely, as we do handle QList<QObject*> correctly in several different codepaths). Are you able to post a complete, minimal example which exhibits this bug? Thanks, Chris.
  • MultiPointTouchArea not working?

    2
    0 Votes
    2 Posts
    830 Views
    S
    Problem solved: my touch screen was the issue, someone in the office switched it out accidentally.
  • [SOLVED] Transition in a row works only once.

    2
    0 Votes
    2 Posts
    709 Views
    M
    I found a solution : @ import QtQuick 2.0 Rectangle { width: 200 height: 50 Row { id: row Rectangle { id: rect1; color: "green"; height: 50} Rectangle { id: rect2; color: "blue"; height: 50} Rectangle { id: rect3; color: "red"; width: 50; height: 50; MouseArea { anchors.fill: parent onClicked: { if (row.state == "one") row.state = "all" else row.state = "one" } } } state: "one" states: [ State { name: "one" PropertyChanges { target: row; spacing: 0 } PropertyChanges { target: rect1; width: 0 } PropertyChanges { target: rect2; width: 0 } }, State { name: "all" PropertyChanges { target: row; spacing: 10 } PropertyChanges { target: rect1; width: 50 } PropertyChanges { target: rect2; width: 50 } } ] transitions: Transition { ParallelAnimation{ NumberAnimation { property: "spacing"; duration: 2000; easing.type: Easing.Linear } NumberAnimation { property: "x"; duration: 2000; easing.type: Easing.Linear } NumberAnimation { properties: "width"; duration: 2000; easing.type: Easing.Linear } } } } } @
  • Binding in a looping Sequential Animation doesn't work?

    1
    0 Votes
    1 Posts
    620 Views
    No one has replied
  • 'Repeater' not displaying the data from its DataModel in fetched sequence

    1
    0 Votes
    1 Posts
    562 Views
    No one has replied
  • Extending QML - When is the parent set?

    10
    0 Votes
    10 Posts
    5k Views
    J
    The itemchange() method informs you when the parent is set. @RenderWindow::itemChange( ItemChange change, const ItemChangeData& value ) { switch ( change ) { case QQuickItem::ItemParentHasChanged: // value.item and parent() both contain the new parent } }@
  • Implementing filedownloader to QML

    2
    0 Votes
    2 Posts
    814 Views
    S
    Hi, in your example code you do: @void FileDownloader::fileDownloaded(QNetworkReply* pReply) { qDebug()<<"Download successful!"; m_DownloadedData = pReply->readAll(); QFile file("D:\Test.jpg"); file.open(QIODevice::WriteOnly); file.write(pReply->readAll()); //emit a signal pReply->deleteLater(); emit downloaded(); } @ the line "m_DownloadedData = pReply->readAll();" creates this issue, after this line, the buffer of your network reply is empty, and the data is inside "m_DownloadedData" a few lines lower, you try to save the image by doing: "file.write(pReply->readAll());" but the buffer is already empty... so you shoud do: "file.write( m_DownloadedData );" i should do, @ void FileDownloader::fileDownloaded(QNetworkReply* pReply) { qDebug()<<"Download successful!"; QFile file("D:\Test.jpg"); if( !file.open(QIODevice::WriteOnly) ) return; // file could not be created file.write(pReply->readAll()); //emit a signal pReply->deleteLater(); emit downloaded(); } @ and remove the variable "m_DownloadedData" for your second issue, you also have to include the macro QML_DECLARE_TYPE(CLASSNAME) in your header file, before you can use the qmlRegisterType method. so: @ //filedownloader.h #ifndef FILEDOWNLOADER_H #define FILEDOWNLOADER_H #include <QtQml> // add for QML_DECLARE_TYPE macro !!!!! #include <QObject> #include <QByteArray> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> class FileDownloader : public QObject { Q_OBJECT public: explicit FileDownloader(QUrl imageUrl, QObject *parent = 0); virtual ~FileDownloader(); QByteArray downloadedData() const; signals: void downloaded(); private slots: void fileDownloaded(QNetworkReply* pReply); private: QNetworkAccessManager m_WebCtrl; QByteArray m_DownloadedData; }; QML_DECLARE_TYPE( FileDownloader ) // marco !! #endif // FILEDOWNLOADER_H @
  • When is the gl context set?

    1
    0 Votes
    1 Posts
    565 Views
    No one has replied
  • Assign C++ object to Text element (implicit conversion to QString)

    5
    0 Votes
    5 Posts
    2k Views
    S
    Hi JKSH, thank you very much.
  • Using QtQuick Location Map with C++ QGeoMap* items

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Set Direction for ParallelAnimation or PropertyAnimation

    2
    0 Votes
    2 Posts
    711 Views
    p3c0P
    Well after searching i didnt get anything equivalent directly in ParallelAnimation or PropertyAnimation But seems that this can be achieved using Transitions and States.
  • Getting the opengl context for sharing

    1
    0 Votes
    1 Posts
    615 Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    A
    Anyone find a way to set NativeRendering App wide?
  • QtQuick2: Drag and Drop between two ListViews

    2
    0 Votes
    2 Posts
    1k Views
    B
    Hi, I'm actually looking at something similare, did you get anywhere ?