Questions tagged [qtwidgets]

Questions related to the QtWidgets module in Qt 5 that provides a set of UI elements to create classic desktop-style user interfaces.

The widget set of UI elements was put into its own module to keep Qt Gui modularized and less cluttered for GUI application using Qt Quick and so on.

The official documentation of this module can be found here.

Tagging recommendation:

You will often see questions tagged specifically as for QWidget, et cetera because the question is Qt 4 related even though it is about widget classes. From Qt 5 onwards, please try to use this tag for those cases. Make sure that you only tag questions with that contain questions about the core part of Qt Gui.

300 questions
2
votes
0 answers

QT QFileDialog.getOpenFileName Cancellation crash

I'm a new user of Qt and I'm trying to fix a persistent crashing issue that happens in my 'open file' dialogue. Whenever I open a file dialogue to select a file and decide to hit cancel instead, it causes python to stop working. This is what the…
Fairbz
  • 29
  • 2
2
votes
2 answers

QT: Connect a signal with a fundamental type in its signature to a slot with QVariant in its signature

I'd like to connect a signal with one parameter of a fundamental type like void toggled(bool checked) void valueChanged(int i) ... to a slot with its parameter being of type QVariant: void setValue( QVariant &value ) Is that possible using Qt 5.14…
Lars Hadidi
  • 558
  • 1
  • 5
  • 15
2
votes
2 answers

Why does the Qt3D QObjectPicker not work on Android if the Qt3DWindow is embedded inside a QWidget?

I have a Qt app containing a Qt3DWindow as well as multiple QWidgets. To use both, the Qt3DWindow is embedded via QMainWindow::createWindowContainer() which works fine both on Windows and Android. This is not the case for an QObjectPicker attached…
Taurus
  • 51
  • 5
2
votes
1 answer

QDoubleSpinBox with scaling between value and display

I'm attempting to write a custom QDoubleSpinBox subclass which has a scaling factor / function between it's internal value and the displayed value. The purpose of this is to support displaying the same internal value in different units (e.g. allow…
ajshort
  • 3,684
  • 5
  • 29
  • 43
2
votes
1 answer

How to remove QScrollbar scroll buttons?

I want to style QScrollBar to look like this without the indicators in the end I tried with the stylesheets: QScrollBar::up-arrow:vertical, QScrollBar::down-vertical { border: none; background: none; color: none; …
Rubina
  • 123
  • 1
  • 17
2
votes
2 answers

PyQt : Updating Custom List Widget Item in QListWidget

I was able to add custom QListWidgetItem in QListWidget using the following code - for item in dl_list: widget = QtWidgets.QWidget() card = Ui_DownloadCard() card.setupUi(widget) …
Shivendra
  • 556
  • 3
  • 15
2
votes
1 answer

Enable resizing on QWidget

I want a resize feature in a QWidget using Qt, like the one shown in the image below. I have used following tried following ways: using QSizeGrip, setSizeGripEnabled
Ankul
  • 53
  • 9
2
votes
1 answer

Setting default starting directory for FileDialog

I am trying to set a default starting directory for FileDialog in QtQuick, but it does not work (meaning it always opens the executable's directory) : property url defPath : "/home/saeid/Work/data"; FileDialog { id:dialogPosPath; …
Dumbo
  • 13,555
  • 54
  • 184
  • 288
2
votes
3 answers

Why are QWidgets accessed by pointers?

I am new to Qt5 and I am learning QWidgets to develop an application. I've noticed in many examples, QWidgets are almost always accessed by pointer. For example: #include #include #include #include…
shortstheory
  • 470
  • 5
  • 17
2
votes
1 answer

Change/remove QTableWidget selection tint color

I'd like to have a QTableWidget where the currently selected cell is indicated by adding a black circle over the cell's icon (I have gotten this much to work). I'm currently struggling with the fact that the widget seems to apply a blue tint to the…
Haem
  • 929
  • 6
  • 15
  • 31
2
votes
1 answer

PyQt5 failing import of QtGui, QtCore and so on

[OS] - Windows 7 64bit [Version] - Python 3.4 - PyQt5.4.1 import sys from PyQt5.QtWidgets import QtGui, QtCore I cannot import QtGui, QtCore in QtWidgets. I have qtgui.pyd and qtcore.pyd, but I can't import them... Besides, I have QApplication but…
Mingyu Jeon
  • 1,755
  • 5
  • 23
  • 40
2
votes
1 answer

How to create dialog without blocking main form?

For now I can do: void MainWindow::on_actionPATH_triggered() { std::unique_ptr win(new QDialog()); win->exec(); } Should I use async / run in separate threadto avoid blocking main window or is there way to subscribe to close even…
cnd
  • 32,616
  • 62
  • 183
  • 313
2
votes
1 answer

error when i'm trying to set text in qTextEdit

I'm using Qt 5.3 with MSVC2013. Here is some part of my code: mainwindow.cpp #include "mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setupUi(this); …
2
votes
2 answers

How to launch a windows application in Qt

I'm in the process of trying to figure out how to launch a windows application in Qt. What I'm trying to accomplish is for the user to click on a button and the notepad windows application opens. I understand that their is a notepad feature in Qt,…
user3878223
  • 441
  • 3
  • 7
  • 15
2
votes
2 answers

Qt - how to detect line count increase after word wrapping?

I'm using a QPlainTextEdit control with word-wrapping active and I'm wondering how can I detect, in order to update a line counter, when a block of text gets wrapped (causing the number of lines to be incremented). The underlying QTextDocument has a…
Marco A.
  • 43,032
  • 26
  • 132
  • 246