Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Performace Problem with Text

    8
    0 Votes
    8 Posts
    2k Views
    F
    Hey, i just installed the 5.3.0 RC. The problem is solved with this release. Thanks! Greets Nico
  • Bad Resolution of SVG's on iOS and Mac Retina Displays

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to unpack all the data's in C++ of type QVariant that send from QML

    2
    0 Votes
    2 Posts
    1k Views
    sierdzioS
    Try this: @ QVariant qmlData; QVariantList temp = qmldata.value<QVariantList>(); foreach (QVariant var, temp) { QObject *myObject = var.value<QObject *>(); if (myObject) { // yay! } } @
  • Re-size Image

    1
    0 Votes
    1 Posts
    506 Views
    No one has replied
  • Seg fault: WorkerScript.onMessage called after destructor

    2
    0 Votes
    2 Posts
    807 Views
    U
    Filed a bug: https://bugreports.qt-project.org/browse/QTBUG-38863 Loader and WorkerScript don't work well together.
  • How to get all the elements of qml file dynamically in C++ class

    2
    0 Votes
    2 Posts
    678 Views
    T
    Is it enough for you: http://qt-project.org/doc/qt-5/qtqml-cppintegration-interactqmlfromcpp.html ?
  • QML big memory consumption?

    12
    0 Votes
    12 Posts
    9k Views
    X
    I don't know if there are any performance comparison charts for Qt/QML apps (maybe one will create some, who knows), but I have currently two Qt Quick 2 apps and they usually use 40-60 Mb memory and not more, they are text, image and network heavy and use multiple screens and stuff, so not the simplest app every I would say.
  • [SOLVED]Qml OpenGL Shaders requirements

    9
    0 Votes
    9 Posts
    3k Views
    S
    all of these are no surprise. whatever driver you're using on desktop, it sucks. likely it's nvidia, and they let just about any bad-behavior code go.. if ( r < (range - depth) || r > (range + depth) ) return; ^ that should result in garbage data, which it did. either you always define gl_fragcolor, or you use discard and the fragment shader will not run for that fragment.(which could potentially result in garbage). same with the explicit type usages, one should always be explicit in any type conversions. it's just the way glsl is, and nvidia is very annoying in the sense that they allow broken code.
  • Blur effect for Rectangle

    4
    0 Votes
    4 Posts
    4k Views
    sierdzioS
    [quote author="freddy311082" date="1399480977"]because the rectangle can be in any place over my application, so, I can't have an exactly component as source....[/quote] That has nothing to do with the blur effect, it still needs to be applied over your semi-transparent rectangle. Best option is to make it fill it's parent. And if you need to place it in an arbitrary place, then do that with the base Rectangle, not with the blur. In any case, please check the console log. I am almost certain the QML engine is printing some errors because you are mixing anchors and fixed coordinates. In that case, don't be surprised it does not work ;-)
  • Polling for SDL events in a custom QObject-derived C++ class?

    2
    0 Votes
    2 Posts
    2k Views
    P
    If the API that you are using for polling events is blocking, then a thread is the only option. Otherwise you can install a even filter at either the QApplication or your top level widget and do you work whenever a paint event comes. In case of QML, I dont remember the exact details but scenegraph renders emit frame start and frameend signals. A simple search on google should give you the exact api. Just be aware if the poll method will take a long time thread approach will be better
  • Is any Auto Repeat function for image in qml?

    4
    0 Votes
    4 Posts
    3k Views
    M
    thanks favoritas37 i used it. :)
  • ListView, PathView, GridView multiple instance touch event support

    1
    0 Votes
    1 Posts
    571 Views
    No one has replied
  • MultiPointTouchArea don't work, with official example

    5
    0 Votes
    5 Posts
    2k Views
    S
    But, my question is, why qt developers decided to dont handle mouse events by MultiPointTouchArea ? I have resistive laptop with single-touch and it emulates mouse, so MultiPointTouchArea dont work. I think, it should work with mouse for compatibility reasons.
  • 0 Votes
    2 Posts
    3k Views
    G
    ohm... After some study. Maybe I should use the QAbstractItemModel ? Only QML thinks can't achieve my requirement. And, according to parse XML, I have found this "Simple DOM Model Example":http://qt-project.org/doc/qt-5/qtwidgets-itemviews-simpledommodel-example.html . I am not sure the exist class above link provide is what I need. I have kept studying the QAbstractItemModel. Can any one give me some suggestion or examples in QAbstractItemModel + QML to parse XML file? Or maybe it has another approach to achieve my requirement? Thank you!
  • Loading a large list model with a WorkerScript

    4
    0 Votes
    4 Posts
    1k Views
    U
    It also seems like you can't call clear() or append() on the ListModel from the QML when you have a WorkerScript. Even with judicious use of sync() the model and view still get out of sorts.
  • How to enable multi-touch in QML ?

    6
    0 Votes
    6 Posts
    3k Views
    S
    I have system, portable computer, with mouse and touch screen. And i want both to work simultanouesly. In addition, i want to same code without modifications work on tablet with linux (not android) with multitouch screen.
  • [SOLVED] How to call C++ class or function on QML

    8
    0 Votes
    8 Posts
    4k Views
    P
    Hi Kamb!z, Your Welcome to Qt's cross platform world !!! Thanks Prashant Moglaikar
  • QtQuick scenegraph Font rendering

    1
    0 Votes
    1 Posts
    693 Views
    No one has replied
  • How do I actually execute C++ code in Qt Quick?

    10
    0 Votes
    10 Posts
    3k Views
    X
    Ok I think in your case this is the simplest way you ca do it: create a QObject class with your functions and properties, what you want to use from QML, I have created a class claled MyStuff containing a single function "toPigLatin" for this example: @ class MyStuff : public QObject { Q_OBJECT public: explicit MyStuff(QObject *parent = 0) : QObject(parent) {} Q_INVOKABLE QString toPigLatin(const QString &s) { return s.mid(1) + s.left(1) + "ay"; } }; @ you can simply call that function from QML like any other QML function, see below. The function need to be a Qt slot or use the Qt macro Q_INVOKABLE to make it accessible from QML or other scripting languages. in your main.cpp create an Object of the MyStuff class and register the object as the QML context object, there are other ways like I said in an earlier post but in your case this might be the simplest way: @ QtQuick2ApplicationViewer viewer; // you should already have this in your main.cpp MyStuff myStuff; viewer.rootContext()->setContextObject(&myStuff); @ that is all, now you can use the function toPigLatin like any global function from anyway in your QML project, e.g.: @ Rectangle { width: 360 height: 360 MouseArea { anchors.fill: parent onClicked: console.log(toPigLatin("banana")) } } @ that is just the hello world QML code, only changed the onClicked slot to a console log, as you can see it calls the c++ function toPigLatin there. :) In the c++ side of the function you can do whatever you like, keep in mind the input and output parameters to QML will be converted by the QML engine, so you should use compatible types like QString and not std:.string, that won't work here (unless you provide a custom conversion from and to JavaScript). If you need to use a std:.string internally you can just convert the QString to a std::string with QString::toStdString(), but in your case I think QString is the better choice anyways. :)
  • How to get eval&#40;&#41; to operate in the scope of QML element

    10
    0 Votes
    10 Posts
    3k Views
    Q
    I found the solution. Using Qt.include() allows for dynamic reloading of a javascript file at runtime, even if that javascript file has changed.