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
12
votes
1 answer

Pass extra arguments to PyQt slot without losing default signal arguments

A PyQt button event can be connected in the normal way to a function so that the function receives the default signal arguments (in this case the button checked state): def connections(self): my_button.clicked.connect(self.on_button) def…
101
  • 8,514
  • 6
  • 43
  • 69
12
votes
5 answers

How to delete row/rows from a qtableview in pyqt?

I am using QStandardItemModel for my qtableview. import ui_my_viewlogs import os from PyQt4 import QtCore, QtGui class my_viewlogs(QtGui.QDialog, ui_my_viewlogs.Ui_viewlogs): def __init__(self): super(my_viewlogs, self).__init__() …
Anuj Bhasin
  • 610
  • 1
  • 8
  • 18
12
votes
1 answer

Python - Qt. How to make a Terminal Window for Telnet or ssh server interaction

i am making a PyQt application, and i want to make something like a Terminal Window, where the user can interact with a Telnet or ssh server. My first idea was to have a Window with a black QPlainTextEdit and a scrollbar. I am new to python-Qt world…
athspk
  • 6,722
  • 7
  • 37
  • 51
12
votes
1 answer

QTableWidget Current Selection Change Signal

What's the signal of a QTableWidget when the current selection changes and how can I assign a slot to it?
Amen
  • 1,524
  • 5
  • 22
  • 41
12
votes
3 answers

How can I get QListWidget item by name?

I have a QListWidget which displays a list of names using PyQt in Python. How can I get the QListWidgetItem for a given name? For example, if I have the following QListWidget with 4 items, how can I get the item which contains text = dan?
panofish
  • 7,578
  • 13
  • 55
  • 96
12
votes
2 answers

How to use QFileDialog options and retrieve saveFileName?

I'm trying to use a QFileDialog to prompt a user to provide a filename and location to save a text file at. I played around with the QtGui.QFileDialog.getSaveFileName, but I was interested in using some of the options, like setting the default…
Jesse
  • 143
  • 1
  • 1
  • 10
12
votes
1 answer

Using multiple QStyledItemDelegate with stylesheets

I'm creating a styled QTreeView using double-dispatch to resolve specific delegate for data items, which is working great. I subclassed the delegates from QStyledItemDelegate to take advantage of stylesheets, enabling the designers to style the UI…
Shane Holloway
  • 7,550
  • 4
  • 29
  • 37
12
votes
2 answers

How to change Qtablewidget's specific cells background color in pyqt

I am new in pyqt4 and I can't figure out how to do this. I have a QtableWidget with data in it. I want to change some background color of the tableWidget's cells. I tried self.tableWidget.item(3, 5).setBackground(QtGui.QColor(100,100,150)) and it…
alperyazir
  • 203
  • 1
  • 4
  • 14
12
votes
3 answers

Using Windows 7 taskbar features in PyQt

I am looking for information on the integration of some of the new Windows 7 taskbar features into my PyQt applications. Specifically if there already exists the possibility to use the new progress indicator (see here) and the quick links…
12
votes
1 answer

pyqt - how to make a textarea to write messages to - kinda like printing to a console

I'm fairly new to pyqt - I'm currently using it to make a visual representation of a graph. I made a custom widget for this, which was fairly easy. But now I'm stuck when having to use built in functionality. I want to add a 'view' to my application…
Spyral
  • 760
  • 1
  • 12
  • 33
12
votes
3 answers

PyQt window closes immediately after opening

I am getting an issue when trying to open a PyQt window. The code below is an example of my original code. When I imported the module in import Test and ran test.Start(), I got the following error: QCoreApplication::exec: The event loop is already…
PePeTD
  • 148
  • 1
  • 1
  • 7
12
votes
2 answers

Why does property decorator show "object has no attribute"?

I have the following code: import sys import platform from PyQt4.QtGui import QApplication from PyQt4.QtWebKit import QWebPage class Render(QWebPage): def __init__(self): self.app = QApplication([]) QWebPage.__init__(self) …
Steven Almeroth
  • 7,758
  • 2
  • 50
  • 57
12
votes
2 answers

QIcon.fromTheme not displaying icon in PyQt

I am having troubles to display the icon of a QAction selected from the current icon theme. I made the ui with Qt designer and exported it with pyuic4 sample.ui > sample.py. After setting the icon from the theme with…
Hypergraphe
  • 153
  • 1
  • 1
  • 6
12
votes
1 answer

How do I catch a pyqt closeEvent and minimize the dialog instead of exiting?

I have a QDialog object. When the user clicks on the X button or presses Ctrl+Q, I want the dialog to go to a minimized view or system tray icon, instead of closing. How do I do that?
Shahin
  • 1,415
  • 4
  • 22
  • 33
12
votes
2 answers

A QWidget like QTextEdit that wraps its height automatically to its contents?

I am creating a form with some QTextEdit widgets. The default height of the QTextEdit exceeds a single line of text and as the contents' height exceeds the QTextEdit's height, it creates a scroll-bar to scroll the content. I would like to override…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89