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
11
votes
2 answers

Python 3 and PyQt 4 recommendations

Is the combination of Python 3 and PyQt 4 recommended? Are there any alternatives?
Joe
  • 255
  • 2
  • 4
  • 8
11
votes
1 answer

reading pyqt stylesheet from external qss file

I have made a qss file of pyqt stylsheet and how am i supposed to call the file content and fed to self.setStylesheet(..) from PyQt4 import QtCore s = QtCore.QString('c:\myProject\darkFantasy.stylesheet') the above code loads the path string rather…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
11
votes
1 answer

How do I hide a sub-menu in QMenu

I have an application where I generate menu items, and I want to set the visibility of a particular sub-menu. I tried using setVisibility(False), but this did not work. setVisibility() works for menu items, but not for sub-menus in QMenus. Have a…
Rao
  • 2,902
  • 14
  • 52
  • 70
11
votes
3 answers

Why I get "QTimer can only be used with threads started with QThread" messages if I have no QTimer in my code?

When (and only when) I quit my application, these (and only these) repeated message appear on the command prompt: QObject::startTimer: QTimer can only be used with threads started with QThread QObject::startTimer: QTimer can only be used with…
iacopo
  • 663
  • 1
  • 7
  • 22
11
votes
3 answers

Qt formlayout not expanding qplaintextedit vertically

I'm confused why a QPlainTextEdit widget will not resize vertically when added to a QFormLayout. In the code below the text field correctly scales up horizontally, but does not scale up vertically. Can anyone explain this behavior and offer a…
Jon Lauridsen
  • 2,521
  • 5
  • 31
  • 38
11
votes
2 answers

Is this PyQt 4 python bug or wrongly behaving code?

Following code should create the QGraphicsView widget which owns one QGraphicsScene having text inside of it: #!/usr/bin/python import sys from PyQt4.QtGui import * if __name__ == '__main__': app = QApplication(sys.argv) view =…
jhnsn
  • 113
  • 1
  • 4
11
votes
1 answer

QWidget.setContentsMargins() appears to be ineffective: why so?

Situation: I am working on a Qt4 application constructed in this way (in case parent widgets matter in this issue): QApplication |_ QMainwindow |_ QScrollArea (central widget) |_ QFrame (child of scroll area) …
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
11
votes
1 answer

PyQt4 trouble creating a simple GUI application

so I'm creating a simple windows application with Python and PyQt4. I've designed my UI the way I want it in QtCreator and I've created the necessary .py file from the .ui file. When I try to actually open an instance of the window however I'm given…
Cyborg771
  • 395
  • 1
  • 6
  • 17
10
votes
2 answers

Get Plain text from a QLabel with Rich text

I have a QLabel that contains rich text. I want to extract just the actual (visible) 'text' from the QLabel, and none of the code for formatting. I essentially need a function similiar to the '.toPlainText' method of other Qt Widgets. I can not…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
10
votes
4 answers

resizing a dialog with PyQt4

I have this sample of code: import sys from PyQt4.QtGui import (QApplication, QHBoxLayout, QVBoxLayout, QDialog, QFrame, QPushButton, QComboBox) class Form(QDialog): def __init__(self, parent=None): …
ilstam
  • 1,473
  • 4
  • 18
  • 32
10
votes
4 answers

PyQt4 MouseMove event without MousePress

I need to catch when a User moves the mouse over the GUI, but not when they're holding down the mouse button (which would do something different). I can't find any conveniant method to do this, except to periodically find the mouse position and…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
10
votes
1 answer

PyQT Remove the programs Title Bar?

hi does anybody knows how to remove the programs title bar? (In PyQT or in Designer) my goal is i need to replace it with my own title bar. thanks to anyone who can help me.
Katherina
  • 2,153
  • 7
  • 26
  • 34
10
votes
2 answers

Can I apply a Neumorphism effect to a QWidget?

While Qt provides the QGraphicsDropShadowEffect, there's no "Neumorphism" effect available: In css there is the box-shadow property (that's how it's done in the image above), which can have multiple colors, but Qt lacks support for that property,…
musicamante
  • 41,230
  • 6
  • 33
  • 58
10
votes
0 answers

How to use the phonon-vlc-backend in PyQt4 on Windows

I'm helping develop a PyQt4.8 application which amongst other things plays video and audio. We are using Phonon for this, part of the reason being that we also embed videos in a QtWebkit page which uses the same. On Windows 7, the default phonon…
Jonathan Corwin
  • 960
  • 1
  • 7
  • 11
10
votes
2 answers

pyqt4 window resize event

I'm using python3 and pyqt4 and I want some code to run every time my QMainWindow is resized.I would like something like this self.window.resized.connect(self.resize) but resized is not a builtin function or method. Can anyone help.
chicken-me
  • 131
  • 1
  • 1
  • 6