981 questions
Advice
0
votes
2
replies
46
views
Building Qt6 with proprietary codecs for QtWebEngine
If you're a hobbyist programmer like me, perhaps you have had need to build Qt6 from source so that you can include the proprietary codecs needed to play audio and video from web pages loaded through ...
1
vote
1
answer
73
views
My custom label's text is uneven when rotated
I've created a custom qlabel using pyqt, however the text is slightly uneven when rotated. I've attached a picture of this vs an unrotated label. I've tried fixing it with setRenderHint Antialiasing, ...
1
vote
0
answers
57
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::...
3
votes
1
answer
84
views
pyQt - Trying to draw B-Spline curve with mouse
I am trying to have a Pen Tool in my pyqt6 application. I am trying to make it how Inkscape's PenTool works. For now, I am trying to achieve the 'B-Spline' mode.
The issue is that my curve does not ...
1
vote
0
answers
49
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
114
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
0
answers
145
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
157
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....
0
votes
0
answers
79
views
How to fix QtWebEngine ImportError on Linux?
I am making an editor using Python and PyQt6. I have the same code that works for Windows, but when I run the code on Arch Linux, I get this error when importing QWebEngine:
from PyQt6....
1
vote
0
answers
43
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 ...
1
vote
0
answers
61
views
pqyt6 - How to insert word-wrap in svg content
I'm creating pyqt6 app where I can replace normal fonts/text with svg fonts(.svg files like a.svg, b.svg etc).
My issue is with word-wrap. In normal mode(svg mode is disabled) QTextEdit correctly ...
2
votes
0
answers
104
views
QObject.disconnect() behavior in PySide6
I have the following PySide6 code
import sys
from PySide6.QtWidgets import (QApplication,
QWidget, QPushButton, QVBoxLayout, QHBoxLayout,
QLabel)
class Window(QWidget):
def __init__(...
1
vote
0
answers
56
views
PyQt6 - How can I change the direction of the scale/ruler
I have this Ruler class
Right now the scale looks like the below image. I want the ticks to have their roots towards the view instead of having them outwards. The base of the scale should be inside.
I ...
1
vote
1
answer
67
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 ...
3
votes
0
answers
84
views
How to get accurate timing with PyQT
I'm trying to build an app that will accurately count time between taps, like a tap function on a metronome but finding the results to be inaccurate;
current_time = QDateTime.currentMSecsSinceEpoch ()
...
0
votes
0
answers
47
views
Horizontal scroll on shift in PyQt
I have a PyQt6 Application in which I have multiple QTextEdits, which contain text that sometimes overflow the visible range of the lines. Using the combination of Shift+Mouse-Wheel, my goal was to ...
0
votes
1
answer
89
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
1
answer
66
views
gradient background in pyqtgraph w/ pyqt6
Is it possible to give a gradient background to a plot in pyqtgraph & pyqt6?
Minimal code to start with:
import pyqtgraph as pg
from PyQt6.QtWidgets import QApplication
# Create application
app = ...
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
101
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
vote
1
answer
175
views
Is there any way to obtain a listing of enum names and values in a typedef for QFlags? [duplicate]
As such I (questioner) am no longer looking for an answer but I am not sure on what grounds to recommend closing. It could possibly be helpful to someone.
Here's an example of what I mean (based on ...
-1
votes
1
answer
47
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
1
answer
129
views
Installing pyqt6-tools fails with a MemoryError
I was able to install pyqt6, but installing pyqt6-tools fails with a MemoryError. One thing to note, memory usage for Python spikes up to 3GB.
Here is the output of running pip install pyqt6-tools:
...
0
votes
0
answers
94
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
1
answer
58
views
Set a QApplication on top of the screen with reserved space (like a taskbar)
General overview
I try to set just a minimal taskbar (like Polybar or i3bar, or any task bar you know).
The constraint are the folowing ones:
It should have a dedicate space to avoid overlaping with ...
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
82
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:
...
0
votes
1
answer
64
views
Display floating popup widget box on the header of a QTableView with Python and PyQt6
I'm trying to make a QTableView with Python and PyQt6 that display a popup message and posibly some tools, like filters, when you click in a header section.
I'm trying to replace an excel spreadsheet ...
3
votes
1
answer
94
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
1
answer
168
views
PyQt6 6.9.0 QPainter errors/warnings in command prompt but not in PyCharm
When I create a simple application with the below code, I get the additional errors/messages (all starting with QPainter) in the command line output in some scenarios (detailed in table below).
It ...
1
vote
0
answers
62
views
Drawing a long cursor over a QPlainTextEdit
I'm trying to draw a long cursor in Qt.
I already have a function to edit many lines of a QPlainTextEdit at the same time (<-> alt edition in Notepad++), and my current goal is to display the ...
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 ...
0
votes
0
answers
47
views
Permutate two rows inside QTableWidget [duplicate]
I have a simple QTableWidget with a unique relevant column (the other one still empty for the moment). And I try to permute two rows.
I’ve made this method to my table:
def permuteRows(self, row1=...
0
votes
1
answer
129
views
Pyinstaller PyQt6 app cannot find QtWebEngineProcess
I am making a PyQt6 application using the QtWebEngine module. I am trying to use Pyinstaller to turn it into a .app file that can be distributed. The issue I'm currently facing is that the application ...
2
votes
1
answer
119
views
Problem nesting QT layouts when using if <QT layout> statement
For my application I created a Window class, I minimized my code as much as possible so that there would be nothing unrelated.
The code is below:
import sys
from PyQt6.QtWidgets import (QApplication, ...
1
vote
1
answer
88
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.
...
0
votes
1
answer
87
views
keyPressEvent on a vispy scene embedded in pyqt
I have a vispy scene embedded in a pyqt frame on a pyqt app to display some plots. Now, i need a keypressevent on the whole app for some unrelated thing (a home-made implementation of vim command mode)...
1
vote
0
answers
82
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
0
answers
58
views
About animating the scale of a QDialog
I'm looking for ways to animate the scale of a QDialog to create a smooth animated popup.
Qt widgets don't have a scale property that you can animate, so I tried using a QGraphicsView() and wrapped a ...
0
votes
0
answers
53
views
PyQtDarkTheme: Check‑mark missing for current item in QComboBox popup
I'm using PyQt6 with PyQtDarkTheme and have encountered a UI issue:
When opening a QComboBox popup, the currently selected item doesn't show the usual ✔ checkmark, or it's so low-contrast that it's ...
0
votes
1
answer
60
views
I need to render a Plotter object on QWidget
I am trying to render a Plotter object created by Seaborn.object.Bar() on Qwidget from PyQt6.
plot = (
so.Plot(result, x = 'XXX', y = 'XXX')
.add(so.Bar(color='lightblue'))
....
0
votes
0
answers
91
views
PyQt 6.9: Implementing row movement via drag and drop on a QTableView with hidden columns
I'm working on an application that uses a QTableView and have been trying to get it to respond correctly to dragging and dropping rows in order to rearrange them. After a lot of difficulty, I found ...
1
vote
1
answer
87
views
QMessageBox has clipped children widgets
I have a QMessageBox.question object that I use to confirm that the user wants to close the program. I also have a custom one that I use for showing errors. For whatever reason, since using PyQt6 they ...
2
votes
1
answer
166
views
PyQt6 on Windows : qtquickcontrols2windowsstyleimplplugin.dll: The specified module could not be found
i am trying to test some code using PyQt6. When I try to display en MenuBar in my main.qml, i have this error :
QQmlApplicationEngine failed to load component
file:///C:/Users/[blablabla]/GUIt/main....
0
votes
1
answer
64
views
PyQt6 WebEngine – Detecting username and password fields on a website
I am building a web browser with PyQt6 and its WebEngine framework, and would like to make a password manager that enters usernames and passwords directly into websites in the WebEnginePage being ...
0
votes
0
answers
48
views
QTreeView/QFileSystemModel sort behavior in PyQt6 differs from PyQt5 -- bug or intentionally changed feature?
I have an application using a QTreeView widget and a subclass of the QFileSystemModel. The purpose of the subclass is to modify the way sorting is done on file type (col 2).
With PyQt5, items are ...
0
votes
0
answers
59
views
Add Tab Button on PyQt6/PySide6 QTabWidget [duplicate]
I'm currently extending a program with a tab view. For this i need a button to add tabs, which i would like to have directly next to tabs, like in a web browser. I can't just add it as an extra tab, ...
0
votes
0
answers
53
views
Trouble automatically resizing windows when widgets shrink
I'm having trouble understanding how to implement the various sizing methods and details to cause a containing window to shrink when its widgets shrink.
Below is the code of a minimally reproducible ...