qml

Qt, QML and Windows 8 [closed]

空扰寡人 提交于 2019-12-22 03:46:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I always been curious about QML introduced by Qt framework. But never had a chance to work with it. But now with Windows 8 coming, old school widget based interface is going to get outdated (just my opinion! :) ). Now I want to ask those, who had some experience with QML: Is it easy

QML StackView: Item Destroyed on pop

寵の児 提交于 2019-12-22 01:31:58
问题 Consider the following example: import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 Window { visible: true width: 320 height: 320 StackView { id: stackView anchors.fill: parent Component.onCompleted: { stackView.push( { item: comp1, destroyOnPop:false } ) } } Component { id: comp1 Rectangle { color: "lightgray" Text { id: mtext anchors.centerIn: parent text: "First Page" } } } Component { id: comp2 Rectangle { color: "lightgreen" Text { id: mtext anchors.centerIn: parent

QML Virtual Keyboard Add New Layout

可紊 提交于 2019-12-22 00:23:57
问题 I use qt qml 5.7 on Yocto project for raspberry pi. My project need virtual keyboard for Turkish language. QT Virtual Keyboard has no support Turkish language so i want to create my custom layout. I add my project example layout codes from here as name "myCustomLayout.qml". And I run my virtual keyboard display function by following codes. import QtQuick 2.5 import QtQuick.VirtualKeyboard 2.1 import QtQuick.Controls 2.0 InputPanel { id: inputPanel visible: Qt.inputMethod.visible height:main

Display several roles in one column of TableView

我与影子孤独终老i 提交于 2019-12-21 21:38:22
问题 I have a SQLite 3 database with 4 columns and QML code with TableView that displays it: TableView { id: table ... TableViewColumn { role: "name" width: 275 } TableViewColumn { role: "surname" width: 300 } TableViewColumn { role: "phone" width: 575 } TableViewColumn { role: "ip_address" width: 525 } model: abonents } It works fine, but I need to display the first two roles, name and surname , as a unique column in TableView . Here is the code for my model and the main . abonentstable.h:

How to assign SQL query output model from Qt to QML's TableView?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 20:57:57
问题 From C++ (Qt): int main(int argc, char *argv[]) { QApplication app(argc, argv); /* * I have omitted the code about connection with the database and all for ease of * viewing the code. */ // My own function for filling in the data in the `QSqlQueryModel` QSqlQueryModel* model = new QSqlQueryModel; QString binid = "B1"; QString query = "SELECT t1.BinId, t1.PartitionId, t2.UnitId, t2.ItemCount FROM Bin_Partitions AS t1 " "INNER JOIN Partition_Units AS t2 ON t1.PartitionId = t2.PartitionId "

Strange alpha blending results with ShaderEffectItem

余生长醉 提交于 2019-12-21 20:33:16
问题 I'm trying to apply a simple alpha mask on a QML item using ShaderEffectItem . Here is a minimal (non-)working example: I have a red-to-white gradient as the background and want to draw a green 200x200 square on top of it. The alpha mask for this square should be 0.0 at the left and 1.0 at the right border, so it should be transparent at the left border. import QtQuick 1.1 import Qt.labs.shaders 1.0 Rectangle { width: 300 height: 300 id: wrapper gradient: Gradient { GradientStop { position: 0

How to create QML object within a singleton?

跟風遠走 提交于 2019-12-21 20:15:38
问题 I have defined a QML object under MyQMLObject.qml . This QML file looks like this: import QtQuick 2.4 Item { id: rootItem implicitWidth: LayoutUtils.maxImplicitWidth(children) implicitHeight: LayoutUtils.maxImplicitHeight(children) Text { id: text1 } Text { id: text2 } // ... Text { id: textN } } The text is added dynamically when the application starts. For each language different text is added, there for the width of the rootItem varies by the chosen language. I would like to somehow create

QML applications and security - is there any?

南笙酒味 提交于 2019-12-21 20:15:02
问题 I just made a shocking discovery - when deploying QML applications, all the "stock" QML components used in the project are deployed as bare QML files, directly visible in the file system, they are not even tucked away in the application qrc binary as user QML files are. Meaning that anyone can open those human readable files, and write whatever code he needs executed. Also, it is possible to do a fair amount of introspection on QObject derived types, even from QML, you can crawl down the

QML TableView + QAbstractTableModel - how edit model data from QML?

雨燕双飞 提交于 2019-12-21 06:28:36
问题 I have C++ class inherited from QAbstractTableModel with next functions overriden: virtual QHash<int, QByteArray> roleNames() const noexcept override; virtual Qt::ItemFlags flags(const QModelIndex& index) const noexcept override; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const noexcept override; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const noexcept override; virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const

I have multiple qml Files that get pushed via StackView. How do I connect them to C++

落爺英雄遲暮 提交于 2019-12-21 05:36:08
问题 My Projects contains 6 qml Files: The main.qml opens a new ApplicationWindow and declares the toolbar. It also initalizes StackView with the initalItem homescreen.qml. On the Home Screen I have different buttons which open different qml Files, via stack.push("URL"). Besides the main.qml all Files start with Item{}. I've been able to connect signals from the main.qml and the home.qml. But I've been unable to access Objects that are deeper in the stack. I don't know if I hvae to change my .cpp