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
7
votes
1 answer

How to make ListView items height dynamic based on inner content?

In following listview's items, length of text can be different (10, or 1000 characters), so I want make each list view item height fit text height. (Like css height: auto). Component { id: sysNotificationsDelegate Rectangle…
Teimuraz
  • 8,795
  • 5
  • 35
  • 62
7
votes
2 answers

How to set currentIndex of SwipeView to currentIndex of TabBar "by reference" after going to specific page?

I'm getting started with QtQuick Controls 2.0. I have experience with C++ and a small amount of experience with Qt, but I have not worked with QML before. I have a TabBar and a SwipeView that are linked to each other. What I mean by this is that…
Jon McClung
  • 1,619
  • 20
  • 28
7
votes
3 answers

Can I globally switch to native text rendering in Qt Quick Controls 2?

I would like to use native rendering for all the text in my application. For each Text, Label, etc. element I can do this Text { renderType: Text.NativeRendering } to trigger native rendering. I can also use the software renderer for the whole…
Georg Schölly
  • 124,188
  • 49
  • 220
  • 267
7
votes
1 answer

How to prevent page manual swiping in SwipeView

How to prevent page manual swiping in SwipeView? I would like to swipe current index just by interaction with buttons. How can I achieve that? Here is my QML code: import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 import…
Ruslan Skaldin
  • 981
  • 16
  • 29
7
votes
0 answers

Module "Qt.labs.controls" is not installed

I am trying to run my Qt Quick application on embedded devices. But it says "Qt.labs.controls" is not installed. I installed qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel and qml-module-qt-labs-settings but it does not solve the…
Antirreni91
  • 375
  • 3
  • 16
6
votes
3 answers

opening apk in chrome download list not open the apk Installer

I have a QtQuick2 application.I build it(with signing) for android with Release Configuration with Qt 5.15.1, When I download Apk with chrome And click on it on downloads list on chrome,It should be open with Installer but It will opens with file…
mohsen
  • 1,763
  • 3
  • 17
  • 55
6
votes
3 answers

How to solve module ""QtQuick.Controls" version 2.0 is not installed" on mac

I've been getting the error "module "QtQuick.Controls" version 2.0 is not installed" on Qt Creator 5.6.13, so i upgraded to 5.11.2 and i'm still getting it. Here's the part causing it: import QtQuick.Controls 2.0 Thank you for your help.
imad kimouche
  • 133
  • 1
  • 1
  • 10
6
votes
1 answer

Animated progress bar in QML

I need to create a Progress bar as below using QML Controls 2 : ProgressBar{ id:progressBar width : parent.width * 0.80 height:parent.height * 0.05 anchors.bottom:parent.bottom anchors.bottomMargin: (parent.height * 0.03) …
pra7
  • 834
  • 2
  • 21
  • 50
6
votes
2 answers

QML: Resize CheckBox

I have ListView with my own delegate. import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 ItemDelegate { height: 40 Row { spacing: 10 anchors.verticalCenter: parent.verticalCenter …
Alexander Dyagilev
  • 1,139
  • 1
  • 15
  • 43
5
votes
2 answers

QML: Change cursor color in TextField

How to change cursor color and probably width in QML TextField element? Let say we have following one: import QtQuick 2.12 import QtQuick.Controls 2.12 TextField { id: control placeholderText: qsTr("Enter description") background:…
Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101
5
votes
2 answers

How to make a TextArea have a max size and a scroll bar?

I have a TextArea that will usually only contain about one line of text. I do, however, want the user to be able to add more than that and have the TextArea expand up to a maximum of about 15 lines, at which point any additional text can be accessed…
Kiwi
  • 235
  • 2
  • 7
5
votes
1 answer

How to make the QML controls looks default better?

I create default "empty" qml app in the QtCreator. Then I just add the button and run it: import QtQuick 2.11 import QtQuick.Window 2.11 import QtQuick.Controls 2.4 Window { visible: true width: 640 height: 480 title: qsTr("Hello…
AeroSun
  • 2,401
  • 2
  • 23
  • 46
5
votes
3 answers

How to change the background color of a QML Button Qt Quick Controls 2?

I just want to change the background color of QML buttons but it seems there are no simple way. Can you tell me a simple way to change the background color of QML Button? Thanks! Update: a code I have searched: import QtQuick 2.6 import…
aviit
  • 1,957
  • 1
  • 27
  • 50
5
votes
1 answer

QtQuickControls2 Dialog vanishing on click outside

I am trying to use a QtQuickControls2 Dialog: Dialog { id: dialog x: parent.width/2-width/2 y: parent.height/2-height/2 width:300 height:200 title: "Warning" modal: true …
numberCruncher
  • 595
  • 1
  • 6
  • 25
5
votes
2 answers

OS Edit/Paste menu for Qt Quick.2 TextField

How do I get the OS specific paste menu for a QtQuick.Controls 2* TextField on a right click on selected text. That works: import QtQuick.Controls 1.4 TextField { placeholderText: qsTr("Filter") selectByMouse: true } and gives me the menu,…
martin
  • 3,149
  • 1
  • 24
  • 35
1
2
3
24 25