Questions tagged [qwidget]
QWidget is key part of the Qt C++ classes. QWidget is the base class of all the user interface elements in the Qt framework.
1,463
questions
-1
votes
0
answers
66
views
Qt - Connect()ing Many Ui Objects
I'm currently trying to create a single window/page Qt application which has many interacting widgets (important to note), however I'm having difficulty finding a good way to structure the project.
As ...
0
votes
0
answers
78
views
Adding one widget on top of another
I'd like to set a layout where I have a QTableWidget and a semi-transparent QLabel rendered on top of it, that way the table will appear through the semi opaque QLabel image (png).
I've tried using a ...
-1
votes
1
answer
36
views
QT Creator ListWidget does not display the items correctly
I created a separate class Card, that is a widget. And in class main window I have a listWidget.I'm trying to add the card instances as items. Once the number of cards exceed the size of listWidget, ...
0
votes
0
answers
25
views
PyQt5: A custom subclass of QWidget cannot fill entire window, but QWidget() can, what's the difference? [duplicate]
class customWidget(QWidget):
def init(self, parent=None):
super(customWidget, self).init(parent)
class Window1(QWidget):
def init(self):
super(Window1, self).init()
self.setFixedSize(800, 600)
self....
0
votes
1
answer
70
views
Left alignment of tab names
In PyQt5, it is not possible to create tabs on the left and arrange them horizontally by aligning them vertically. You can place it only on the left, but then the tabs will be vertically arranged.
I ...
0
votes
2
answers
71
views
How to make a child widget added in a slot visible?
The following code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtCharts>
#include <QChartView>
#include <QBarSet>
#include <QBarSeries>
...
0
votes
1
answer
47
views
Qt 6.5.3 : Can't change QWidget position
I have problem with my QWidget window which I can't update position.
I don't use the Ui tool.
I've tried:
QRect screenGeometry;
int x;
int y;
...
0
votes
1
answer
61
views
PyQt - QScrollArea moves widget down to viewport when layout is updated while scrolled down
I have a custom widget that is a table consisting of a QGridLayout inside a QScrollArea. You can place widgets into the cells. I also placed QScrollArea s as headers in the margins of the table. When ...
1
vote
0
answers
41
views
How to make QPolarChart angular axis counterclockwise?
By default QPolarChart has clockwise angular axis:
I need to make phasor diagram widget, but on phasor diagrams angles must go counterclockwise, phasors must rotate like that:
I didn't find method ...
2
votes
2
answers
90
views
Disable parent QWidget and keep only one child enabled
I have a QWidget that has several child items. I want to disable the whole QWidget except for some controls. I tried to achieve this with this code :
{
setEnabled(false);
ui->targetBox->...
0
votes
1
answer
104
views
Why can't I change the window icon on a QMessageBox with setIcon in PySide6?
I have been following an online tutorial and corresponding book by Martin Fitzpatrick to get familiar with PySide6. On the topic of message boxes, it is mentioned there that we can change the icon ...
-1
votes
1
answer
48
views
QTableWidget cell widgets dissapear after swap
I have QTableWidget with 3 columns. First column contains QTableWidgetItem with row name, two other columns contains two cell widgets.
I tried to swap table rows with the following code:
connect(...
1
vote
0
answers
45
views
Splitting mainwindow.cpp into separate widgets with UI access
Currently I have a mainwindow.cpp that is getting quite large. There isn't an immediate necessity to refactor this file; this is just for readability's sake.
The current design of my project has ...
1
vote
1
answer
83
views
paintEvent not being called in custom widget
I am trying to paint a rectangle at the mouse location every time it is clicked.
Currently, the setup is as follows:
TableMaker is my main window and was mostly generated in Qt Designer.
I have ...
0
votes
0
answers
49
views
PyQt5 Sidebar Widget Not Collapsing as Expected
I'm developing a PyQt5 application that incorporates a sidebar widget for displaying various types of information. The sidebar is implemented using QDockWidget and QStackedLayout. I want this sidebar ...
1
vote
1
answer
31
views
How to make a layout fill the entire window in PyQt5? [duplicate]
I'm creating an app in PyQt5 and I want a layout that fills the entire window, except the title bar.
When I try to set a QVBoxLayout to a QWidget, there remains a gap, as seen below:
This is my code:
...
0
votes
1
answer
43
views
How to show child QWidget titlebar when it's in parent QWidget layout?
I have parent widget and two child widgets in it (most likely I will put them in QSplitter). I want to display their names to clearly define where stuff is. Preferably in a frame at the top of the ...
0
votes
1
answer
94
views
Vtk vtkResliceImageViewer loads MPR and displays crosshairs with pyqt5
I use vtkResliceImageViewer to display MPR, set vtkResliceImageViewer().SetResliceModeToAxisAligned, why my crosshair is very virtual and invisible, it will be covered by the image
here is my code
...
0
votes
0
answers
16
views
Integrating a WPF Control into Win32 Program and Sizing According to Parent HWND (Which is a QWidget)
I am currently developing a WPF control which I intend to frame within a Win32 program. My parent window within this context is a QWidget. I have been successful with the integration per se, but I am ...
0
votes
0
answers
52
views
How do I debug a bottleneck in a large-scale Qt application?
Recently, I was debugging something in a very big Qt application. The problem is that I have a stuck (lag) application sometimes. I tried so many things and different ways to find which one was ...
0
votes
0
answers
56
views
How to change file icons in QFileSystemModel
I have a code:
QExplorer::QExplorer(QWidget *parent)
{
QString sPath = "D:/";
dirmodel = new QFileSystemModel(this);
dirmodel->setRootPath(sPath);
treeView = new QTreeView(...
3
votes
1
answer
175
views
Custom collapsible widget causing size issues
I came across this post answer on How to make an expandable/collapsable section widget in Qt, but the proposed solution is not without flaws.
In fact, as you can see below, once the widget has been ...
0
votes
1
answer
112
views
PyQt6: The CheckableCombobox never hides
I'm trying to implement a code capable to create a checkable combobox with PyQt6. My problem is that when I open the combobox for the first time, it stays opened and never hides. The functions seem to ...
1
vote
1
answer
125
views
How to display tab widget corner widget on the left/right side?
I have a QTabWidget with its tabs on the West, then I tried to add a corner widget to it, but it did not appear. If I set the tabs position to North or South, the corner widget gets displayed, but not ...
0
votes
0
answers
19
views
PySide6 Widget Lose Children After Being Added
I am generating UI based on json file contents at run time.
There is a QTab widget. In each tab there is a QScrollArea (parent=QTab) which has a QWidget set for its contents and a QGridLayout to add ...
0
votes
0
answers
39
views
Why is my PyQt6 QPushButton not clicking in my QTableWidget and QWidget on my MainWindow?
Need to understand the origin of the issue as to why my pyqt6 QPushButton does not seem to be clicking or functioning even though I have done everything right in my eyes. I have researched and read ...
0
votes
2
answers
153
views
How to apply QLinearGradient on a round QWidget border using style sheet?
Context:
I am trying to animate a timer progress on a QPushButton border, using style sheet and QLinearGradient.
Here's how I'm doing it:
#include <QApplication>
#include <QPushButton>
#...
1
vote
0
answers
46
views
QLibrary load/resolve problem with QWidget
I have the following Dll, which should show a single QWidget:
file testqtlib.h
#pragma once
#include <QtCore/qglobal.h>
#if defined(TESTQTLIB_LIBRARY)
# define TESTQTLIB_EXPORT Q_DECL_EXPORT
#...
0
votes
2
answers
82
views
class doesn't receive a signal from Re-implemented QVideoWidget
I'm developing a Video-Player App,
I have made a class and Re-implemented QVideoWidget in it, then I promoted QWidget to this Class.
I want to send a Signal from this Class to another Class to do a ...
1
vote
1
answer
127
views
PyQt5 QDockWidget Title Bar Widgets
I am creating a plugin for QGIS using PyQt5 and have implemented a dock widget that shows all layers. I was wondering if it was possible to add buttons to the Title Bar of the dock widget like the ...
1
vote
1
answer
90
views
Custom QSplitter handle button not disappearing when toggling off righthand widget
I'm experiencing an issue with a custom QWidget/QSplitter implementation where the handle button for the righthand widget does not disappear when the widget's visibility is toggled off (using QWidget::...
0
votes
1
answer
115
views
C++ Qt add multiple widget like QPushButton with variable Names
I want to add some Widget (QPushButton for example) in my central Widget inside a layout
I can do it with :
QPushButton *but1 = new QPushButton(ui->centralwidget);
but1->setText("...
0
votes
1
answer
52
views
How to add back a removed widget by removeWidget() from a QStatusBar?
I have read the QStatusBar class Documentation, and it is says that removeWidget():
does not delete the widget but hides it. To add the widget again, you must call both the addWidget() and show() ...
0
votes
0
answers
181
views
A runtime warning if QOpenGLWidget is added via Qt Designer
I have added a QOpenGLWidget object on the main window and this makes the console have a lot of messages such as
QOpenGLContext::makeCurrent() called with non-opengl surface 0x2623b7b7460
QRhiGles2: ...
0
votes
0
answers
48
views
Inheritance on Qt classes with diamond deppendency
I have a Qt application where I put an ImageView on the center of the program. This class inherits from QGraphicsView, and on the top level is the QWidget class. To be more modular, I created another ...
0
votes
0
answers
55
views
Widgets+QML Android
everyone!
For my application I need to use QGraphicsView and the QML interface.
For this I have two ways:
QQuickWidget.
QQuickView + QWidget::createWindowContainer
But for the two approaches I have ...
-1
votes
1
answer
45
views
how do i show a widget from a diffrent widget?
i have two widgets, one of them is a main widget (even though it uses Qwidgets.Qwidget), and the other one is a side widget that is supposed to appear from the main widget.
i tried to use a button, ...
1
vote
1
answer
64
views
How to add/repeat the same widget on QVBoxLayout
Next code displays just only one instance of the button;
VBoxLayout * layout = new QVBoxLayout(widget);
QPushButton * btn1 = new QPushButton("1", this);
layout->addWidget(btn1);
layout-&...
0
votes
1
answer
286
views
PyQt6: Removing ALL padding around widget [duplicate]
I'm trying push two QLineEdit-widgets all the way up to each other, but no matter how and when i call setContentsMargins(0,0,0,0) , it just does not seem to remove all margins. I've tried googling, ...
2
votes
1
answer
267
views
Unknown type name 'QHBoxLayout'
I'm using QT 6.4.2 at Windows that write App, but when I need to use QHBoxLayout, I get
error:Unknown type name 'QHBoxLayout'
so I open help document in QT, that found sample about QHBoxLayout, I ...
0
votes
0
answers
119
views
Accept mouse input in QWidget shown while right mouse button pressed
My usecase is as follows: I am making a simple drawing app, and one of the "innovations" is to hide the tool palette until the user presses and holds the right mouse button at which point ...
0
votes
0
answers
32
views
Change QTabWidget content background color
I've been trying to do this for a while but still haven't made it work.
I'm looking to "paint" the background of the tab content to black to be congruent with the graph. By searching online ...
0
votes
2
answers
217
views
QWidget::mousePressEvent() not called
I'm working on a TreeViewNode class derived from QObject and QGraphicsItem, responsible for creating the individual nodes of the tree view (which displays a family tree) and adding them to the scene. ...
0
votes
0
answers
119
views
OpenGL with SRgb color space no longer works in Qt6.4+
I have an OpenGL application with a QWidget-based (no QtQuick/QML) Qt UI that I ported from Qt5 to Qt6. Most of it works fine, except that with Qt 6.4 and the Qt 6.5 beta (Qt up to 6.3 works fine!), ...
0
votes
1
answer
58
views
How to switch between two QGraphicsView inside a QWidget
I have two different views to display inside a QWidget window. Each view has a separate QGraphicsScene.
I want to toggle between the two views on button click.
This is my current implementation:
...
0
votes
1
answer
64
views
How to close a QInputDialog with after a defined amount of time
I'm currently working on an application that run in the background and sometime create an input dialog for the user to answer. If the user doesn't interact, I'd like to close the dialog after 30 ...
0
votes
0
answers
165
views
AttributeError: 'QTextBrowser' object has no attribute 'setFrame' [duplicate]
What is wrong in the code? I am new to QtPy6 and trying to make a vritual book with it.
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QTextBrowser, QFrame, QLineEdit, QPushButton
...
0
votes
0
answers
38
views
How do I Update on Qwidget?
I wanna create a QWidget with 2 button and 1 label where this widget will be connected with a database in PYQT6. Now 1st button will move to previous data and 2nd button will move to next data and in ...
-4
votes
1
answer
232
views
name 'QTableWidgetItem' is not defined
I tried install all rquired libsI tried install all rquired libs and Im so sorry I am new here,Im trying to show datas in database on that widget and this problem occurs,I searched all others about ...
0
votes
0
answers
294
views
Qt: application crashes when using QWidget::show()
I know that this type of problem has been reported before, but the answers weren't helpful to me. This is the code situation:
// main.cpp
#include <QApplication>
#include "game.h"
...