980 questions
1
vote
0
answers
54
views
How to remove white space between QTableView and QHeaderView?
Does anyone know how to remove this white space? This is my current stylesheet:
QTableView {
background-color: #EEEEEE;
}
QTableView::item {
background-color: transparent;
}
QHeaderView::...
1
vote
0
answers
45
views
MacOS Bus Error and app crash when using PyQt6
I've been hobby writing a little budget tool for myself over the last few months, and have finally gotten some ok functionality. Decided to polish it a bit and make it act more like a GUI app.
Running ...
2
votes
1
answer
105
views
PyQt6: keep widget width in a layout equal [closed]
I have a main layout in PyQt6 with a left and right side (QHBoxLayout containing two elements). I want both sides to always be 50% of the main window width. However, when a widget on the left side ...
1
vote
1
answer
10k
views
No module named 'PyQt6' [closed]
I wanted to use pyqt6 with qtdesigner, I installed pyqt6 version 6.1 and it's tools (which include qtdesigner) and the installation was successful. After installation I opened qtdesigner and created ...
1
vote
0
answers
129
views
Encountering qtpy.QtBindingsNotFoundError when running an EXE generated by Pyinstaller
Summary
I am generating an EXE for a Python project using Pyinstaller.
I am using Powershell on Windows 11 and a Python 3.11 in a Poetry virtual environment.
I keep encountering the following error ...
2
votes
0
answers
151
views
Is there an equivalent of "em" for font sizes in PyQt6 StyleSheets?
In pyqt6, i am creating a fillable form. I'd like the first element in the form, the title, to be 25% larger than the rest of the elements in the form. In CSS, i'd do this by setting:
{font-size: 1....
1
vote
0
answers
38
views
How to make QTableView's drag selection behave like a QTreeView
There's a difference in behaviour between QTableView and QTreeView when it comes to selecting multiple items by dragging the mouse.
In a QTreeView you can start outside the populated area and drag ...
14
votes
9
answers
16k
views
How can resources be provided in PyQt6 (which has no pyrcc)?
The documentation for PyQt6 states that
Support for Qt’s resource system has been removed (i.e. there is no pyrcc6).
In light of this, how should one provide resources for a PyQt6 application?
1
vote
1
answer
57
views
Pybind11 cannot integrate with Qt 6.9.1
I included Qt 6.9.1 header files and pybind11/pybind11.h in a same file. but then I use python to build a package.(the compiler is MSVC2022 x64 and I only use CMake)
this is part of setup.py:
import ...
0
votes
0
answers
63
views
PyQt6 QTextEdit won't expand as much as it should
I am trying to create a UI that resembles OpenAI's, where code and markdown snippets follow each other and markdown and the code are parsed/syntax highlighted accordingly. I've been using PyQt6 and my ...
0
votes
1
answer
84
views
Strange border around popup when adding drop shadow with MultiEffect
I'm attempting to add a drop shadow effect around a QML popup, but when I do this with a MultiEffect, it creates an additional border around the popup (beyond the shadow).
Here's a minimal QML example ...
0
votes
0
answers
46
views
Moving from matplotlib to pyqtgraph: how to reuse PlotWidgets?
I have a large gui app based on matplotlib which is horribly slow (on windows) so I am trying to re-host it on pyqtgraph (which seems to be much faster).
I am facing the following problem: I need to ...
0
votes
0
answers
38
views
How to enable back windows animations if I disabled the default windows frame with the respective flag?
I disabled the window frame and made my own window frame, but it also removed all window animations when maximizing/minimizing or closing etc. How to enable them back without enabling the default ...
1
vote
1
answer
90
views
Must construct a QApplication while it is already constructed?
Here is the code.
import sys
from PyQt6.QtWidgets import QApplication
from qpageview import View
app = QApplication(sys.argv)
view = View()
view.show()
sys.exit(app.exec())
When I run it from ...
-1
votes
1
answer
46
views
How to fix Permission Denied error in the built app by pyinstaller?
I built my app, which has access to some files in its folder, which it can change (rewrite). Exactly they are config.ini and save file. When I run it in VS Code everything works perfectly, and when I ...
0
votes
2
answers
101
views
Saving a website screenshot with pyqt6 / QtWebEngineView is always empty
I'm trying to save a screenshot of a website with QtWebEngineView, but the resulting image always ends up being empty.
import sys
import time
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from ...
0
votes
0
answers
90
views
Axis labels clipping or cut off in pyqtgraph PlotWidget
I am trying to make a QWidget wrapper class which has a pyqtgraph.PlotWidget within it to plot my data. But when I add labels into my graph, it somehow gets cut off or clipped at the edge of the ...
0
votes
0
answers
51
views
Making a TableView item function like QComboBox instead of a QLineEdit in PyQT
I wrote a class that makes a window, part of this class is a function dynamic_table_view that creates a TableView widget with a possibility to view data and edit it right in that same window:
def ...
0
votes
0
answers
76
views
PyQt6 has incompatible architecture; using arch commands with pip ineffective
I'm working on a project that uses PyQt6 , but when I try to import it into my program, it throws and ImportError and says that it has 'incompatible architecture'. The full error message is:
...
3
votes
1
answer
93
views
Are Enums optional in PyQt6
I have two python programs running in the same virtual environment using PyQt6.5 on MacOS Sonoma 14.5 and python 3.11. Both execute just fine. One uses the updated enums for PyQt6 for QMessageBox as ...
0
votes
0
answers
43
views
Trigger a QMenu submenu item through code [duplicate]
I am trying to trigger through code the clicking of a QMenu submenu item. For example, I want to trigger "report 2 under Jack's reports" in the following QMenu/submenu:
The following will ...
1
vote
1
answer
87
views
Qt6 QListView - how to set the colour of the current item bar?
Recently made the change from PyQt5 to PyQt6, and one of the side-effects is that PyQt6 honors the windows theme - as I use dark theme, its meant that its changed the colours of the objects on my app.
...
9
votes
8
answers
11k
views
Alternative to "QMessageBox.Yes" for PyQt6
I am trying to port over a script of mine from PyQt5 to PyQt6. I have figured out how to port most of the things thanks to this answer, however, I have run into an issue.
I have figured out that PyQt6 ...
1
vote
0
answers
81
views
Why does PyQt6 leave large gap between dock widgets after docking them?
I'm using qtpy (wrapping PyQt6) and have a window with dock widgets like so:
However, when I drag and re-dock a dock widget, for some unknown reason the widget redocks with a huge gap between the ...
0
votes
2
answers
5k
views
New way of dark mode in PyQt6/PySide6
There is 'old' way of setting dark mode in PyQt6/Pyside6 answered here: How do I use QT6 Dark Theme with PySide6?
But I found official Qt blog post https://www.qt.io/blog/dark-mode-on-windows-11-with-...