Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Listview item's z-order and view range

    5
    0 Votes
    5 Posts
    5k Views
    S
    @clip: true @ it did the job very well.... :)
  • [SOLVED]What is optimal way of "combining" XmlLIstView and ListView?

    13
    0 Votes
    13 Posts
    5k Views
    C
    Denis, btw your code didn't work the way it meant to be, only adding "progress" helped it: @ onStatusChanged: { if (status == vendorsModel.Ready, progress ==1.0) { var vendortitle = vendorsModel.get(1).vendortitle vendorsModelNonXml.append({"vendortitle":vendortitle}) } }@ Weird...
  • How to delete a QDeclarativeItem in cpp?

    8
    0 Votes
    8 Posts
    4k Views
    S
    You should take a look at the way QDeclarative hanldes dynamic items at http://doc.qt.nokia.com/4.7/qdeclarativedynamicobjects.html
  • Qml Image downloading error

    5
    0 Votes
    5 Posts
    4k Views
    G
    Hi There is indeed some user agent filtering issue with operator network. To bypass this issue, you'll have to define a custom network access manager factory (subclass) and set it in the context of your declarative engine ("link":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeengine.html#setNetworkAccessManagerFactory) : @ class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory { public: explicit NetworkAccessManagerFactory(QString p_userAgent = ""); QNetworkAccessManager* create(QObject* parent) { CustomNetworkAccessManager* manager = new CustomNetworkAccessManager(__userAgent, parent); return manager; } private: QString __userAgent; }; @ Then you'll have to subclass QNetworkAccessManager in order to hook the creation of http request : @ class CustomNetworkAccessManager : public QNetworkAccessManager { Q_OBJECT public: explicit CustomNetworkAccessManager(QString p_userAgent = "", QObject *parent = 0); protected: QNetworkReply *createRequest( Operation op, const QNetworkRequest &req, QIODevice * outgoingData=0 ) { QNetworkRequest new_req(req); new_req.setRawHeader("User-Agent", __userAgent.toAscii()); QNetworkReply *reply = QNetworkAccessManager::createRequest( op, new_req, outgoingData ); return reply; } private: QString __userAgent; }; @ Then you can define a helper class to retrieve the same user agent as the one used by Qt webkit : @ class UserAgentProvider : public QWebPage { Q_OBJECT public: explicit UserAgentProvider(QWidget *parent = 0); QString getUserAgent() { return userAgentForUrl(QUrl("")); } }; @ Finally you set the network access factory class in your QML context (for instance in main.cpp) : @ // Set custom NetworkAccessManagerFactory object in QDeclarative context UserAgentProvider p; QString userAgent = p.getUserAgent(); NetworkAccessManagerFactory factory(userAgent); viewer.engine()->setNetworkAccessManagerFactory(&factory); @ Nicolas
  • Sqlite + qt 4.7.1 + vs 2008

    2
    0 Votes
    2 Posts
    2k Views
    L
    How have you installed it on the other PC and what error did you? Have you installed the sqlite database to the other PC or just the Qt application? Cheers, Leon
  • How to use XML source as a data type, not a list model?

    2
    0 Votes
    2 Posts
    3k Views
    M
    Hi, There isn't an element like this yet, but it is one we'd like to add. For reference, the task for this is "QTBUG-12953":http://bugreports.qt.nokia.com/browse/QTBUG-12953. As a workaround, you may be able to use XmlListModel with "get":http://doc.qt.nokia.com/4.7-snapshot/qml-xmllistmodel.html#get-method to work with the data as though it were a "list of one element". Regards, Michael
  • QML and XML List Model

    2
    0 Votes
    2 Posts
    4k Views
    P
    Ok, I think I got it, I was using /TubeToday/lines/line instead of /Lines/Line, big L not the small l :)
  • Add QDeclarativeView widget to MainWindows.ui cause link error

    6
    0 Votes
    6 Posts
    5k Views
    D
    then please don't forget to mark thread as [solved].
  • Debug javascript in QML possible?

    4
    0 Votes
    4 Posts
    5k Views
    T
    Most likely the QDeclarativeView does not start the debugging support. This feature is turned off unless specifically set up since being able to debug a application can be a security issue.
  • QML syntax highlighting in Vim

    10
    0 Votes
    10 Posts
    18k Views
    B
    I was wondering if you have already or were planning on pushing this upstream to the vim team?
  • Error: 'qt_metatype_id' is not a member of 'QMetaTypeId<PlaylistModel>'

    10
    0 Votes
    10 Posts
    15k Views
    J
    I googled a bit and found this blog. It seems to explain what you want: http://cdumez.blogspot.com/2010/11/how-to-use-c-list-model-in-qml.html
  • Performance trick - is it for real? what is "the boost" - anyone tried?

    2
    0 Votes
    2 Posts
    2k Views
    frankcyblogic.deF
    As far as I know the rendering goes through the OpenVG backend by default. (At least I get errors from it from time to time.) Dr. google "says":http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0380d/CIHJJCGH.html OpenVG has overdrawing issues. So this tip is a nice one;)
  • XmlListModel - Host requires authentication

    5
    0 Votes
    5 Posts
    5k Views
    A
    Hi all, any idea? thanks, ayden
  • Qml network can't work on device?

    12
    0 Votes
    12 Posts
    6k Views
    A
    ok, sorry, then I don't know.
  • Creating a QAbstractItemModel plugin object from QML?

    6
    0 Votes
    6 Posts
    4k Views
    A
    Indeed! Looking forward to seeing your magic, Gordon!
  • Best way to scroll on mouse move to "edge/out of" of screen

    3
    0 Votes
    3 Posts
    3k Views
    I
    Yes, that's the trick. Only by faking (c++) a mouse click I would be able to do that. As it stands, I'm trying to find a suitable animation and its values to simulate deceleration.
  • [Solved] Redirecting log messages

    2
    0 Votes
    2 Posts
    3k Views
    A
    Just use the standard Qt way to re-direct log messages (qInstallMsgHandler, look it up in the docs).
  • Can only execute application from editor

    6
    0 Votes
    6 Posts
    3k Views
    H
    It was indeed the path. I changed the line to: @viewer.setMainQmlFile(QString(QCoreApplication::applicationDirPath() + "/qml/TraktorScrobbler/main.qml"));@ It now works. Now I've to work on a way to embedd all the qml-crap in the exe-file.
  • Change QML-property in C++

    9
    0 Votes
    9 Posts
    12k Views
    A
    Indeed: first setup the context with the mediator object, and then set the QML.
  • 0 Votes
    6 Posts
    10k Views
    M
    [quote author="Aleskey78" date="1303974743"]what kind of syntax is used for this? Like normal JS ?: @object.property = function() {...}@ [/quote] Yes, that's correct. If you do a "make docs" in the source tree, you should be able to see the documentation for this -- I'm still trying to track down why it isn't showing up online for the 4.7-snapshot docs. Regards, Michael