pyqt

What's a good document standard to use programmatically?

Hi, I'm writing a program that requires input in the form of a document, it needs to replace a few values, insert a table, and convert it to PDF. It's written in Python + Qt (PyQt). Is there any well known document standard which can be easily used programmatically? It must be cross platform, and preferably open. I have looked into Mi...

do PyQt4.QtWebKit.QWebView on Windows7-64bit works with SSL sites?

I can browse unprotected sites, but trying to open an "https" one results in these messages: QSslSocket: cannot call unresolved function SSLv3_client_method QSslSocket: cannot call unresolved function SSL_CTX_new QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function ERR_get_error QSslSo...

Starting Python and PyQt - Tutorials, Books, general approaches

After doing web development (php/js) for the last few years i thought it is about time to also have a look at something different. I thought it may be always good to have look of different areas in programming to understand some different approaches better, so i now want to have look at GUI development. As programming language i did ch...

QTextEdit.insertHtml() is very slow.

I've given up on actually trying to make it go faster. My biggest problem is that when I'm inserting the html, the application slows down to a crawl. I have a progressbar, and I'm calling QCoreApplication.processEvents() (I'm using pyqt, by the way) Can I put insertHtml() into a different thread, so I don't have an unresponsive in...

Extend QGraphicsItem with pyqt

How can I create a class that extend QGraphicsItem to define a new kind of Item? I'm trying to do that #!/usr/bin/python import sys from PyQt4 import QtGui class Node(QtGui.QGraphicsItem): def __init__(self, parent = 0): self.setFlag(QtGui.QGraphicsItem.ItemIsMovable) app = QtGui.QApplication(sys.argv) scene = QtGui.QG...

Qt programming: More productive in Python or C++?

Trying to dive into Qt big time but haven't done a large project with it yet. Currently using Python, but I've been thinking -- which is really the better language to use in terms of programmer productivity? In most comparisons between the languages, Python is the obvious answer, because you don't have to mess with memory management and...

How to use a QGraphicsWebView?

I want to use a QGraphicWebView inside a delegate to render a QTableView cell, but I just don't know what to do with the QStyleOptionGraphicsItem parameter the paint() method requires. How to build it up / where should I retrieve it? I'm using this code as reference, so the paint() method should be something like this: def paint(self, p...

QSvgRenderer segmentation fault

I realize specific questions like this aren't great, but I've spent several days trying to puzzle this out. Hopefully someone here can help. This python code using PyQt4 causes a segmentation fault: data = """<?xml version="1.0" ?> <svg height="1000" width="2000"> <text>blah</text> </svg>""" svg = QSv...

How can I achieve layout similar to Google Image search in QT (PyQT)?

Hello, I'm new to QT. I'm using PyQT for GUI development in my project. I want to achieve this layout in my application. This application searches images from an image database. Google image search layout is ideal for my purpose. I'm following the book "Rapid GUI Programming with Python and Qt" and I'm familiar with layouts. I guess...

PyQt4 global shortcuts?

I have an application that opens multiple children widgets as separate windows, something like this: window1 opens window 2 which opens window 3 (simplified form). In the main window I have set CTRL+Q as the quit shortcut. Below is a stripped down example of the main class. class MainWindow(QtGui.QMainWindow): def __init__(self): ...

making paint in pyqt or qt

hello i have just received a task to implement a software that paints over pictures (pretty much like microsoft paint ) i have no idea where to start or how to do that. do anyone have a good reference or idea for painting in qt or pyqt ? this will be highly appreciated thanks in advance ...

Propagate custom QEvent to parent widget in Qt/PyQt

Fist, apologies for the length of the question. I am trying to propagate custom Qt event from child widgets to a top parent widget in order to trigger some action based on event type instead of linking signals. Qt docs suggests that every event posted with postEvent() that have accept() and ignore() methods can be propagated (meaning e...

Can a PyQt program consume a DBus interface that exposes custom C++ types (marhsalled via Qt's MetaType system)? If so, how?

I have a Qt/C++ application that exposes some custom C++ classes via DBus methods (by registering them as MetaTypes, and using annotations in the xml), and I want my PyQt program to consume these methods. The problem I see is that the exposed types are C++ classes, not python, so how can I make python aware of these classes? ...

Displaying other language characters in PyQt

Is there a way to display other language characters in PyQt4? and if there is, what's the approach/direction that I should take? Thanks in advance. ...

catch link clicks in QtWebView and open in default browser

Hi, I am opening a page in QtWebView (in PyQt if that matters) and I want to open all links in the system default browser. I.e. a click on a link should not change the site in the QtWebView but it should open it with the default browser. I want to make it impossible to the user to change the site in the QtWebView. How can I do that? T...

How to use Qt Model/View framework with the Graphics View framework

I am working on a mapping application and need to display the data objects using a table, a form and as graphical objects in the map. I'm using PyQt, but that's not really important as this is a Qt question not a Python question. If I only needed the table and form views this would be easy, I'd just use the Qt Model/View framework. Howe...

Change checkbox position for a QCheckBox

I have a QCheckbox in a grid layout defined as such: self.isSubfactorCheckbox = QtGui.QCheckBox('Is &subfactor', self) By default the checkbox is to the left of the "Is subfactor" text. I wish to move it to the right of the text. I've tried playing around with subcontrol-position but to no avail. self.isSubfactorCheckbox.setStyleShe...

PyQt4 and pyuic4

I'm trying to compile my first .ui file using PyQt4 on a mac with osx 10.6. I'm getting a syntax error and I'm not sure what it means. >>> import sys >>> sys.path.append('/Users/womble/Dropbox/scratch/') >>> from PyQt4 import QtCore, QtGui >>> pyuic4 Urb.ui > Urb.py File "<stdin>", line 1 pyuic4 Urb.ui > Urb.py ^ Synt...

how to scroll a page inside a qwebview?

I guess this should be a simple task: change a QWebView's content (it always contains several pages of stuff) then scroll the page back in the previous position: y = self.webView.page().mainFrame().scrollPosition().y() self.webView.setHtml(looong_html_text) if y != 0: self.webView.scroll(0, y) self.webView.page().mainFrame().scr...

Some advices for creating a WMS service and a desktop client?

Hi, I'm learning to create a WMS service using MapServer and after that I want to develop a PyQt desktop application which will access it. I don't know what is the best way to do that because I have seen a lot of web solutions but it's not what I'm looking for. Neither I know if there are libraries that can help me. Can you give me som...