Singleton Signal Propogation Question
Hi, I decided to write a c++ class to handle asynchronous database queries. I registered it with my QML application as a singleton. The c++ class emits a signal when the results are ready and I use the...
View ArticleAbout integrating c++ and qml
Hello , I would like to ask when should I use the qml register type and when to use the plugin. Actually the concept is new to me and I feel confused and I don’t know from where to start. I watched the...
View ArticleAdd object to QAbstractListmodel-derived model from QML
Hi, As you can probably tell, I’m quite new to Qt/QML. I’m cutting my teeth on using my own list model with a ListView. The model holds objects of type Game, so I call it GameModel. Now, I’m able to...
View ArticleAbout integrating c++ and qml
ok , what about the wrapper object when should I use it and what does it d exactly?
View ArticleAdd object to QAbstractListmodel-derived model from QML
Yes. Please see my second post in this thread. Both Game and GameModel are registered with qmlRegisterType() and an instance of the model is available through setContextProperty().
View ArticleAdd object to QAbstractListmodel-derived model from QML
IMO, then you need the initialise Game too in QML just as you have done for GameModel and then pass it’s id to the addGame().
View ArticleOverwriting the existing property with alias
I got this code from http://qt-project.org/doc/qt-5/qtqml-syntax-objectattributes.html#considerations-for-property-aliases (I made small modifications) import QtQuick 2.2 Rectangle {...
View ArticleQML loaded from plugin cannot reference local types
ok, I’ve found something like a solution. The QML references I pass to the Loader must be relative to the root of the project. If that is the case, everything works. So simply saying DynaLoader.show =...
View Article[Solved] Singleton Signal Propogation Question
I went with my own solution setting an id for each query that I make to the db and then checking that id to restrict signal handling to a particular handler.
View ArticleProject files in q Qt application combining both C++ and QML
You can look at the example directory in your Qt installation. Examples/Qt-5.3/quick/controls/calendar
View ArticleOverwriting the existing property with alias
alias ‘colour’ actually refers to the blue rectangle colour. colorrectangle should be ‘red’. It will not change to blue as it is just a alias. It should have been set to red internally. Since it is not...
View ArticleQML context of dynamically generated items
Hello, I’m trying to figure out in which context dynamically generated items are being stored? Therefor let me explain my scenario. First I’ve registered two new QML types:...
View Article[QQuickPaintedItem] Problem with drawing text and lines
Hello, I have a subclass of QQuickPaintedItem and paint method is quite simple //setRenderTarget(QQuickPaintedItem::FramebufferObject ); ...
View ArticleQML context of dynamically generated items
Since you are passing the parent as Tab_view, it should be children of the tabview only. It will be in the current context itself. Here is the sample which I tried and it works perfectly. I suspect...
View Article[QQuickPaintedItem] Problem with drawing text and lines
To get the lines to draw right you must use float coordinates and snap them to pixel center. Instead of painter->drawLine(100, 10, 100, 200); do painter->drawLine(100+0.5, 10+0.5,...
View ArticleAdd object to QAbstractListmodel-derived model from QML
Yep, I guess you’re right. I’m still absorbing the philosophy of QML. The way ListView works clearly decouples the business logic. Nonetheless, I’m struggling to see how I can achieve some things in...
View ArticleReference Error
When I run the application I get a reference error message background is not defined. I’m not sure were I messed up. This is happening at line 22 and I really am not understanding what this means. The...
View ArticleReference Error
Hi, For the undefined behavior i see a spelling mistake(to be specific backgrond is not background) and for using absolute paths please prepend the path with file://
View ArticleQML context of dynamically generated items
How are you giving object name ? For createObject can you pass the objectName as well ?. You can try some thing like the following and see ...
View Article[QQuickPaintedItem] Problem with drawing text and lines
Yep, thanks a lot. I’ve tried float coordinates but it didn’t help. But I found that if I disable antialiasing (remove this line painter->setRenderHint(QPainter::Antialiasing); ), the line looks...
View Article