I am currently using the following PyQt code to create a simple browser:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
app = QApplication(sys.argv)
web = QWebView()
web.load(QUrl("http://www.robeez.com"))
web.show()
sys.exit(app.exec_())
Websites like google.com or stackoverflow.com work...
I'm currently attempting to migrate a legacy VBA/Microsoft Access application to Python and PyQt. I've had no problems migrating any of the logic, and most of the forms have been a snap, as well. However, I've hit a problem on the most important part of the application--the main data-entry form.
The form is basically a row of text boxes...
I'm a Python newbie and I'm trying to write a trivial app with an event handler that gets activated when an item in a custom QTreeWidget is clicked. For some reason it doesn't work. Since I'm only at the beginning of learning it, I can't figure out what I'm doing wrong. Here is the code:
#!/usr/bin/env python
import sys
from PyQt4.QtC...
I need to customize the drawing process of a QGraphicsView, and so I override the drawItems method like this:
self.graphicsview.drawItems=self.drawer.drawItems
where self.graphicsview is a QGraphicsView, and self.drawer is a custom class with a method drawItems.
In this method I check a few flags to decide how to draw each item, and t...
I am currently evaluating using PyQt in a commercial application, and I was surprised to learn that the PyQt Commercial License does not permit you to expose any of the PyQt library in the application's script API. From the PyQt site:
The right to distribute the required PyQt modules and QScintilla library with your applications so l...
I'm using PyQt 4.4.
It's best shown using some pictures. All nodes should have leafs from 0 to 99. They are being incrementally loaded using canFetchMore() and fetchMore(). But for some reason unknown for me this works only for the root node. (Picture 1)
If I collapse and expand a node it loads additional 10 values. (Picture 2 & 3)
It...
I've got a Qt4 application (using the PyQt bindings) which contains a QListWidget, initialized like so:
class MyList(QtGui.QListWidget):
def __init__(self):
QtGui.QListWidget.__init__(self)
self.setDragDropMode(self.InternalMove)
I can add items, and this allows me to drag and drop to reorder the list. But how do ...
Pretty simple question. I've seen it mentioned in many places that using properties on an old-style class shouldn't work, but apparently Qt classes (through PyQt4) aren't new-style and there are properties on a few of them in the code I'm working with (and as far as I know the code isn't showing any sorts of problems)
I did run across ...
Does anyone here know how can i add a background image to a QHeaderView background? I tried to do this in a stylesheet file using the "background-image" property, but aparently it didn't work..
Can anyone help me?
Grateful
...
I've got a basic PyQt QFileDialog file browser goin in Python, Kubuntu.
My issue is I would like the "tab key" in the file input to act as tab-complete does in a shell.
Is there any way to accomplish this?
...
I'm working with a webservice which requires a valid username/password. From PyQt, I'm accessing the webservice using QNetworkAccessManager which emits the
authenticationRequired (QNetworkReply*, QAuthenticator*)
signal when (obviously),authentication is required. When I fill in the user and psswd for
QAuthenticator, everything wor...
With a QFileDialog I'm trying to change the size of the side bar in a QFileDialog. I want it to have a larger width. I was looking at dir(QtGui.QFileDialog) which shows a plethora of functions/methods and dir(QtGui.QSizePolicy) which seemed like the right choice. I've not been able to manipulate the size of the side bar though.
print 's...
I'd like PyQt to load an image and display it from the web. Dozens of examples I've found online did not work, as they are for downloading the image.
I simply want to view it.
Something like
from PyQt4.QtWebKit import *
web = QWebView()
web.load(QUrl("http://stackoverflow.com/content/img/so/logo.png"))
...
I'm trying to implement a custom QLayout using PyQt. setGeometry gets called, and I loop through and call setGeometry on all the widgets I'm managing, but for some reason the widgets never get painted, despite all having the correct geometry.
Also, invalidate, update, and activate never seem to get called on my Layout. Does anyone hav...
I've created a small PyQt based utility in Python that creates PNG graphs using matplotlib when a user clicks a button. Everything works well during the first few clicks, however each time an image is created, the application's memory footprint grows about 120 MB, eventually crashing Python altogether.
How can I recover this memory afte...
Good day pythonistas and the rest of the coding crowd,
I have two QMainWindows designed and coded separately. I need to:
display first
on a button-press close the first window
construct and display the second window using the arguments from the first
I have tried to design a third class to control the flow but it does not understand...
I have three QDockWidgets which are tabbed at startup using QMainWindow.tabifyDockWidget.
In the main window, after all of the addDockWidget calls:
self.tabifyDockWidget(self.dock_widget1, self.dock_widget2)
self.tabifyDockWidget(self.dock_widget1, self.dock_widget3)
Based on certain actions, I'd like to select one of these tabs and ...
I asked this question on the PyQt mailing list, and didn't get any responses, so I'll try my luck here.
I've encountered a frustrating issue (on Windows only): when trying to create a VideoWidget instance, I'm getting the error message "the video widget could not be initialized correctly". Oddly, this just surfaced in the code after sev...
Has anyone tried the new Python Qt binding - PySide yet?
I wonder about its matureness and compatibility with PyQt. What are your experiences on this matter? I know it has only been released this week, but it's such great news for Python development of Qt-based GUIs - there's a lot of interest in this thing.
...
Hi,
I am writing a program using PyQt4 for front-end GUI and this program accesses a back-end database (which can be either MySQL or SQLite). I need to store some image data in the database and below is the Python code I use to import image files (in JPEG format) to a blob data field in the database:
def dump_image(imgfile):
i = o...