Questions tagged [pyqt4]
PyQt is a set of Python bindings for Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux.
5,640
questions
0
votes
1
answer
23
views
PYQT5 Open menu on cursor position in QTextEditor
I have a QTextEditor which I would like to open a menu for user to choose when he press Ctrl+Space.
I was able to capture the key events and create the menu and trigger it.
My problem is to open the ...
0
votes
0
answers
38
views
PyQt table row background colour based on cell value with SQlite database
`hi, How to change row color based on the Yes/No column. I am using sqlite as a database.
Below is my code where i want to change color of cells
My PyQt table =====>
SQlite Database ===>
...
0
votes
0
answers
43
views
Create Folder with browse button and get name of folder from a qlineedit text pyqt
as a sub-part of my pyqt dashboard project ,i am stuck with a problem, where i use button titled browse to open a dialog to select images, and a qlineedit to give the person name and id , what i ...
0
votes
0
answers
19
views
Custom List Widget With Scrolling [duplicate]
I am trying to make a program that shows somewhat a thumbnail with image and text.
Something like this
But I don't seem to find any way we can make a ListWidget with the design that has both image/...
0
votes
0
answers
22
views
PyQt5 Style Slides CSS
I am trying to make similar style slides using CSS for pyqt5
I am trying to make similar style slides using CSS for pyqt5 I tried making it in QTDesigner but I can't seem to do it correctly.
0
votes
0
answers
17
views
How to change Table Widget background color in PYQT5 [duplicate]
I am trying to change the background of a table widget column and row in pyqt5 designer but I don't see any option. I tried adding a background color in stylesheet but still it doesn't change the ...
0
votes
0
answers
28
views
PYQT5: Using a for loop or something else to create many QLabel/QPushButton of the same type
I'm using PYQT5 to create a GUI to display buttons and labels, and I want an efficient way to create many of the same type but with different names. Currently, I have to copy paste the same code to ...
0
votes
0
answers
25
views
Is there a way to deselect selections/clearSelection() for QListWidgets in PyQT6?
I have a class whose function is to detect clicks on a QFrame. I used the QObject for this class function. See here
class MouseObserver(QObject):
def __init__(self, widget):
super()....
0
votes
1
answer
142
views
Dynamic theme changing in PyQt application
I need to develop a dynamic theme changing in PyQt application, I have different components, and depending on the theme I need to change styles. I need to change the theme from some specific component ...
0
votes
0
answers
29
views
What would be the be the best way to view and compare data in same Main window side by side IN PyQt5
Sorry if this sounds a bit too Noobish but, I'm having a bit of an issue finding out which would be the best way to do this is PyQT5.
Assuming you have 2 data sets filled with data.
Example
#Dataset1
...
0
votes
0
answers
28
views
Is there any pyqt5 addwidget function that can be used with pyqtgraph?
I want to embed pyqtgraph inside the page, which is in stackedWidget widget.
self.waveplot = QWidget(self.wave_frame)
self.waveplot.setMinimumSize(QtCore.QSize(1124, 400))
self.waveplot....
0
votes
1
answer
165
views
How to change application theme while program is running in PyQt?
I have an application in which there is a library of components, the styles of each component are set not in one place, but in the file of each component. For example, I have custom components Button, ...
0
votes
0
answers
63
views
Cannot install Pyside or PyQt4 to use ghost.py
I am trying to use ghost.py which requires PySide or PyQt4. I tried to install PySide with pip.
PySide Installation Error
Then when I try to install PyQt4 instead, I get this result:
PyQt4 ...
0
votes
1
answer
41
views
QTextEdit alignment fails on pasting text
i used QTextEdit and used alignment to make it center , it work fine as long as i'm writing but if i copy and paste text to it, it breaks the alignment and start to write from left to right, how to ...
0
votes
0
answers
25
views
PyQt4 qApp.topLevelWidgets() causes segmentation fault sometimes(!)
all 3 variants:
QtGui.qApp.topLevelWidgets()
QtGui.QApplication.instance().topLevelWidgets()
app = QtGui.QApplication(sys.argv)
app.topLevelWidgets()
sometimes (~5% testcases) in Jenkins under ...
0
votes
1
answer
23
views
Unexpected EOF While Parsing : self.+widgetName+.text()
I am trying to create an autoconnector for the signal/slot connection for Qwidgets but I'm getting an Unexepcted EOF While Parsing error. I'm not familliar with this error, from what I could ...
0
votes
0
answers
50
views
No touch events available when QGraphicsView is visible
I have an PyQt4 application which is deployed on a touch device. The central widget is a QTabWidget. All pushbuttons are touch enabled using the setAttribut() method. Now, the application shall get ...
0
votes
0
answers
9
views
Where ist connect Method PyQt4 -->PyQt5? [duplicate]
i have a script, which i made with the help of a tutorial. In the Tutorial they use PyQt4, but I have PyQt5. So, there is this connect method, which i heard, that it was deleted in PyQt5 and therefore ...
0
votes
0
answers
16
views
PyQt5 use of "&" in a Label [duplicate]
How can I include the & character in a label. I've tried it, but it's not visible!
The first screenshot shows that I write the & character in the text field of a button. After confirming you ...
0
votes
0
answers
566
views
PyQt5: When button is clicked, more options are available for selection
I want to create a virtual keyboard for Windows like you have on a smartphone.
At the moment I'm asking how I can get the popup when you press a keyboard for 1 second and a popup or something like ...
0
votes
0
answers
59
views
Yum Download (Online Machine) to Install (Offline Machine) Not Working PyQt4
I am trying to install PyQt4 on an air-gapped offline machine.
On an online machine I do
yum install --downloadonly --directorydir /path/to/store/it PyQt4-devel
I then transfer the entire directory ...
0
votes
0
answers
177
views
ImportError: No module named PyQt5.QtWidgets after converting python2 to python3 and pyqt4 to pyqt5
I have a program that was written in python2 and PyQt4 that I want to upgrade/convert to python3 and PyQt5.
I have changed the code/syntax from python2 to 3, and fixed the imports from PyQt4 to PyQt5, ...
0
votes
0
answers
306
views
Set and Change x-axis string values pyqtgraph
How to set the x-axis values to string and be able to change it later
The code for the graph
self.plt=pg.PlotWidget()
self.x = ['a', 'b']
self.y = [0,1]
self.plot=self.plt.plot(self....
1
vote
1
answer
248
views
PYQT5 GIF freezes on GUI initialization
Keep gif running while GUI starts. Is that possible? I have read many reporitys but none with the true and understandable answer.
I have prepared a code example that shows the problem.
import sys
...
0
votes
0
answers
37
views
PyQt5 Methods Not Showing
I am trying to build a user interface for controlling a robot and a massive issue I am having is the lack of functions. When I use Qt Designer, everything is imported afterwards, and I have imported ...
0
votes
1
answer
1k
views
PyQt4 : Module not foundError
I am trying to run a Python file that references PyQt4 using PyCharm. I get the following error message:
from PyQt4 import QtCore, QtGui
ModuleNotFoundError: No module named 'PyQt4'
I am running a ...
1
vote
1
answer
238
views
How to make a partially editable tree model in Qt
I want to change the editable tree view example that qt provides so that the first column is not editable, while the next one is.
Here is the repo:
https://github.com/pyqt/examples/tree/master/...
1
vote
1
answer
153
views
Pass in dynamic widget object to QVariantAnimation valueChanged signal handler
I'm trying to make an invalid animation tool. I have a button that when pressed, animates the background color of a field from red to the "normal" field color. This works great but now I ...
0
votes
0
answers
245
views
Installing PyQt4 on python 3.7. getting error
I am trying to install PyQt4 on python 3.7.
I get this error:
ERROR: PyQt4-4.11.4-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
I downloaded the PyQt4 on my computer, and ...
0
votes
1
answer
267
views
PyQt4 not installing on Python 2.7
I am using an older code which uses extensive PyQt4 modules.
Rather than rewrite it, I am using an older version of Python 2.7 and installing PyQt4. I saw people say to use pip install PyQt4‑4.11.4‑...
0
votes
1
answer
813
views
Handle mouse events on both parent and child widgets (button don't consume event?)
Here's my setup:
I have a eventFilter on my QTableWidget to handle both mousePress and mouseRelease events.
I also have a custom class for the QPushButton to handle mousePress and mouseRelease events....
0
votes
1
answer
189
views
Auto resize QLabel to fit updated QTableWidget span
I have a QTableWidget, and I have a QLabel that I put inside a cell of the table using .setCellWidget().
During run-time I change the span of the QTableWidget cell where the QLabel is, using .setSpan()...
0
votes
0
answers
74
views
Is there a way to use pyqtgraph with pyqt4?
I'm working on an old code for work, and I "have to" use pyqt4. I will need to check in with whoever initially wrote the code if i really need to stick with pyqt4.
In the meantime, I cant ...
0
votes
1
answer
129
views
How can I refresh my QWidget more than once a second using QTimer?
I want to build a GUI displaying imformation which is updated every 10-100 ms. I was trying to implement this into the QTimer example by stting Qtimer.start(100) but it keeps updating only once a ...
1
vote
0
answers
170
views
Is threre a way to autopan to the last value at the end of a graph in pyqtgpraph?
I'm working on a Python UI project that I'm drawing live data to the pyqtgraph widgets (I'm doing real time data drawing to the graphs with 1hz freq). This is my first project with Python and ...
1
vote
0
answers
51
views
GraphicView scaling (zoom in/out) limit using WheelEvent
I'm using wheelEvent in order to control the scale(in/out zoom) of an image in my python made application.
The zoom control works! and the self.scale(delta, delta) is controlling the scaling(if the ...
0
votes
1
answer
202
views
How can I set today is date and specific time of the day in QDateTimeEdit in PyQt4?
This is the code I have written:
dt = dt or self.cal.selectedDate()
date_time_str = str(dt.toString(QtCore.Qt.DefaultLocaleShortDate)) + " 10:00:00"
now = QtCore.QDateTime.fromString(...
0
votes
0
answers
102
views
Get PyCharm to acknowledge PyQt4 package (Ubuntu)
I have moved from Windows, where my PyQt4 development was working, to Linux where it is not.
I went through the process to download each tool, including python2.7 and PyQt4 from https://www....
0
votes
0
answers
303
views
How to make a label inside a Plot Widgets?
I am trying to embedding widgets inside PyQt applications.
Here is my Code.
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
import pyqtgraph as pg
from PyQt4 import ...
0
votes
0
answers
104
views
PyQt4.QtCore runtime-error: how to downgrade sip/API?
I am trying to run a legacy python 2 code from 2011 (written by another person). I installed the required old libraries with anaconda in a python 2.7 environment. It needs PyQt4. I'm on Linux (Fedora ...
0
votes
1
answer
294
views
connect() failed between selectionChanged and my pyQtSlot after updating from Qt4 to Qt5
I have recently been put onto a project which is using PyQt. It was using Qt4, but due to the pains of installing it on up-to-date systems, along with all other tools and packages, I decided to update ...
-4
votes
1
answer
85
views
Convert from PyQt5 to PyQt4 [closed]
Hey brothers and sisters, I just wondered if anyone could help me convert this program to PyQt4. I did my best however I couldn't ;,). It is a basic program for displaying Real Time text on the UI.
...
1
vote
1
answer
398
views
How can I add a vertical scrollbar to a QListWidget()
I have a QListWidget which contains QListWidgetItems that exceed its visible boundaries and I would like to add a vertical Scrollbar. I have tried the following:
sz = QtCore.QSize(200,200)
_lstwdgt = ...
0
votes
1
answer
29
views
How to clear all the widgets except labels [duplicate]
H,
I have a frame and in side frame there are many widgets as shown.
Widgets can be clear in a frame using the following code
for widget in parent_widget.findChildren(QWidget):
if hasattr(widget, ...
1
vote
0
answers
259
views
'make' is not recognized as an internal or external command [duplicate]
I'm trying to install sip for pyqt4, I have followed the installation instructions but when I want to execute the make command I get this error:
'make' is not recognized as an internal or external ...
0
votes
1
answer
45
views
Why does QPushButton not respect absolute pixel size?
I'm working on an application that's running on an embedded device with a touch LCD screen. For development setup, I have setup a Xephyr window with the matchbox WM at the same resolution (1280x800).
...
0
votes
1
answer
106
views
Color QPushButton plain white
I ould like to color a QPushButton in plain white, removing the 3D shade.
The following stylesheet:
'background-color: rgb(255,255,255); \
border-color: rgb(92,92,92);color: \
rgb(92,92,92); \
...
3
votes
1
answer
378
views
Is there a signal for QComboBox in PyQt for when editing is complete?
In my application, it's problematic to have the editTextChanged signal sent after every single key press. I'd like to get the signal when the user presses enter or changes focus. Is there a simple ...
1
vote
1
answer
64
views
display two color font on QToolButton
I want a button that shows a text with two colors. I've tried the following:
import sys
from PyQt4 import QtCore,QtGui
class Example(QtGui.QWidget):
def __init__(self):
super(Example,...
0
votes
1
answer
197
views
How to sort QTreeWidget Column?
I have small UI where I am using QTreeWidget and it contains 4 columns ['Folder', 'FileName', 'Size', 'Owner']
Now when I click on 'Size' Column to sort, it doesn't sort in correct order of (B, Kib &...