Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Do stuff after behavior with animation is finished in qml

    4
    0 Votes
    4 Posts
    3k Views
    sierdzioS
    So much JS? Both your snippet and mine have exactly 1 line of JS code :P
  • Dynamically generating QML

    3
    0 Votes
    3 Posts
    942 Views
    Q
    Since posting my question, I learned of the native QML techniques for doing this and they have satisfied my interest on this. Happy not to include c++ for this task.
  • Transparent QWindow with QtQuick 2.0

    1
    0 Votes
    1 Posts
    666 Views
    No one has replied
  • QML Quick Controls compile error

    8
    0 Votes
    8 Posts
    6k Views
    sierdzioS
    Of course. Controls are based on Scenegraph and require QtQuick 2 (and Qt5).
  • QsTr in javascript file +translator.tr

    1
    0 Votes
    1 Posts
    722 Views
    No one has replied
  • 0 Votes
    1 Posts
    697 Views
    No one has replied
  • Button won't click when embedded in QWidget

    1
    0 Votes
    1 Posts
    601 Views
    No one has replied
  • Strong Flickering in QGLWidget as viewport

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Variant properties in Design mode

    1
    0 Votes
    1 Posts
    536 Views
    No one has replied
  • Package / DelegateModel with custom components

    2
    0 Votes
    2 Posts
    948 Views
    V
    I've finally found a working solution, but I find the code quite ugly, so any suggestion to make it look better would be highly appreciated. Main.qml (custom views are represented here by rectangles of different colors) : @ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQml.Models 2.1 ApplicationWindow { id: window title: qsTr("Hello World") width: 640 height: 480 ObjectModel { id: objectsList Component { id: view1; Rectangle { width: 100; height: 25; color: "red" } } Component { id: view2; Rectangle { width: 100; height: 25; color: "blue" } } Component { id: view3; Rectangle { width: 100; height: 25; color: "green" } } Component { id: view4; Rectangle { width: 100; height: 25; color: "yellow" } } Component { id: view5; Rectangle { width: 100; height: 25; color: "cyan" } } Component { id: view6; Rectangle { width: 100; height: 25; color: "magenta" } } } DelegateModel { id: visualModel delegate: Delegate {} model: objectsList.count } ListView { width: 200; height:200 model: visualModel.parts.list } GridView { x: 200; width: 200; height:200 cellHeight: 50 model: visualModel.parts.grid } } @ Delegate.qml : @ import QtQuick 2.1 Package { Item { id: inListContainer; width: 200; height: 25; Package.name: 'list' } Item { id: inGridContainer; width: 100; height: 50; Package.name: 'grid' } Item { id: wrapper width: 200; height: 25 Loader { anchors.fill: parent sourceComponent: objectsList.children[index] } MouseArea { anchors.fill: parent onClicked: { if (wrapper.state == 'inList') wrapper.state = 'inGrid'; else wrapper.state = 'inList'; } } state: 'inList' states: [ State { name: 'inList' ParentChange { target: wrapper; parent: inListContainer } }, State { name: 'inGrid' ParentChange { target: wrapper; parent: inGridContainer x: 0; y: 0; width: inGridContainer.width; height: inGridContainer.height } } ] transitions: [ Transition { ParentAnimation { NumberAnimation { properties: 'x,y,width,height'; duration: 300 } } } ] } } @
  • QML Magnify Shader QQuickShaderEffect error

    4
    0 Votes
    4 Posts
    3k Views
    C
    @Arpegius: make certain that you import QtQuick 2.0 in the document. You can use "property vector2d circlePos" instead of property var (to ensure a property of the correct type). If there are still issues, please file a bug report. Cheers, Chris.
  • WebView in Qt 5.1 - first impressions

    3
    0 Votes
    3 Posts
    2k Views
    Q
    After a bit more testing it seems the actual performance of WebView is not that bad when the mitigating factors highlighted in this list and others are taken into consideration. I am more concerned by the behavioural quirks especially in the way mouse clicking, double-clicking and dragging work (or don’t work). I have noticed that these happen on all web sites. Can anyone comment on whether these are just unfixed bugs or are intended behaviour? If they are bugs, are they on the roadmap to be resolved?
  • What is the use of QQuickWindow:: setDefaultAlphaBuffer(bool use Alpha)

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • [solved] correct implementation of ListView with C++

    4
    0 Votes
    4 Posts
    1k Views
    D
    Hello, thank you for your answers. I finally get a rather good manner using QQmlListProperty which quite efficient and well explained.
  • QtQuick Video Item alpha blending

    4
    0 Votes
    4 Posts
    2k Views
    sierdzioS
    Rake care to define the effect below both affected items in the QML file. I don't know why it works this way (not very QML-like, right?) but that is the way it is.
  • 0 Votes
    2 Posts
    3k Views
    L
    First your QCustomFile must be a QObject child. Create and load your QCustomFile on your thread, then use QObject::moveToThread(<GET YOU MAIN THREAD HERE>). Then you send it through a signal to your main thread... Hope it works for you..
  • (solved) Screenshot in qml

    18
    0 Votes
    18 Posts
    10k Views
    D
    this is simple code from which i get snapshot int main(int argc, char *argv[]) { QApplication app(argc, argv); QDeclarativeView *view = new QDeclarativeView(); view->setSource(QUrl::fromLocalFile("inputQMLFile.qml")); //inputQMLFile.qml instead your QML file that will generate Image QPixmap::grabWidget(view).save("outputFile.png"); //Output file where you want to store the image }
  • Google Weather APIs - Not returning Data - Qt Quick2 QML

    4
    0 Votes
    4 Posts
    2k Views
    M
    When scraping Google however you have to use rotating proxies or hide your IP address otherwise you will get a ban at IP level. That is what you are getting now.
  • Embed qwidget in QML.

    4
    0 Votes
    4 Posts
    3k Views
    J
    That depends on your use case. If you are showing pure 3d geometry then yes, but most normal widgets are a lot easier to port by using QQuickPaintedItem.
  • How to catch resize event?

    2
    0 Votes
    2 Posts
    1k Views
    E
    You have onWidthChanged / onHeightChanged slots in QML and widthChanged / heightChanged signals in C++. But I'm not sure this is what you're searching for.