pyqt4

PyQt4: Sending a custom signal from a thread to a progress dialog

Hi, I am unable to send a signal updating a progress dialog from a QThread. I set up the thing like this (from within the MainWindow class): self.progressDialog = QtGui.QProgressDialog("Packing ...", QtCore.QString(), 0,100, self.parent_) self.thread = QtCore.QThread(parent = self.parent_) self.thread.run = myRun self.thread.start() se...

What's easier and cleaner? GTK or QT?

Possible Duplicate: What should I choose: GTK+ or Qt? What's easier to understand and more natural, faster to master, pleasant to use every day with different languages - the latest version of GTK or QT? The question may be a bit subjective and hollyWar-ish, but interesting, significant and possible to answer objectively, I b...

python QThread.run parameters - changed between versions?

Hi, In my code (python2.6, PyQt4) I do something like this: def myRun(): doStuff thread = QtCore.QThread() thread.run = myRun thread.start() On my gentoo machine, this works perfectly. On a ubunut (9.10, Karmic Koala) it does not work, it says: Type Error: myRun() takes no arguments (1 given) Did something change in QT? How can ...

Problem With Python Bindings on a Widget That uses GStreamer

First, some background information: I'm currently developing a program for the Nokia N900 using Python and PyQt4. The program accesses the phone's camera. I have figured out how to use GStreamer in a Qt widget to capture the video. It turns out that I need access to a somewhat obscure gstreamer interface which I don't believe I can ac...

Setting useragent in QWebView

I have a QWebView, which works fine. Then, using code from spynner, I attempt to bind the useragent method to a custom method. This appears to work in spynner (with a QWebPage), but not here. Any help much appreciated. Code: def customuseragent(url): print 'called for %s' % url return 'custom ua' #inside a class self.webkit = QtWebK...

Hiding console window of Python GUI app with py2exe

I have a Python program uses Qt (PyQt4 in fact) and when I launch it from its main.py, I get a console window and the GUI window (on Windows, of course). Then I compile my program with py2exe and main.exe is successfully created. However, if I run main.exe (this is what users of program will do) console window of Python still appears an...

QWebView - dealing with javascript infinite loop

web_view_crash.py import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtWebKit import * app = QApplication(sys.argv) view = QWebView() view.settings().setAttribute(QWebSettings.JavascriptEnabled, True) view.load(QUrl('infinite_loop.html')) view.show() app.exec_() infinite_loop.html <script> while(true) { ...

how to imitate a link click in QTextBrowser

Actualy, i have different tabs. what I wanted to achieve is, - user clicked a link from tab 1 - and it will immediately display QTextBrowser in tab 2, at the html anchor i set. Is there a way of doing this? I've managed to switch tab by using tabWidget.setCurrentWidget() now the question is, how to set the focus to the desired html an...

No icons in pyQt exec application built with bbfreeze

Hi, The story is: I have working pyQt4 GUI application. After building *.qrc and *.ui files I run it from commandline: python myapp.py And I see my astonishing ;) icons. When I 'compile' it with bbfreeze there are no icons. I know that currently bbfreeze doesn't support icons, but I thought that when pyqt resources are compiled an...

Using PyQt4.QtWebKit on a Debian server

Hi, I'm having a problem using PyQT4 on a Debian server. My script works fine on an Ubuntu Desktop machine, and I now want to deploy it on a server. Knowing it needed an X server, I launched one doing vncserver --display 800x600 :4242 I then exported the display : export DISPLAY=:4242 But my program keeps returning the error ...

Using PyQt and Qt4, is this the proper way to get a throbber in a QTabWidget tab?

I have some code creating a QTabWidget from Python using PyQt4. I want to get a 'throbber' animated gif in the tab. The /only way/ I have found how to do this is the following convoluted method. tabBar = self.tabReports.tabBar() lbl = QtGui.QLabel(self.tabReports) movie = QtGui.QMovie(os.path.join(self.basedir, "images\\throbber.gif")) ...

PyQt4 Custom dialog not showing

Hi, i'm working with PyQt4 to make a simple Python GUI app. The situation is the following: i have an QMainWindow displaying a central widget and a QDockWidget containing this custom Widget: class ListTagWidget(QWidget): def __init__(self, parent = None): super(ListTagWidget, self).__init__() addButton ...

How can I programmatically send events to Qt's webkit?

I would like to create a specialized browser that can enter certain information semi-automatically into pages that are browsed. I am using for this Qt Webkit (in particular the python bindings). How can I do this? ...

Good resources for learning pyqt?

Hey I've started learning Python 3 - and now so far that I need some UI to experiment with. I've decided to go with the QT4 IDE (called from the Eric IDE) on Linux. Does anyone know good resources to get started? Books, tutorials, eBooks - basically anything I can get my hands on :-) EDIT: Thank you all for your contributions. Sucks, ...

How can I load session information into qtwebkit?

I am building a specialized browser based on Qtwebkit. I would like to save the session information when logging into authenticated websites and load this information again when I restart the browser. How can I do this? ...

pyqt installation question

Im planing to do some GUI development using pyqt4 pykde and python3.1 on Kubuntu 10.4. In the research I did I found out that most of the things are available as packages in repositories and some of the packages are preinstalled. Only thing is I'm not able to figure out what to install and what not to. Can someone please give me a list o...

How can I save a list of QObjects into a file?

I would like to save a list of QObjects into a file and read it again in the easiest way possible. Can I use QDataStream for this (writeListVariant, readListVariant)? How can I do this? ...

SVG images dont appear after compiling PyQt4 python code with py2exe

hi, I wrote python application using svg images as icons. QtGui.QIcon(':icons/icon.svg') <- just like this it works on my comuter but after compiling it with py2exe and running on another computer, theres no icons. if i try e.g. bmp format, all works fine. so i think it could be some library problem. I don't know what PyQt4 uses for s...

Disable 'Return' key in a QPlainTextEdit

Is there any way I can prevent the user from hitting the return key when entering text in a QPlainTextEdit widget? That is, even though I want to give the viewing space of multiple lines, I want that the if the user hits enter, a new line should not begin. The reason for doing this is that I am adding a GUI layer on top of an existing c...

I extend QApplication and calling a method after exec_ does not work

The following code works (and it's very simple): class Scrape(QApplication): def __init__(self): super(Scrape, self).__init__(None) self.webView = QWebView() self.webView.loadFinished.connect(self.loadFinished) def load(self, url): self.webView.load(QUrl(url)) def loadFinished(self): documentElement = self.web...