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

How do I edit QMainWindow UI Widget From Another Class?

I need to edit a QLabel from MainWindow's UI in another source file. I've tried messing around with singals and slots, but honestly I'm completely lost and the Qt documentation doesn't help me in this exact situation. I understand that this has been…
Mr. Knot
  • 23
  • 2
0
votes
1 answer

Pyqt gui with buttons and number indicators placed on background image

I want to develop a frontend human interface for my python script that takes various temperature and DI/DOs from Raspberry pi using custom designed electronic circuits. I have managed the python end. Now i wish to put all the input values and…
0
votes
1 answer

PyQt QListWidget doesn't show custom widgets as items

I want to add NodeLinkItemWidgetUI forms (custom widget) as items to the ListWidget in my main app. The problem is, that the items of the correct widget size get added to the list as items but the item content is empty. Here is the code for the item…
J. Stacky
  • 27
  • 6
0
votes
1 answer

How to automatically update a QLineEdit with the value of another variable

I've got an std::string object called str; I've also got an QLineEdit object called line_edit. I need that str reflects whatever the user writes in line_edit, this I know how to do trough signals and slots. But I also need that whenever str changes…
David
  • 1
  • 1
0
votes
1 answer

QTabWidget's QTabBar is a few pixels to the right. How to align it at the same horizontal position as QTabWidget?

I have sub-classed QTabWidget and have two tabs in there. I have overridden ::resizeEvent() of QTabWidget to change the width of tabs, so they can take half of the width of QTabWidget. In TAB1 (left tab), I have a horizontal splitter (QSplitter),…
santahopar
  • 2,933
  • 2
  • 29
  • 50
0
votes
1 answer

Retrieve QSlider child from a QGridLayout

I want to acces the value of the QSliders that are in my QGridLayout, but I don't find the right command. An example of what I try: QSlider* slider=ui->gridLayout->takeAt(1)->widget(); The error message I get is: cannot convert 'QLayoutItem*' to…
0
votes
0 answers

Importing python custom qtwidgets into Qt Designer PyQt5

I do have trouble installing custom widgets into QT Designer. I have a WinPython installation up an running and want to add the following widget to my QT Desinger in order to build my shotgun gui…
Jan
  • 88
  • 5
0
votes
0 answers

Qt: cursor blinking cause repaint of parent widget?

Bellow you can see minimal example code to demonstrate problem. If you run it and give focus to QLineEdit, you get output every second: paintEvent, paintEvent and so on. I can not understand why MyW::paintEvent called on every cursor blinking in…
user1244932
  • 7,352
  • 5
  • 46
  • 103
0
votes
2 answers

taking text from qt line edit and inputting it to .bat

I've got a little qt interface designed to ask the user to input their Username and Password. Basically 2 input fields or lineEdits in Qt after which I verify them using a simple if statement. My goal is that when these are verified, I would like…
skdadle
  • 155
  • 1
  • 2
  • 17
0
votes
1 answer

Change Text Size using QListWidgetItem class

How can we change the size of a text if we are using QListWidgetItem reference for the operations? Any help would be appreciated.
Anon
  • 144
  • 1
  • 11
0
votes
1 answer

Anaconda Python in Visual Studio Code PyQt5 import error

I'm trying to use VSCode as my main IDE for Anaconda Custom Python 2.7.13 on MacOS High Sierra. I'm trying to make a file open dialogue box appear using PyQt5. In Spider the following works fine, but not in VS Code: from PyQt5 import…
Oli
  • 11
  • 4
0
votes
0 answers

qt when qtablewidget is sorting,how to add data in same row?

I use QTableWidget to insert data when it is sorting, there has a problem i can't. For example: QtTest::QtTest(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); ui.tableWidget->setSortingEnabled(true); …
handsome
  • 1
  • 3
0
votes
1 answer

Qt5 ContextMenuPolicy for Python

I'm looking for the right way to set up a ContextMenuPolicy. for a Qt5 "QtWidgets.QTableWidget()" Currently, I've set up the code like this. self.file_table =…
Affex
  • 21
  • 1
0
votes
1 answer

QGraphicsScene addRect incorrect render

I use QGraphicsView widget with attached QGraphicsScene in my program. This part works perfect: std::vector nodesCoordsOnScreen; for(int i=0; i
dimas
  • 13
  • 7
0
votes
2 answers

Error running py2app generated .app, QtWidgets.so "Reason Image not found"

I am running into a very frustrating error that occurs when trying to run my python application (.app) generated by py2app – on my 10.12.6 OS X laptop. PyQt5 was installed using pip3, and has been re-installed since the problem. This is the full…
Sleepy-Z
  • 83
  • 1
  • 12