Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • 0 Votes
    5 Posts
    6k Views
    D
    Excellent, now the root cause to my seemingly random crashes has been fixed, thanks Chris. Indeed, making the model a parent for the pages gets rid of the page deletions and crashes. Even with the ListView and a minimal delegate, I was encountering the page deletions very easily after I attached a ScrollBar to the view, but with the parent fix this also works. Regarding the RichText, there is a visible difference in performance compared to PlainText, but the performance is luckily "ok" even with RichText. And I just don't see any way of avoiding RichText in my application. The page content is conversations such as IRC channels, and it's a pretty important requirement that user can open any links simply by tapping on them.
  • Could highlight object in Listview/Gridview be changed while running?

    3
    0 Votes
    3 Posts
    1k Views
    D
    Not really. Highlight requires Component (http://doc.qt.digia.com/qt/qml-component.html) and only elements that inherit from Qml Item can have state (http://doc.qt.digia.com/qt/qml-item.html). I guess you want to have different highlight bar based on some condition. That basically means you should use different highlight based on list state (example below that changes highlight component based on current item. It is without states but should be easy rewrite to use states). As side note: I personally don't use highlight at all. There might be good reasons to use it but I have found that it gives me more problems than solves. isCurrentItem is enough for me. @import QtQuick 1.1 Rectangle { width: 180; height: 200 ListModel { id: contactsModel ListElement { name: "Bill Smith" number: "555 3264" } ListElement { name: "John Brown" number: "555 8426" } ListElement { name: "Sam Wise" number: "555 0473" } } Component { id: contactDelegate Item { width: 180; height: 40 Column { Text { text: '<b>Name:</b> ' + name } Text { text: '<b>Number:</b> ' + number } } MouseArea { anchors.fill: parent onClicked: { myList.currentIndex = index myList.highlight = index % 2 == 0 ? highlightBar : highlightBar2; } } } } Component { id: highlightBar Rectangle { color: "blue" } } Component { id: highlightBar2 Rectangle { color: "red" } } ListView { id: myList anchors.fill: parent model: contactsModel delegate: contactDelegate highlight: highlightBar focus: true } } @
  • Virtual Keyboard on Desktop app

    3
    0 Votes
    3 Posts
    2k Views
    A
    I'm developing an application style ATM. I've seen that for this I need a hybrid implemetation of QML and C++, like this tutorial: "http://doc.qt.digia.com/qt/qml-extending-tutorial-index.html":http://doc.qt.digia.com/qt/qml-extending-tutorial-index.html thanks for reply
  • [SOLVED] Insert rows

    4
    0 Votes
    4 Posts
    1k Views
    G
    It does work ! Thanks you very much indeed.
  • Custom type in c++ signal with qt5

    2
    0 Votes
    2 Posts
    2k Views
    C
    For QObject-derived types, see https://bugreports.qt-project.org/browse/QTBUG-28619 for a solution to your problem. Cheers, Chris.
  • With QQuickView,how can i draw a rounded rectangle Window

    4
    0 Votes
    4 Posts
    3k Views
    sierdzioS
    Might be a problem of Angle. Can you consider compiling Qt 5 yourself without ANGLE (configure flag -desktop opengl)? Bare in mind that it's a shot in the dark from my side, no guarantee it would work. You might try installing OpenGL drivers before that, too.
  • 0 Votes
    3 Posts
    2k Views
    C
    As Tomma said, you can use dynamic object management to create and destroy visual objects at runtime. You can dynamically add or remove visual objects from the scene at runtime, simply by creating a visual object (with Component.createObject()) and giving it a visual parent. Note that QObject parent and visual parent are different concepts, see the docs for more in-depth discussion on that. But basically, by giving a newly created visual object, a visual parent, it then gets added to the visual scene and will be rendered. Thus, you can dynamically change your UI at runtime. Cheers, Chris.
  • Whether QML has a “class” attribute just like CSS?

    2
    0 Votes
    2 Posts
    1k Views
    J
    No there is not built in mechanism for this. It can however be added on top of QML, which is what Ubuntu is doing on their components: http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-itemstyle.html
  • How do you decide which part(s) of an application should use QML?

    4
    0 Votes
    4 Posts
    1k Views
    D
    Full HTTP/REST, JSON and localStorage is completely possible with QML - I personally used this in several apps. Reading local files will need to be done by extending QML using C++.
  • [SOLVED]How to select a part of the picture with Qml?

    4
    0 Votes
    4 Posts
    3k Views
    L
    [quote author="itviewer" date="1357360092"] ok,yes ,just it! thanks[/quote] You are welcome. Please add [SOLVED] prefix to the title of the thread.
  • 0 Votes
    2 Posts
    3k Views
    shavS
    The correct using of code for click to item menu: @ menuBar: MenuBar { Menu { text: "File" MenuItem {text: "Open Log..."} } Menu { text: "Preferences" } Menu { text: "Help" MenuItem { text: "About..." onTriggered: { console.log("Clicked!!!!"); } } } } @
  • [Qt5] QML and OpenGL

    4
    0 Votes
    4 Posts
    5k Views
    Z
    OK as long as you found something that works.
  • [SOLVED] createObject() - having a function as a property

    4
    0 Votes
    4 Posts
    2k Views
    C
    Regarding the onClicked handler in both contexts being invoked, I'm really not sure. The id.handler syntax is a strange one, and to be honest I didn't know that it was supported. Regarding the future syntax possibilities, well, I don't think that will change in 5.0. Certainly, I don't think that assignment like: @ property var someprop: { a + b } @ will ever be a function assignment - it'll always be either a syntax error, an object assignment, or a binding assignment (simply because we want to maintain semantics between var properties and other properties). For example: @ function someFunc() { return 5 } property int p1: someFunc() property var p2: someFunc() @ It would be "strange" if the value of p1 was 5, but the value of p2 was [Object function] As for changing it to just @ someprop: [console.log("blah")] @ the problem is that it will always simply evaluate the inner bit, and assign it to the zeroth index of the array. Finally, @ someprop: [{console.log("blah")}] @ could be made to work, I guess, assuming that the ecma262r5 spec defines such a block as always being a function, and not possibly an object with an uninitialised property, but I think requiring the function to be specified explicitly is clearer. But anyway, I don't really think that we can (or should) change the syntax dramatically within the 5.x series. Cheers, Chris.
  • Help! How to select a part of the picture with Qml?

    1
    0 Votes
    1 Posts
    749 Views
    No one has replied
  • Navigation between qml pages from design perception

    5
    0 Votes
    5 Posts
    4k Views
    J
    You can actually use the Meego PageStack components as is but you will have to copy it manually into your project. We are currently working on adding it into Qt 5.1, but you sill lack some convenience for this with pure Qt Quick. (https://codereview.qt-project.org/#change,43894)
  • [SOLVED] How to show QMenu with QML 2.0 in Qt 5

    7
    0 Votes
    7 Posts
    5k Views
    shavS
    [quote author="Jens" date="1357251384"]You can keep a ship a copy of the QtDesktop dir with your application and set the qml import path in your application. This is done by using engine.addImportPath(...) for instance or pass -I $PATH as a command line argument to the application. [/quote] Thanks I will check it.
  • This year five Qt/Qml smartphone platform

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Best way to transfer data between two threads ?

    2
    0 Votes
    2 Posts
    2k Views
    JKSHJ
    Hi, You don't need a separate thread for networking. Just use the QTcpSocket's asynchronous API: connect the readyRead() signal to a slot that reads and processes the data. Your GUI will remain responsive.
  • Instrumenting QML files

    1
    0 Votes
    1 Posts
    664 Views
    No one has replied
  • [SOLVED] Where does the Mobility Map component get it's data from?

    3
    0 Votes
    3 Posts
    1k Views
    T
    Thanks, that's exactly it.