qml

How can i change the speed of listview scrolling in QML?

你。 提交于 2019-12-24 14:14:06
问题 I have created a list by using listview in QML. In my case, i want to change the speed of the list scrolling, scrollBar and the highlight to different value. For example, Here is a list. While i move the highlight to the next element, three types of animation will be happened. scrollBar will scroll to bottom list will scroll to the top highlight will scroll to the next element As i known, i can change the the highlight by ListView { highlightMoveDuration : 200 } I found that three types

Adding a background image to a QQuickItem

旧城冷巷雨未停 提交于 2019-12-24 13:25:42
问题 I have created a QPixmap and drawn smaller QPixmap s on it with QPainter . I want to use the image as the background of a QQuickItem . Is there an easy way to do this? 回答1: If your custom item derived from QQuickItem you can redefine QQuickItem::updatePaintNode() in maybe this way: QSGNode *MyItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) { QSGSimpleTextureNode *node = static_cast<QSGSimpleTextureNode *>(oldNode); if (!node) { node = new QSGSimpleTextureNode();

.rcc file not found when trying to call registerSource

做~自己de王妃 提交于 2019-12-24 12:50:43
问题 I have generated a .rcc file using the following command: rcc -binary redTheme/redTheme.qrc -o redTheme.rcc I then put the redTheme.rcc file into the binary folder. Finally, I register the file with registerResource(const QString & rccFileName, const QString & mapRoot = QString()) : QResource::registerResource("redTheme.rcc") The method returns false . Do I need to set a path or something similar? Note that I'm using MSVC 2013 with CMake . According to this post, it could be a problem. 回答1:

How To change the background color of a container using the Hex format?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 12:38:26
问题 I'm developing a BlackBerry 10 mobile application using the momentics IDE (native SDK). I want to change the background color of a container using C++. But unfortunately, relating to this [link], you only can define it like below : **Creating a color in C++:** Color c1 = Color::fromRGBA(0.5f, 1.0f, 0.2f, 0.8f); Color c2 = Color::fromARGB(0xff996633); For the color, I want to use the hex format ("#xxxxxx"). Any one can guide me on this ? 回答1: Color c2 = Color::fromARGB(0xff996633); is using

Click \ flick through emptry area of a Flickable that partially overlaps another Flickable

醉酒当歌 提交于 2019-12-24 11:47:01
问题 I have a scene "editor" flickable on the bottom, and docked at its right side, a scene "outliner" flickable on top of it, which shows a tree of the scene structure. Flickable { id: editor anchors.fill: parent contentWidth: 5000 contentHeight: 5000 Repeater { model: 500 delegate: Rectangle { width: Math.random() * 200 + 50 height: width x: Math.random() * editor.contentWidth y: Math.random() * editor.contentHeight color: Qt.rgba(Math.random(), Math.random(), Math.random(), 1) border.color:

QML canvas performance issue

喜欢而已 提交于 2019-12-24 11:36:57
问题 I'm tyring to figure out how I can accelerate drawing of a QML scene that shows a game map made up of hexagonal tiles. Each tile is a qml item dynamically instantiated via JavaScript on startup. The highlight property of each tile is toggled based on mouse-over movement. The tile object looks similar to this: Item { id: tile x: // is set to fixed value by JS code on item instantiation y: // is set to fixed value by JS code on item instantiation width: // is set to fixed value by JS code on

Displaying pandas dataframe in QML

喜你入骨 提交于 2019-12-24 10:24:25
问题 I have 2 pandas dataframes , one with 6 rows and 7 columns and another one with 21 rows and 12 columns , i would like to display them using QML, while googling i got to know about TableView TableView QML Type. In that example, the data has been entered already in ListElement and it is being shown. But in my case the data is from python pandas dataframe, how can i fetch the columns and rows from pandas straight into QML, should i create those columns well before under listelement ? Any help

Accessing ListItemComponents on the run

时光总嘲笑我的痴心妄想 提交于 2019-12-24 09:38:51
问题 right now I'm trying to create a ListView which loads the dataModel using a custom QML. Here's the snippet of my code: ListView { id: firstPageListView visible: false dataModel: firstPageDataModel layout: GridListLayout { columnCount: 1 cellAspectRatio: 2.0 headerMode: ListHeaderMode.Standard verticalCellSpacing: 10 } listItemComponents: [ ListItemComponent { //custom qml that will be used ThumbNote { title: ListItemData.title text: ListItemData.text imageSource: ListItemData.image listmode:

Reading multiple Xml Attributes with qml

让人想犯罪 __ 提交于 2019-12-24 08:39:42
问题 I've got and XML String in javascript (qml). My goal is to filter informations regarding different lines. I want an object containing the line name ( attribute) and especially the countdowns. For one line name there are departures_count * countdown fields. I want all these (in the current case its 2) countdown values in an array. And the ultimate goal is to load the whole line in a ListModel of the form: line(name, countdown(1,2,..x)) . The big problem is to access the attributes. In qml

How to define number of images in Qt image's carousel?

时间秒杀一切 提交于 2019-12-24 08:32:28
问题 Well, i saw a Qt Quick Image's Carousel Example in http://developer.qt.nokia.com/wiki/Qt_Quick_Carousel. I adapted for my specific situation and it worked! Ok, but i'm with problems still. I want to show just 4 images each time, but i didn't see something about this. I'm reading also a QML documentation in http://doc.qt.nokia.com/4.7-snapshot/qml-tutorial.html... Do someone know how can i to show just 4 images each time in the that example code? 回答1: pathItemCount property from PathView will