pyqt4

problem with QSqlTalbeModel . table is not showing

hello, i have a QsqlTableModel that is assigned to a table view . my problem is that it doesn't populate the table inside the table view . it's still empty and it says (Unable to find table shots) - when printing lastError.text() - the function retrieveShotResults..(check code below) is to test if there is a table called shots and yes...

Cant get a custom ItemDelegate to work

Hello there, first off, im new to python and pyqt so please bear with me. Im using a QTableView with a QSqlTableModel everything works as intended. The last column of the view contains only 0 and 1 as value which i want to display as checkbox and this column should be editable. Ive read that you should subclass QItemDelegate which i d...

How do I subclass QApplication properly?

I am a newbie with PyQt4 (and QT altogether), and am facing a problem, I have subclassed QApplication (to have global data and functions that really are global to the application): class App(QApplication): def __init__(self): QApplication.__init__(self) self.foo = None def bar(self,x): do_something() ...

PyQt4 SIGNAL/SLOT problem when using sub-directories

Thanks in advance for taking the time to read this. Apologies that it is somewhat verbose. But hopefully it fully explains the problem. Stripped code demonstrating the issue is included. I'm having an issue with PyQt4 SIGNAL/SLOTS. While I can make everything work fine if I am writing in a single file, I can't make things work if I some...

This code for creating a QPolygon in Pyqt is stopping my application! Help?

HI all, The following code: self.painter = QtGui.QPainter(self) self.painter.setRenderHint(QPainter.Antialiasing) self.painter.translate(482,395) self.painter.scale(300,300) self.painter.save() needle = Qt.QPolygon([QPoint(30, 0), QPoint(-30, 0), QPoint(0, 200)]) self.painter.setBrush(Qt.cyan) self.painter.setPen(Qt.black) self.painter...

Hide app from taskbar

I'm trying to get my application hidden to systray and the systray thing works fine, except my app won't disspaear from the taskbar. The icon seem to dissapear, but another icon pops up and when I click to show that window I get a windowframe but the contents aren't drawn. def hideEvent(self, event): self.trayIcon.show() self.hi...

How do I get some slot/function to be executed when a certain QTableWidgetItem is checked / unchecked in PyQt

I have a dynamically created table, that has N rows and M QTableWidgetItems (that are only used as checkboxes) per row - I need to run code that knows the row and the column whenever a checkbox is checked or unchecked. My CheckBox subclass looks like: class CheckBox(QTableWidgetItem): def __init__(self): QTableWidgetItem.__...

Is there a way to call a function right before a PyQt application ends?

I am collecting usage stats for my applications which include how much each session lasts. However, I can't seem to be able to save this information because None Of the signals I tried yet actually succeeds to call my report_session function. This are the signals I have already tried: lastWindowClosed() aboutToQuit() destroyed() Ei...

How to check if a QWidget is already showing?

I'm developing a plugin UI for an existing application using PyQt4. The window is created using uic.loadUi() on the press of a button in the main window. The problem is that if I press the button again (while the window is showing) the window is re-created and unsaved changes are lost. I don't want to make the window modal. Which options...

Copy strings from multiple lineEdit slots as variable to one textEdit slot in PyQt4

to be more crystal clear, here how the things might work. in python, to create a variable, simply we use var1 = raw_input('your name?') so that when using print 'your name is ' +var1 it will print the string stored in var1. the question is how to make that using Pyqt4? I have 3 lineEdit symbolize as name, age and gender and on...

PyQtWebkit and java script

Hello, I have a page with js. I need get dom after js execute at webpage. Js inserts text in the div with name 'sdl'. I need get value between . Value can not be parsed in js source, it is generated by Js. How to do it? Sorry for my english. ...

How to save and load QListWidjet contents to/from QSetting with PyQt4?

I've got a QListWidget in my PyQt4 app. It contains folders paths. I want to save its contents to QSettings and load them later. I used this code to do this: def foldersSave(self): folders = {} '''create dict to store data''' foldersnum = self.configDialog.FolderLIST.count() '''get number of items''' if foldersnum: f...

C++ to pyQt movie player Widget conversion example ??

http://doc.qt.nokia.com/4.6/multimedia-videowidget.html http://doc.trolltech.com/4.2/widgets-imageviewer.html I´ve found those links above but I must say I´m not familiar with C++ at all and I could not convert to PyQt ... Would be extremely helpfull if someone could post a simple conversion code here, so I could dig into that. Thanks...

How to connect pyqtSignal between classes in PyQT

Hello. I'd like to ask you for an advice. How to connect pyqtSignal between two different objects (classes) PROPERLY? I mean best practice. Look what I have done to achieve the goal: The Thermometer class is notified when Pot increases its temperature: from PyQt4 import QtCore class Pot(QtCore.QObject): temperatureRaisedSignal = Qt...

PYQT: why label not change ..?

dear all .. i'm newbee on python and pyqt, i try to make small program with pyqt, the program is running, when i press the return key its will show input dialog and if i input 1 on label1 will show "one" and if i press enter egain input dialog will show again and if i input 2 the problem is the label still show "one" not show "two", any ...

Netbeans settings for PyQt4

I installed python-qt4 package (and other dependencies) and have netbeans with python support on ubuntu. What settings in netbeans must i change to be able to import from PyQt4? ...

How to interchange data between two python applications?

I have two python applications. I need to send commands and data between them (between two processes). What is the best way to do that? One program is a daemon who should accept commands and parameters from another GUI application. How can I make daemon to monitor comands from GUI, while making it's job? I prefer solution would be cros...

how to use interactive icon for python application[PyQt] using py2exe

i have application called setup.py[PyQt] and i have compiled to setup.exe using py2exe suppose if i need to add a icon for the application how to do it. please help me i am newbie.. ...

PyQt GUI based CRUD application.

Hello, I am new to the world of PyQt.I am using PyQt designer for designing the UI and coding to provide functionality in it.But unfortunately I am getting confused to link with the UI.By importing the class we generally doing in examples.But when I try my own code its not happening. I guess I need better understanding to work with PyQt....

PyQt4: AttributeError: 'QLineEdit' object has no attribute 'setPlaceholderText'

I have a QLineEdit, and I want to set a placeholder text. When I call setPlaceholderText(string) I get an AttributeError, but: >>> from PyQt4 import QtCore >>> QtCore.PYQT_VERSION_STR '4.7.4' >>> QtCore.QT_VERSION_STR '4.7.0' and from the QAssistant: This property holds the line edit's placeholder text. ... This property was...