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.

PyQt is developed by Riverbank Computing.

It is available on all platforms under a variety of licenses including the GNU GPL (v2 and v3) and a commercial license.

Unlike Qt, PyQt v4 is not available under the LGPL.

5631 questions
10
votes
2 answers

disable progress bar animation in Qt

Is it possible to disable animation of the progress bar in Qt and make it behave like a meter instead? Below is the default behavior, and I would instead like it to not have the shiny wave go through it periodically. I was hoping to use it to show…
waspinator
  • 6,464
  • 11
  • 52
  • 78
10
votes
2 answers

How do I create an all in one exe file from cx_freeze (or installer) from python 3.3

I have made a GUI python script that I would like to share with my coworkers to improve productivity. I need a way to include everything in one file/directory for them to use. I tried the standard python setup.py build But it does not contain…
mad5245
  • 394
  • 3
  • 8
  • 20
10
votes
4 answers

PyQt Window Focus

I am trying to give focus to a window if the user clicks on another window. Right now i have two windows: Window A is behind, and Window B is in front. When Window B appears, it disables Window A. Now what i want is that whenever the user clicks…
Uahmed
  • 1,847
  • 5
  • 29
  • 45
10
votes
6 answers

How do I respond to an internal drag-and-drop operation using a QListWidget?

I've got a Qt4 application (using the PyQt bindings) which contains a QListWidget, initialized like so: class MyList(QtGui.QListWidget): def __init__(self): QtGui.QListWidget.__init__(self) …
Chris B.
  • 85,731
  • 25
  • 98
  • 139
10
votes
2 answers

How to draw a line with animation in PyQt4

I have a list of points. For example, points = [[160, 75], [115, 567]]. How to draw a line in PyQt4, so it would be something like this: Thanks in advance. EDIT: For the record, I'm trying to implement Bezier Curves, so it looked like this: Here…
SaulTigh
  • 913
  • 2
  • 14
  • 27
9
votes
2 answers

Add text to QPlainTextEdit in PyQT (the result is a status log)

I am trying to build a StatusLog, every move that happens on an application. For example, the user clicked in the button1, the progressBox must receive a string like "user clicked the button1". I've searched and found a link but I can't put that…
Rafael Cardoso
  • 121
  • 1
  • 1
  • 9
9
votes
3 answers

PyQt - how to detect and close UI if it's already running?

I'm starting the UI from within Maya. If the UI hasn't been closed, running the UI again will completely freeze Maya (with the error "Event Loop is already running") Manually closing the UI before re-running the script will prevent it from freezing…
Panupat
  • 452
  • 6
  • 21
9
votes
1 answer

applying python functions directly to Qt designer as signals

I am new to Qt and GUI programming overall but i have done a fair bit of coding in python - writing modules and so on. I need to develop simple GUIs for some of my old modules. What i am trying to do can be represented by the following simple…
linuS
  • 171
  • 1
  • 8
9
votes
2 answers

How to add border around QWidget?

I am using PyQT4 to create a sample application for a prospective client. I am looking for some way to put a border around a specific widget. Please give me some pointers to look for. updated : class CentralWidget(QtGui.QWidget): def…
Vijay Shanker Dubey
  • 4,308
  • 6
  • 32
  • 49
9
votes
1 answer

Enable QLabel to shrink even if it truncates text

How can I get a QLabel to be resized even if it means truncating its containing text? I have a QLabel stretching the whole horizontal space of a Widget. When setting its text I make sure it is correctly truncated, ie getting its FontMetrics and…
Voo
  • 29,040
  • 11
  • 82
  • 156
9
votes
5 answers

Masking QLineEdit text

I am using PyQt4 QLineEdit widget to accept password. There is a setMasking property, but not following how to set the masking character.
RKh
  • 13,818
  • 46
  • 152
  • 265
9
votes
5 answers

How to add custom AxisItem to existing PlotWidget?

I'm trying to add custom AxisItem in pyqtgraph to existing PlotWidget that was generated by Qt Designer. There is related topic here, but there is no exact answer with code example and I cannot comment, so I've created a new topic. This is my…
enclis
  • 375
  • 4
  • 11
9
votes
1 answer

How to organize GUI Code for a PyQt project?

i am looking for something similar to Organizing GUI code, but for Python and PyQt4. Especially, I am looking at tips and examples of how to handle and store the configuration data, general state etc. EDIT: I have found some hints regarding older…
data
  • 2,493
  • 2
  • 19
  • 21
9
votes
3 answers

How to change font size of child QLabel widget from the groupBox

How can use different font & size for the child Widgets in the GroupBox and the tittle for the GroupBox in python def panel(self): groupBox = QtGui.QGroupBox("voltage Monitor") groupBox.setFont(QtGui.QFont('SansSerif', 13)) # the…
user2345
  • 537
  • 1
  • 5
  • 22
9
votes
1 answer

Disabled Qt-Buttons are not shown as disabled in Plasma 5.2 (KDE 5)

In KDE 5 (Kubuntu 15.04 / Plasma 5.2) disabled Qt-Buttons (Qt4) are indistinguishable from non-disabled buttons. This problem does not exist in KDE 4.14 as the following screen-shot shows: The program source for this dialog is written in Python…
Dietrich
  • 5,241
  • 3
  • 24
  • 36