Questions tagged [qtquickcontrols2]

For questions regarding code that uses the Qt Quick Controls 2 module. That is, "import QtQuick.Controls 2.x".

Qt Quick Controls 2 provides a set of controls that can be used to build complete interfaces in Qt Quick. They were released as a tech preview under the name "Qt Labs Controls" in Qt 5.6, and became a proper module in Qt 5.7.

362 questions
17
votes
2 answers

Spacer Item in QML Layouts

I want to create a layout in QML and I'd like to add a spacer item (the bottom selected item from the image below) just as you do using widgets like so: But I couldn't find anything to suit this on the QtQuick side of things...is it possible to…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
17
votes
5 answers

QML button change text color

I'm new in QML and i want to personalize my buttons. I succeed to change the background's color and border color. But I don't success at all to change the color of the button's text. I saw we don't use anymore "style" to change the style but…
Lazyos
  • 171
  • 1
  • 1
  • 3
15
votes
3 answers

QML - Cannot assign to non-existent property "style"

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…
vincedjango
  • 1,022
  • 1
  • 13
  • 24
15
votes
1 answer

What Object has Active Focus in QML?

I have a complex GUI with QML but in some situations, I lose my focus and don't know what object has active focus. Are there any tools or ways to search in QML files and find focused object?
Mohsen Zahraee
  • 3,309
  • 5
  • 31
  • 45
15
votes
5 answers

How to center dialog on screen in QtQuick Controls 2?

All my dialogs appear on the top left corner of screen instead of the center. What is the best way to let the dialogs be placed automatically correct? import QtQuick 2.7 import QtQuick.Controls 2.2 ApplicationWindow { id: mainWindow …
feedc0de
  • 3,646
  • 8
  • 30
  • 55
15
votes
2 answers

Qt Quick Controls 2 and TableView

Is it OK to use TableView in Quick Controls 2.0 application? This will require to have both imports: import QtQuick.Controls 1.4 import QtQuick.Controls 2.0 Will I get any side effects? Another related question: it seems that TableView belongs to…
Alexander Dyagilev
  • 1,139
  • 1
  • 15
  • 43
15
votes
1 answer

How do I apply the style to a TextField in QML? It seems "style" attribute isn't available

I am trying to apply some styles to a new qt 5.7 application I am working on and the following is not working at all. It gives the error: qrc:/SignInView.qml:67 Cannot assign to non-existent property "style" And I can't edit it in design mode for…
Encompass
  • 562
  • 3
  • 13
  • 27
15
votes
2 answers

Qt Quick Controls 2.0 Text Field Cannot Select Text

I'm having difficulty with selecting text on a TextField from Qt Quick Controls 2.0 with a mouse. When I hover over the TextField the cursor does not change from the cursor arrow to the cursor I beam and I am unable to select text. I verified text…
Frank Laritz
  • 215
  • 3
  • 7
14
votes
1 answer

How to change shadow color of Qt QML Drawer (without declaring custom Style)?

I use Drawer from QtQuick.Controls 2.2 Drawer { id: drawer width: parent.width/2 height: parent.height modal: true ... } With style: [Controls] Style=Material [Material] Theme=Dark Accent=Red Primary=#c64949 I want to change a…
Drew Dru
  • 449
  • 4
  • 16
12
votes
5 answers

Menubars in QtQuick Controls 2

How can I have Menubars in QtQuick Controls 2? It used to be like this (in ApplicationWindow): menuBar: MenuBar { Menu { title: qsTr('File') MenuItem { text: qsTr('&Test') onTriggered: console.log('test') …
Sassan
  • 2,187
  • 2
  • 24
  • 43
9
votes
1 answer

QQuick with CMake: style does not work

I am willing to use styling within Qt Quick Controls 2 and together with a CMake project in C++. And I am having a hard time to get the colors right. The C++, qml and styling code comes from the qt blog and is working fine so long as I use a .pro…
arennuit
  • 855
  • 1
  • 7
  • 23
8
votes
1 answer

System tray icon without widgets

I'm wondering if there's a way to implement system tray icon + menu functionality without widgets module?
mbg033
  • 501
  • 5
  • 18
8
votes
2 answers

eglfs on raspberry2 -- * failed to add service - already in use?

that's is my first post here. I'd like to keep it short... Following problem: i want to run a qt5/qtquickcontrols2 application utilising the eglfs backend on a raspberry-pi 2b, accelerated by vc4, of course. Ideally, it should run in kiosk mode and…
8
votes
1 answer

Material theme doesn't seem to work in QML

I have a simple QML with an ApplicationWindow, RowLayout and a bunch of Buttons inside. I have applied the Qt Quick Controls 2 Material theme as per the docs, but nothing changed. What's wrong? import QtQuick 2.7 import QtQuick.Controls 2.0 import…
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
8
votes
3 answers

import QtQuick.Controls 2.0 not working - QQmlApplicationEngine failed to load component

I have an app that its project generated using CMake in Qt5.7, so when import QtQuick.Controls 2.0 application failed to load with the following error: plugin cannot be loaded for module "QtQuick.Controls": Cannot load library …
Reza Ebrahimi
  • 3,623
  • 2
  • 27
  • 41
1
2 3
24 25