pyqt

Should wildcard import be avoided?

I'm using PyQt and am running into this issue. If my import statements are: from PyQt4.QtCore import * from PyQt4.QtGui import * then pylint gives hundreds of "Unused import" warnings. I'm hesitant to just turn them off, because there might be other unused imports that are actually useful to see. Another option would be to do this:...

Pyqt: How-to set item always in the center of a QGraphicsView when scrolling is possible?

Hi, I have a QGraphicsView. To that I added a QGraphicsScene and to that a added an QPixmap(*.jpeg) and QGraphicsEllipseItem(a circle). The QPixmap is much more bigger than the QGraphicsView, so scrolling is enabled. The problem is that both QPixmap and QGraphicsEllipseItem are moving. But I want a fixed position for the QGraphicsEllip...

PyQt application crashes after closing QMessagebox window.

Here is the code of my simple tray application. It crashes with segfault when i call information window from context menu of application and then close it. I've tryed different variants to find a reason of segfault, this is my last try. #!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4 import QtCore from PyQt4 import ...

Steps for how to install QT, PyQT, and PySide on OS X Snow Leopard

I've had some problems installing QT on Snow Leopard and I'm hoping that I can benefit from someone else who's been in this position. :) I'm assuming that I'll need to use a version of python that's not included with SL... be it from homebrew, macports, python.org, etc. Can anyone give me some simple steps to follow to get QT, PyQT, an...

Pyqt tabs like in Google Chrome

I would like to have my pyqt aplication have tabs in the menu bar like Google Chrome :) Any suggestions or a simple example on how to do it? I did find these relevant link: - http://ivan.fomentgroup.org/blog/2009/03/29/instant-chrome/ ...

PEP8 and PyQt, how to reconcile

I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls to camel case and ...

Scrolling area with PyQT on Maemo5

I'm not really accustomed to writing the UI in the code, so I need a few pointers. I'm trying to create a simple, horizontal scrolling dialog on my N900, but I can't figure out how to do this. This is what I have so far: def __init__(self,parent = None): QDialog.__init__(self,parent) #if name == None: self...

Tooltips not showing up on Ubuntu using PyQt4

I'm getting started with PyQt4 and tested the following code... import sys from PyQt4 import QtGui from PyQt4 import QtCore class Tooltip(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Tooltip') self.s...

how to have gantt chart using python or pyqt

hello , im working on a (asset management) system to handle assets , resources and progress of tasks i want to have a gantt chart in my system im using python 2.6 and pyqt . is there any (already made charts python library ) ? that can work well with pyqt. or should i make a custom widgets for this ? please advice. thanks in advance...

Why does my PyQt application open in the background on Mac OS X?

I've got a PyQt app which I'm developing in Mac OS X, and whenever I try launching the app, it always is the very bottom application on the stack. So after launching, I always need to command+tab all the way to the end of the application list to switch focus to it. I read that this behavior can be fixed by launching the app with the "p...

Sending a custom header along with qtwebkit request

I'm doing some work with PyQt4 and QtWebKit, and in the web page request need to send a custom "Host" header along with the standard HTTP request. I'm not seeing any options for adding custom headers to the request, but this is all new to me so I hope I'm missing something. I'm looking here: http://doc.trolltech.com/4.6/qwebsettings.htm...

QGraphicsView not displaying in QMainWindow

I'm not sure why this application is not displaying anything. I'll reproduce in a few lines to provide the gist of the issue. Using PyQt4 class SomeScene(QtGui.QGraphicsScene): def __init__(self, parent = None): QtGui.QGraphicsScene.__init__(self, parent) pixmap = QtGui.QPixmap('someImage') # path is DEFINITELY vali...

Overriding hostname IP address in qtwebkit request

I'm downloading a web page (with PyQt4/QtWebKit) using given hostname, but I would like to use a pre-defined IP address for that hostname. For example, I need to hit "http://www.mysite.com" but use the IP address 1.2.3.4 instead of the actual resolved IP address. Is this at all possible in QtWebKit? I've tried a couple things so far: H...

What module is PYSIGNAL defined in PyQt4

All of the examples I read online use from PyQt4 import * or some variant of that, importing everything. I don't want to do this, but I can't find where PYSIGNAL is defined! ...

SVG Glyphs in Pyqt

How do I render glyphs in pyqt using the svggraphicsItem? ...

QGraphicsView not displaying QGraphicsItems

Using PyQt4. My goal is to load in "parts" of a .png, assign them to QGraphicsItems, add them to the scene, and have the QGraphicsView display them. (Right now I don't care about their coordinates, all I care about is getting the darn thing to work). Currently nothing is displayed. At first I thought it was a problem with items being a...

How to anchor QGraphicsWidget/Item (make them static) on QGraphicsView

Hi, I want to make something like a hud. I have a QGraphicsScene with a huge QPixmap, that I added to a much smaller QGraphicsView. Now I need to add some control elements, like QLabel, QPushButton and QGraphicsEllipseItem. That's, I think, is not a problem. I found this helpful page Graphics View Classes. But how do I anchor this cont...

Using PyQt4 with bbfreeze - wrong ui style used

Hi So to give a little context, my goal here is to produce a binary which will run my Python/PyQt4 application on any recent linux (but mainly ubuntu), without requiring the user to install the pyqt4 or pyqwt5 library. (If anyone can give a better way to do that than my method below, that would be great also :) I've got this mostly wor...

python qt, display text/label above another widget(phonon)

I'm making a video player using PySide which is a python bind to the Qt framework. I'm using phonon(a module) to display the video and I want to display text above the video as a subtitle. How can I put another widget above my phonon widget. Is opengl an option? ...

Submitting Google with PyQT QWebElement

The following code does not reach searchResults. I have printed out documentElement.findFirst('input[name="btnG"]') and found it to be <input name="btnG" type="submit" value="Google Search" class="lsb"> so we are good up to that point. Note that my goal is not to scrape Google but it's simpler to learn via the well known and public Googl...