Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.1k Posts
  • Superscript not working in QtQuick 2.0

    1 Mar 2013, 15:16
    0 Votes
    2 Posts
    1k Views
    IMHO it does not make sense to file another bug report, because it will end up at the end of the queue. The priority will be worse for the new report. Better vote for the current one. More votes are raising the level of importance hopefully. You can also place a comment with an additional example on JIRA.
  • 0 Votes
    5 Posts
    3k Views
    How do I handle these attributes? You are right I thought it was strange also. Here is my explanation. Lets say we have a text list. qt pushes the view of the text list on to the stack. It will then draw the surrounding window. it will pop it off at the end and draw it to the area we want our qquickitem. To ensure the text list is drawn last. so what we are doing is popping it off early modify it and push it back for qt to draw it at a later stage. At least that's what I can gather from qquickitem now my question is how does qt do this for GLES systems because it must do it somehow?
  • 0 Votes
    3 Posts
    2k Views
    I created report of a bag: https://bugreports.qt-project.org/browse/QTBUG-28357 I hope the problem will be solved.
  • AddImportPath - QDeclarativeView?

    1 Mar 2013, 09:36
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    1 Posts
    675 Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    Hey, great! So I've learned something new today, too. :) Please add "[SOLVED]" to topic's title for reference by future generations.
  • Perform movement across path

    26 Feb 2013, 18:50
    0 Votes
    3 Posts
    1k Views
    Thank you for your answer. But is not what I'm looking for. The curves are generated dinamically by C++ with QQuickItem. I think how to do it but I'm with a previous problem.
  • 0 Votes
    3 Posts
    4k Views
    I think the main difference is that QSGNode try to use as many GPU threads as posible. So the performance can be better.
  • 0 Votes
    2 Posts
    1k Views
    I'm sorry, it was all working properly. You can not remove all tables from the database with one command, only separately, eg @var db = Sql.LocalStorage.openDatabaseSync(..); function clearScores() { db.transaction( function(tx) { tx.executeSql('DROP DATABASE Scores;'); } ); }@ A lot of interesting information here http://doc-snapshot.qt-project.org/qt5-dev/qtquick/qmlmodule-qtquick-localstorage2-qtquick-localstorage-2.html and in the source code: qtdeclarative/src/imports/localstorage/plugin.cpp
  • 0 Votes
    22 Posts
    27k Views
    "look at cmake branch":https://github.com/nib952051/QtDesktopComponentsBackport/tree/cmake
  • QML date and time manipulation

    5 Jan 2011, 17:21
    0 Votes
    11 Posts
    61k Views
    Qt5 and javascript are very easy to use now. If you have not upgraded, now is the time. See the Qt5 Docs.
  • 0 Votes
    3 Posts
    2k Views
    It's been a while but I'll update what I ended up doing for anyone else interested... The reasoning behind trying to do the above was mainly that I wanted as little coupling as possible between the view (in this case a Repeater) and the delegate. Since I'm reusing my delegates in several views I didn't want to use a set view id. So basically I just provided the model as a property of the delegate component. Basically something like this: @ Repeater { model: cppModel delegate: MyComponent { delegateModel: cppModel } } @
  • QML & C++ : ReferenceError

    26 Feb 2013, 22:04
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    3 Posts
    4k Views
    I figured this out... but my solution was pretty nasty. The only way to ensure the right delegate was selected was to re-check which one was selected every time the layout changed (since the layout obviously has to change if the items are re-sorted). Below is a snippet of what I did. There has to be a better way! Note that "modelId" is a role on the model. @Component { id: myDelegate Column { id: column Component.onCompleted: { myListView.setSelected.connect(handleSetSelected) } // If we don't disconnect from the signal the handler will still be called // on destroyed components and errors will be thrown about undefined // variables. Component.onDestruction: { myListView.setSelected.disconnect(handleSetSelected) } function setSelected() { myListView.setCurrentItem(index, modelId); } function handleSetSelected(modelIdToBeSelected) { if (modelId === modelIdToBeSelected) { setSelected(); } } // More delegate stuff... } } ListView { property int currentModelId: 0 signal setSelected(int modelId) function setCurrentItem(index, modelId) { currentIndex = index; currentModelId = modelId; } id: myListView objectName: "MyList" model: myModel delegate: myDelegate // Signal handlers Connections { target: myModel onLayoutChanged: { myListView.setSelected(myListView.currentModelId) } } }@
  • Custom C++ types and QJSEngine

    18 Feb 2013, 13:23
    0 Votes
    3 Posts
    4k Views
    Hi, Sorry, I'm not too familiar with the QJSEngine stuff. With QML2 we now allow (via an undocumented interface) modules to provide their own value-types. These types are "QVariant-storable types which have sub-properties" such as QFont, QVector3D and so forth. Take a look at the valuetype related code in QtQuick2 - basically it registers a bunch of types as value types, provides load/store/copy/remove and conversion functions, etc. It's not too clean, there are hideous dragons in that code, and the interfaces are completely undocumented because they're really still meant for internal use only, but if you want to see how we did it, please feel free to check it out and try to provide your own in your own module. What we don't allow is any form of operator overloading. Hence, the valuetype mediator classes I implemented had a bunch of Q_INVOKABLE functions (for things like add/sub/mul etc). Cheers, Chris.
  • 0 Votes
    1 Posts
    858 Views
    No one has replied
  • Audio jumps up system mixer (linux,Qt5)

    21 Feb 2013, 22:41
    0 Votes
    2 Posts
    1k Views
    What i forgot to install?
  • How to link pages in qml

    28 Jan 2011, 10:28
    0 Votes
    11 Posts
    13k Views
    I know these posts were a while back but I have tried the code suggested by ngocketit and the correct qml file loads but it no longer recognises my shortcut keys - shortcut keys were fine, all I have done is load the qml files as above without modifying them. Is this expected??? The only thing being displayed is a listview, code below is what is in the file being loaded/displayed. The doubleClick on an item still works but pressing a number key to select an item in the listview does not. @import QtQuick 2.0 Rectangle { id: theMenu Component { id: menuEntryDelegate Rectangle { id: menuItemContainer width: menuHolder.width height: menuEntry.height * 1.25 anchors.top: prompts.bottom state: ListView.isCurrentItem ? "selected" : "notselected" Text { id: menuEntry font.pointSize: coreMenu.menuFontPointSize width: parent.width wrapMode: Text.WordWrap text: displayText clip: true } ....... } Rectangle { id: menuContainer width: coreMenu.menuWidth height: (50 * 9) anchors.horizontalCenter: parent.horizontalCenter anchors.top: prompts.bottom color: "purple" ListView { id: menuHolder model: menuModel anchors.fill: parent opacity: 1 header: Rectangle { width: menuHolder.width height: 50 color: "#2A51A3" Text { id: header anchors.centerIn: parent text: coreMenu.getMenuTitle() font.pointSize: 20 color: "green" width: parent.width wrapMode: Text.WordWrap } } delegate: menuEntryDelegate focus: true Keys.onPressed: { if(event.key === Qt.Key_Home)//go back to Main menu { coreMenu.displayMainMenu(); } //Ways to select a menu item else if((event.key >= Qt.Key_1 && event.key <= Qt.Key_9) || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { if(event.key >= Qt.Key_1 && event.key <= Qt.Key_9) { menuHolder.currentIndex = event.key - Qt.Key_1; } coreMenu.displayMenu(menuHolder.currentIndex); } .............. }@
  • 0 Votes
    3 Posts
    4k Views
    Thank you! I just also needed to add @Q_DECLARE_METATYPE(CListModel* )@ to .h file.
  • 0 Votes
    15 Posts
    12k Views
    Hi, I have already ued this example: http://www.developer.nokia.com/Community/Wiki/Creating_a_custom_QML_element_with_Qt and it works great. I thought about the Beziers curve, but I need to have a mousearea covering the line so it would be way more dificult. Any way, thank you all