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

QWebEngineView - Load html from resources

I'm currently playing around with QWebEngineView in Qt 5.8 and I would like to load an index.html file from my .qrc file. My .pro file looks like this: TEMPLATE = app TARGET = Launcher QT += webenginewidgets CONFIG += c++14 SOURCES +=…
TorbenJ
  • 4,462
  • 11
  • 47
  • 84
3
votes
1 answer

"Module use of python34.dll conflicts with this version of Python"

My knowledge of Python is still pretty basic, and I am only now trying to wrap my head around how to use / call libraries from within Maya. (Because I need to create a basic UI from QT Designer and have it be opened in Maya after converting it to a…
Gogo
  • 53
  • 1
  • 2
  • 8
3
votes
0 answers

v4l2 overlay on Qt

We are working on a ov5640 sensor camera, we brought up the camera on our ARM platform(based on i.Mx6) and we tested the camera using v4l2 overlay application. Now we need to use that v4l2 application in the Qt5. Is any application explaining us…
sarjoon
  • 41
  • 6
3
votes
2 answers

Group of objects

In my Qt5 program I'm working on multiple objects and it's taking a lot of time and code to disable or change state of 20 checkboxes. Is there any option to make a group of checkboxes (or any other objects) and perform commands on it with one…
km2442
  • 779
  • 2
  • 11
  • 31
3
votes
0 answers

OpenSceneGraph integration in Qt MainWindow

I have the following code which is a modification of the code given by OpenSceneGraph (https://github.com/openscenegraph/osg/blob/master/examples/osgviewerQt/osgviewerQt.cpp) for integrating OSG with Qt: OSGViewer.h #ifndef OSGVIEWER_H #define…
Kostas
  • 270
  • 1
  • 3
  • 10
3
votes
1 answer

qt-updating ui by thread

hi I have a problem with updating ui by a thread. code works correctly but the problem is when I want to move my window as you know in that moment ui thread will stop updating. and my thread sends values to stopped thread that causes error. I don't…
user4000670
3
votes
1 answer

Qt: Hide folders in getSaveFileName

I would like to save a file using QFileDialog::getSaveFileName without allowing to choose the path or at least hide folders. Reading the doc I tried to set QFileDialog::ShowDirsOnly as an option like this: QString fileName =…
Jeanstackamort
  • 309
  • 2
  • 4
  • 16
3
votes
2 answers

What's painter.setViewport exactly do?

I know how painter.setWindow works. for example, if I maximize the widget larger, whatever I drew in that widget gets larger also in the same ratio. but I can't understand what painter.setViewport exactly do. Can anyone explain to me how it works…
Tito Tito
  • 248
  • 3
  • 10
2
votes
1 answer

Crop QGraphicsVideoItem

I have a QGraphicsVideoItem added to a QGraphicsView widget. How can I crop the item so I don't see part of the displayed video? I have tried doing this: class OverlayWidget(QWidget): def __init__(self): super().__init__() scene…
Jaime02
  • 299
  • 7
  • 21
2
votes
1 answer

Get the position of a QWidget that is inside a QGraphicsItem

I have a QWidget with a QPushButton, at the same time, this QWidget is embedded into a QGraphicsItem, which is inside a QGraphicsScene. I need to draw a line between two of those QGraphicsItems pointing to the QPushButton. For that, I need to get…
Tac
  • 25
  • 6
2
votes
0 answers

How to fix a broken sizeHint in core controls modified by a stylesheet?

I have an application that styles QAbstractSpinBox using an application-wide stylesheet, that goes like this: QAbstractSpinBox { border: 2px inset grey; text-align: right; padding-left: 1px; padding-right: 1px; …
Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
2
votes
0 answers

How to use PasswordEdit from qtwidgets with other QLineEdit widget in a window

So I want to make a form using Python PyQt5 that inputs the username and password. This is what I have done so far from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import * class Ui_Dialog(object): def setupUi(self, Dialog): …
2
votes
2 answers

Qt 6.2: Menus Truncated initially on Windows

In my Qt 6.2.0 application menus are truncated on initial display after starting the program on Windows 10. On the Mac the problem did not occur yet. This only happens once per Menu (once per Edit, once per Mode etc...) - but not for all Menus. It…
RED SOFT ADAIR
  • 12,032
  • 10
  • 54
  • 92
2
votes
2 answers

How to draw Qt widgets in a QTabWidget in non-selected tabs?

My QTabWidget has 2 tabs on launch. Tab 1 is the one that's opened upon launch. Tab 2 contains some widgets of which I take the QSize to later draw similar elements in newly opened tabs. The problem is that currently the size of the elements is…
Turtle10000
  • 213
  • 1
  • 13
2
votes
1 answer

How to prevent QListView from calling sizeHint of each item?

I have a QListView with a lot of items that are of various heights. I implement a custom delegate for painting items and set layout mode to Batched. However, when the model is assigned, the list view requests sizeHint for every item in the model…
Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
1 2
3
19 20