qtquickcontrols

How to include QtQuickControls

☆樱花仙子☆ 提交于 2021-02-10 15:59:00
问题 I've included to my project : "import QtQuickQontrols 1.4" But now I need to use ScrollBar , and for this, I need to include "import QtQuickControls 2.2" But when I include version 2.2 and delete 1.4, my project is ruined... MenuBar, TableView is under errors! Ok, when I include both this version it's errors , too! I did run qmake, and give me some advice what should I do to implement my ScrollBar. I've tried to add ScrollView, but inside this it doesn't work : .... ScrollBar.vertical:

QT QML how to change only one feature of a, say, button style

大兔子大兔子 提交于 2021-02-08 04:01:12
问题 changing the style of a component, seems to replace all the features of the default style. is there a way to change only one feature? For example, suppose i want a red button; import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 ApplicationWindow { visible: true width: 640 height: 480 Button { height: 200 width: 200 text: "Press me" style: ButtonStyle { // changes background but also throws away everything else // in standard button style background: Rectangle {

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

QML - Cannot assign to non-existent property “style”

独自空忆成欢 提交于 2020-07-18 09:07:54
问题 I'm using Qt 5.10.1 with Qt Creator 4.5.1 and the style property is never available in elements. For example, as shown here ButtonStyle QML Type , I would like to do: Button { text: "A button" style: ButtonStyle {...} } But, I get the error: Cannot assign to non-existent property "style" I tried with a rectangle, progressbar and I get the same error. Edit #1: I do have all these imports. If the import was missing, I would get the error on ButtonStyle , but the error is on style . import

ComboBox disable an item at a particular index

我只是一个虾纸丫 提交于 2020-03-02 08:56:06
问题 I have a combobox in qml in a as a TableViewColummn and I define it as follows: import QtQuick 2.3 import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 ListModel { id: comboModel ListElement { text: "" Index: -1 Dims: -1 } } TableViewColumn { id: imageTypeList role: "ImageType" title: "Image Type" width: 100 delegate: Rectangle { ComboBox { anchors.verticalCenter: parent.verticalCenter anchors.margins: 2 model: comboModel