qml

QML TableView get data from specific cell (selected row + specific column)

时间秒杀一切 提交于 2020-12-04 01:01:04
问题 I have QML TableView with QSqlQueryModel . I need to select any row and get data from every column of table to separate TextField . Here is abonentstable.h: #pragma once #include <QObject> #include <QSqlQueryModel> class AbonentsSqlModel : public QSqlQueryModel { Q_OBJECT public: explicit AbonentsSqlModel(QObject *parent = 0); void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase()); QVariant data(const QModelIndex &index, int role) const; QHash<int, QByteArray> roleNames(

QML TableView get data from specific cell (selected row + specific column)

孤街浪徒 提交于 2020-12-04 00:59:56
问题 I have QML TableView with QSqlQueryModel . I need to select any row and get data from every column of table to separate TextField . Here is abonentstable.h: #pragma once #include <QObject> #include <QSqlQueryModel> class AbonentsSqlModel : public QSqlQueryModel { Q_OBJECT public: explicit AbonentsSqlModel(QObject *parent = 0); void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase()); QVariant data(const QModelIndex &index, int role) const; QHash<int, QByteArray> roleNames(

QML virtual keyboard dimensions

南楼画角 提交于 2020-12-02 08:09:39
问题 I'm having trouble finding the dimensions for the virtual keyboard. Here's an example: Rectangle { Component.onCompleted: { Qt.inputMethod.visibleChanged.connect(resizeForKeyboard) } Component.onDestruction: { Qt.inputMethod.visibleChanged.disconnect(resizeForKeyboard) } function resizeForKeyboard(){ console.log('Visibility changed!!!'); var keys = Object.keys(Qt.inputMethod.keyboardRectangle); var rect = Qt.inputMethod.keyboardRectangle; //A simple script I have for debugging, this loops /

QML virtual keyboard dimensions

删除回忆录丶 提交于 2020-12-02 08:08:18
问题 I'm having trouble finding the dimensions for the virtual keyboard. Here's an example: Rectangle { Component.onCompleted: { Qt.inputMethod.visibleChanged.connect(resizeForKeyboard) } Component.onDestruction: { Qt.inputMethod.visibleChanged.disconnect(resizeForKeyboard) } function resizeForKeyboard(){ console.log('Visibility changed!!!'); var keys = Object.keys(Qt.inputMethod.keyboardRectangle); var rect = Qt.inputMethod.keyboardRectangle; //A simple script I have for debugging, this loops /

How to change the font color of a MenuBar?

落爺英雄遲暮 提交于 2020-12-01 11:00:18
问题 How can I change the text color of the menu items of a QML MenuBar ? import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Controls.Styles 1.3 as QtQuickControlStyle ApplicationWindow { title: qsTr("Test") width: 640 height: 480 visible: true property color menuBackgroundColor: "#3C3C3C" property color menuBorderColor: "#282828" menuBar: MenuBar { style: QtQuickControlStyle.MenuBarStyle { padding { left: 8 right: 8 top: 3 bottom: 3

How to change the font color of a MenuBar?

允我心安 提交于 2020-12-01 10:57:43
问题 How can I change the text color of the menu items of a QML MenuBar ? import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Controls.Styles 1.3 as QtQuickControlStyle ApplicationWindow { title: qsTr("Test") width: 640 height: 480 visible: true property color menuBackgroundColor: "#3C3C3C" property color menuBorderColor: "#282828" menuBar: MenuBar { style: QtQuickControlStyle.MenuBarStyle { padding { left: 8 right: 8 top: 3 bottom: 3

How to change the font color of a MenuBar?

旧巷老猫 提交于 2020-12-01 10:57:19
问题 How can I change the text color of the menu items of a QML MenuBar ? import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Controls.Styles 1.3 as QtQuickControlStyle ApplicationWindow { title: qsTr("Test") width: 640 height: 480 visible: true property color menuBackgroundColor: "#3C3C3C" property color menuBorderColor: "#282828" menuBar: MenuBar { style: QtQuickControlStyle.MenuBarStyle { padding { left: 8 right: 8 top: 3 bottom: 3