Re: [PyQt] Next PyQt, SIP, QScintilla Releases

2008-11-04 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: The QImage constructor steals a reference to the uchar *data argument instead of increasing the reference count of the input string (tested) or buffer object (untested, but looked into siplib.c). It is the (not very well documented) responsibility of th

Re: [PyQt] python bindings around webkit

2008-10-15 Thread Aaron Digulla
Quoting Luke Kenneth Casson Leighton <[EMAIL PROTECTED]>: I'm especially interested if I would be able to get access to the current cursor position in edit mode - that would allow me to use WebKit as the basis to write a very powerful WYSIWYG text editor. well... you can definitely get access

Re: [PyQt] python bindings to qwebkit - who's responsible for doing this work (anyone?)

2008-10-15 Thread Aaron Digulla
Quoting Luke Kenneth Casson Leighton <[EMAIL PROTECTED]>: last month or so i added glib bindings to webkit, in order to make them available via pygtk's codegen.py as python bindings, for pywebkitgtk. to make that as clear as mud: around webkit's c++ DOM bindings i added glib bindings so that i

Re: [PyQt] PyQt - How to preload values to a QTableView

2008-10-13 Thread Aaron Digulla
Quoting Anil <[EMAIL PROTECTED]>: bool QSqlRelationalTableModel::setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole )  I think you should use setData(). I haven't used setModelData() before. The usual way is like this: - Create a new row - Use setData() t

Re: [PyQt] Extracting QSqlQuery results in PyQt4

2008-10-10 Thread Aaron Digulla
mir amicitas schrieb: > With sqlite3 or apsw things are much more tolerable, though if any one has > ideas on how to make the extraction even faster I would love to here them. > What I am doing for now is to use: > > results = [row for row in self.cursor] Try: results = list(self.curso

Re: [PyQt] QSqlTableModel and complex queries

2008-10-09 Thread Aaron Digulla
Quoting Mark Summerfield <[EMAIL PROTECTED]>: On 2008-10-08, Aaron Digulla wrote: Scott Frankel schrieb: > This seems beyond the scope of > QSqlRelationalTableModel. During my work on UPCScan, I've found that the QSqlRelationalTableModel and the related table view are

Re: [PyQt] Extracting QSqlQuery results in PyQt4

2008-10-08 Thread Aaron Digulla
mir amicitas schrieb: > I am trying to use SQLite in a PyQt4 application. I am running into a > problem where it is taking a really long time to get the data out of > the QSqlQuery object after a query is completed. Here is a code > snippet with the relevant parts: > >

Re: [PyQt] QWebKit issue with certain URLs

2008-10-08 Thread Aaron Digulla
alan moore schrieb: > Hello. > I was trying to use QWebKit to create a basic browser to use with thin > clients at our public library. Everything was looking good, but I have > found a URL on our server that simply will not load in a QWebview. I > have tried this using PyQT4.4 on Ubuntu Hardy Her

Re: [PyQt] QSqlTableModel and complex queries

2008-10-08 Thread Aaron Digulla
Scott Frankel schrieb: > > This seems beyond the scope of > QSqlRelationalTableModel. During my work on UPCScan, I've found that the QSqlRelationalTableModel and the related table view are too buggy and too limited to be useful. In the end, I've ripped all the code out again and wrote my own impl

[PyQt] UPCScan 0.6

2008-10-08 Thread Aaron Digulla
Hello, I've got hold of a barcode laser scanner and started to write a tool to scan my large DVD, book and comic collection. It's written in Python and PyQt4. The announcement can be found in my blog: http://darkviews.blogspot.com/2008/10/upcscan-06-its-qt-man.html If you're looking for an examp

[PyQt] Embedding OpenOffice in Qt app

2008-06-18 Thread Aaron Digulla
Hello, Is it possible to embed a UNO component (in my case: The document editor of Writer) in a Qt app? I have a feeling that this can be done with ActiveQt but I'm not sure. Does anyone have any pointers how to do this? Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not

PyPaPi tutorial feedback (Re: [PyQt] Re: RAD with PyQt?)

2008-06-16 Thread Aaron Digulla
Quoting Alberto Berti <[EMAIL PROTECTED]>: For who asked for pypapi docs, i'm preparing a tutorial (still to be finished) that shows some PyPaPi features: it's here http://www.pypapi.org/rdg/browser/docs/cute/tutorial/README.rst The part about the table is confusing. I suggest to move it to a

Re: [PyQt] Re: RAD with PyQt?

2008-06-12 Thread Aaron Digulla
Quoting Alberto Berti <[EMAIL PROTECTED]>: I forgot to mention that: dev news are at http://www.pypapi.org/rdg/timeline and source code and changes browser is at http://www.pypapi.org/rdg/browser . Is there an English version of the docs somewhere? I have a hard time to follow the Italian on

[PyQt] RAD with PyQt?

2008-06-11 Thread Aaron Digulla
Hello, I was wondering: Is there a Rapid Application Development framework to quickly write apps with PyQt? Specifically, I'm looking for these features: - Connect model fields (properties) to UI elements (for example, string fields to text editors or to combo boxes). - Connect a python li

Re: [PyQt] QDoubleSpinBox and decimal separator

2008-05-16 Thread Aaron Digulla
Quoting Henrik Pauli <[EMAIL PROTECTED]>: In my locale, the decimal separator is ',' and not '.'. If I try to write a decimal separator in a QDoubleSpinBox via the '.' button in the numeric pad, the spinbox doesn't accept the value and I have to hit the ',' button under the 'k' key. This happens

Re: [PyQt] PyQt 4.4-snapshot-20080507: Running webbrowser.py

2008-05-09 Thread Aaron Digulla
Phil Thompson schrieb: > On Thursday 08 May 2008 21:08:42 Aaron Digulla wrote: >> When I run python examples/activeqt/webbrowser/webbrowser.py, I get this >> error with the latest snapshot: >> >> Traceback (most recent call last): >> File "examples/activeqt/

[PyQt] PyQt 4.4-snapshot-20080507: Running webbrowser.py

2008-05-08 Thread Aaron Digulla
When I run python examples/activeqt/webbrowser/webbrowser.py, I get this error with the latest snapshot: Traceback (most recent call last): File "examples/activeqt/webbrowser/webbrowser.py", line 22, in from PyQt4 import QtCore, QtGui, QAxContainer ImportError: cannot import name QAxContain

[PyQt] Installing PyQt 4.3 and 4.4 alongside on Windows

2008-05-08 Thread Aaron Digulla
Hello, I'd like to ask if it is possible to install PyQt 4.3 and 4.4 alongside each other on Windows before I try and wreck my 4.3 install. If so, anything I must pay special attention to? Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it'

Re: [PyQt] Pixel pushing performance

2008-05-08 Thread Aaron Digulla
Quoting Håkon Bertheussen <[EMAIL PROTECTED]>: Hi, I'm just getting started with PyQt, trying to implement a fairly complex widget in python. Unfortunately, it cannot easily be painted using higher level drawing primitives, meaning that I have to set individual pixels. I realize that this obvio

Re: [PyQt] Simple Draw/Erase on image

2008-04-30 Thread Aaron Digulla
Jake Richards schrieb: > Hello: > I am looking to write just a simple drawing program that would load an > image, and then allow me to draw and erase on top of it. I looked at the > scribble example and it has basically everything I need except the ability > to erase any marks I've made over the

Re: [PyQt] Updated PyQt Release Plans

2008-04-30 Thread Aaron Digulla
Phil Thompson schrieb: >> - For everything derived from QObject, connect to the dispose signal. >> At this time, save a stack trace and a pointer to the Python handle >> associated with the QObject >> - When the signal is emitted, make sure that the usage count of the >> corresponding Python objec

Re: [PyQt] Updated PyQt Release Plans

2008-04-30 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: As Qt v4.4 has been released a little earlier than I was expecting I'm dropping plans for a PyQt v4.3.4 release. The current snapshot has been updated for the final Qt v4.4. I need to finish the new support for QMetaObject.invokeMethod() and expect to

Re: [PyQt] Self-adjusting QTextEdit (PyQt4)

2008-04-27 Thread Aaron Digulla
Wildemar Wildenburger schrieb: >>> I'm trying to write a notecard application, somewhat in the vein of >>> Evernote --- basically a succession of little textboxes, one per note, >>> stacked above one another. To that end I'd like a QTextEdit (or similar) >>> that adjusts its height (with given wid

Re: [PyQt] Self-adjusting QTextEdit (PyQt4)

2008-04-26 Thread Aaron Digulla
Wildemar Wildenburger schrieb: > Hello folks, > > I'm trying to write a notecard application, somewhat in the vein of > Evernote --- basically a succession of little textboxes, one per note, > stacked above one another. To that end I'd like a QTextEdit (or similar) > that adjusts its height (with

Re: [PyQt] Looking for complex tree view example

2008-04-18 Thread Aaron Digulla
Quoting David Boddie <[EMAIL PROTECTED]>: You could port the C++ Editable Tree Model example from the Qt package, but that might not be dynamic enough for your purposes. Another example of the model/view classes in Python is the PyPI Browser application I started writing almost two years ago(!)

[PyQt] Looking for complex tree view example

2008-04-17 Thread Aaron Digulla
Hello, I'm trying to implement a tree model which displays a complex tree-like structure. The structure has no idea of the tree model and I'd like to keep it that way. When the structure changes (elements added, modified or removed), they send signals so I can update the tree model. Thi

Re: [PyQt] problems with QTextBrowser

2008-04-16 Thread Aaron Digulla
Quoting Dusan Zatkovsky <[EMAIL PROTECTED]>: I have tried "print repr ( html )" and it prints strange charracters ( <\x00h\x00t\x00m\x00l\x00>\x00<\x00h ... ). Couldn't be problem there? Yup. The 0-byte (\x00) is the "end of text" character. The zero bytes come from unicode. It seems that yo

Re: [PyQt] problems with QTextBrowser

2008-04-15 Thread Aaron Digulla
Dusan Zatkovsky schrieb: > Hi there. > > I have problem with QTextBrowser. I am writing db app, which (basically) asks > user for some rich text ( using dialog with QTextEdit ), then it receives > that text as html ( doc = self.ui.textEdit.document(), text = > doc.toHtml() ). That html is conv

Re: [PyQt] Cross Compiled PYQT

2008-04-12 Thread Aaron Digulla
Hal Glenn schrieb: > OK, I ended up following David's example completely, at first we had > tried with newer versions of Python QT sip etc but each one possessed a > problem so we dropped back to using David's work almost word for word, > accept in order to cross compile Python we had to edit it's

Re: [PyQt] QTableWidget in QSplitter

2008-03-24 Thread Aaron Digulla
Gregor Kling schrieb: > I have a MainWindow of which the Centralwidget consist of a Splitter > with more Splitters in it. >[...] > Now what I want is, that each QTableWidget expands its QTableWidgetItems > to the actual size > of its respective Splitter. > Does anyone have a clue how to do this ?

Re: [PyQt] Re: Joystick Keyboard

2008-03-09 Thread Aaron Digulla
Neil Wallace schrieb: >> I'm trying to write a program that creates an onscreen keyboard that >> uses an 2-analogue stick joypad for input. 1. Create a class which derives from QObject 2. Add a timer in there which calls a method to poll the joystick 3. Emit a signal in that method with the joys

Re: [PyQt] setText from threading

2008-02-21 Thread Aaron Digulla
Reinaldo de Carvalho schrieb: > The objective of this thread is only dont freeze window. No concurrent > acccess will happen to GUI components. A have a hundred of methods > called by pushButtons or SIGNALs from Qlistview like itemChanged, that > manipulate the GUI mainly to populate many QListVie

Re: [PyQt] setText from threading

2008-02-21 Thread Aaron Digulla
Reinaldo de Carvalho schrieb: > Why is possible access GUI from any thread? This seems not to be > allowed (Phil say "design error") but my application is running > without problems. That's pure chance. Eventually, your app will do something it shouldn't and it will "suddenly" break. You simply c

Re: [PyQt] From object IDs to objects to model indexes...

2008-02-12 Thread Aaron Digulla
Dirk Wagener schrieb: > Hi > > I am using QModelIndex constructed with an id. I am using the built-in > method > id(my_object) to get an ID to construct a ModelIndex with. > If we have an index, internalId() returns the id used to create the index. > Is there a API way to get the ModelIndex from a

Re: [PyQt] Creating an action with a "verbose" signal

2008-01-25 Thread Aaron Digulla
Quoting Martin Höfling <[EMAIL PROTECTED]>: Here come's the problem: For each file i create a QAction object, add this to the menu and connect it's "triggered()" signal with a python function blubb. The problem is to distinguish from which QAction/File blubb has been called. Any hint's how to s

Re: [PyQt] Proposal for New-style Signals

2008-01-23 Thread Aaron Digulla
Phil Thompson schrieb: > Signals are passed to QObject's [dis]connect() and emit() methods. > Currently, > If the signal is invalid then no indication is provided to that effect. If a > simple string is used instead of SIGNAL() then an invalid Qt signal will > cause a Python exception to be

Re: [PyQt] Multi-sectioned QTableWidget capability...

2008-01-23 Thread Aaron Digulla
Vince Fulco schrieb: > Dear PyQt experts- > > Can someone point me to a good working example of a QTableWidget with > multiple sections built into one table. I.E. I would like to display > raw observations, a set of summary data underneath it and a second set > of different summary data underneat

[PyQt] Posted a little praise of PyQt in my blog

2008-01-18 Thread Aaron Digulla
Hello, I posted a little praise of PyQt in my blog: http://darkviews.blogspot.com/2008/01/portable-ui.html Just in case someone here collects blog entries. A few days ago, I posted a tiny trick to sort number columns: http://darkviews.blogspot.com/2008/01/sorting-number-table-columns-in-pyqt4.h

[PyQt] Pimping QTextEdit

2008-01-18 Thread Aaron Digulla
Hello, I'm trying to create a clone of yWriter4 (a software that aims to help authors of stories -- sci-fi / fantasy / whatever) with Qt and I've got pretty far but now, I'm a bit stuck and I'd like some feedback on a few ideas. The original application uses a RTF widget where you can mark text a

Re: [PyQt] 10.7: super and PyQt classes

2008-01-18 Thread Aaron Digulla
Aaron Digulla schrieb: > Hello, > > Please clarify the docs > (http://www.riverbankcomputing.com/Docs/PyQt4/pyqt4ref.html#super-and-pyqt-classes): > > > Does that mean super() can't / shouldn't / mustn't be used when deriving > from PyQt classes? What is t

[PyQt] Support for Qt 4.4?

2008-01-18 Thread Aaron Digulla
Hello, I just wanted to know what the plan regarding 4.4 is. Is there a version of PyQt ready available for the beta releases of Qt 4.4? Or is is more like "don't hold your breath"? ;) Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it's our ima

Re: [PyQt] segfault!...and more

2008-01-18 Thread Aaron Digulla
Alberto Berti schrieb: > Hi Aaron, > >>>>>> "Aaron" == Aaron Digulla <[EMAIL PROTECTED]> writes: > >> # qui parent è in delegato, perciò parent.parent() è la # > >> tabella view = parent.parent() index = view.currentIndex()

Re: [PyQt] simpler 'connect' function

2008-01-17 Thread Aaron Digulla
Peter Shinners schrieb: >> Remember: If everyone in the world would develop software >> the way you do, you'd be unemployed. > > I'm not sure how to interpret this. I hope to keep using Pyqt for a long > time. I'm trying to make you understand that your way of developing software works for *you*

Re: [PyQt] simpler 'connect' function

2008-01-17 Thread Aaron Digulla
Peter Shinners schrieb: > But I don't really have problems with the existing > connect function. If we could just get rid of the SIGNAL requirement and > pass a string argument it would get a whole lot nicer. I've wasted several hours searching for typos so far, so I can't live with the current s

Re: [PyQt] simpler 'connect' function

2008-01-17 Thread Aaron Digulla
Quoting Ewald de Wit <[EMAIL PROTECTED]>: On Wednesday 16 January 2008 09:21:40 Aaron Digulla wrote: As for making the API simpler, I'd opt for button.connectClicked(self.buttonWasClicked) Wouldn't it be nicer if the signals where attributes of your object, so that

RE: [PyQt] simpler 'connect' function

2008-01-16 Thread Aaron Digulla
Quoting Peter Shinners <[EMAIL PROTECTED]>: That's why I'm against string literals in an API. If that API doesn't even offer any checks to string literals, that's even worse. I'd be against using constants to define the signals. What type of value is going to match things like "const QString&"

Re: [PyQt] simpler 'connect' function

2008-01-15 Thread Aaron Digulla
Peter Shinners schrieb: > Aaron Digulla: >> Sorry, I can't follow you here. 1) signal and slot already >> take string arguments. This discussion is to get rid of them. > > I get "TypeError: argument 2 of QObject.connect() has an invalid type" > when I try

RE: [PyQt] simpler 'connect' function

2008-01-15 Thread Aaron Digulla
Quoting Peter Shinners <[EMAIL PROTECTED]>: No, but a few ideas have been thrown around on the list in the past couple of days. Your suggestion is nice and concise - the dropping of SIGNAL() was briefly discussed during developed of PyQt4. Allowing string arguments for the signal/slot nam

[PyQt] How to determine the color of select items?

2008-01-14 Thread Aaron Digulla
Hello, When I select items in a list, they turn white on a blue background. How do I determine the exact color of that blue shade? Background: I want to implement a graphical drag&drop like the one you have in Windows XP explorer which should feel as if you ripped the selected item out of the lis

Re: [PyQt] Custom widgets usable from designer

2008-01-14 Thread Aaron Digulla
Martin Höfling schrieb: [forgot to reply to the list] > Hi all, > > is there a tutorial or sth which describes how to implement a custom widget > to > make it usable from designer? > > I wanna implement a simple widget consisting of a label a LineEdit (with full > path of file) and a Butto

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Giovanni Bajo schrieb: >> I don't have a real example, but that's not the point. The point is >> that they are different as far as Qt is concerned and so both need to >> be able to be represented in the same class (even though the >> programmer that designed the class needs to be shot). > > But g

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: What about... foo(const QString &) foo(QString *) Can you give an example with two signals with the same name and such parameters? I can't imagine to see that for any single class. It *might* happen with signals from different classes but there,

Re: [PyQt] signal-slot connect problem

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: I mean it is a very common mistake, even for advanced PyQt developers, Is it? In my projects, I'm predefining all signals and slots as python constants and use those in connect() and emit(). a) makes the code more reliable and b) enables code com

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Henrik Pauli <[EMAIL PROTECTED]>: But anyway: How much work would it be to have SIP generate constants for all SIGNAL's in a class? So I could say: self.connect(w1, w1.SOME_SIGNAL, ...) Pro: Doesn't break old code, API, etc. No more typos (or python will warn about a missing attri

Re: [PyQt] Is the result of SIGNAL() a constant?

2008-01-09 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: From the documentation, I got the impression that the result of SIGNAL() is more or less a constant. Is this code valid? signal = SIGNAL() self.connect(w1, signal, self.w1Clicked) self.connect(w2, signal, self.w2Clicked) Yes - given a corre

[PyQt] Is the result of SIGNAL() a constant?

2008-01-08 Thread Aaron Digulla
Hello, >From the documentation, I got the impression that the result of SIGNAL() is more or less a constant. Is this code valid? signal = SIGNAL() self.connect(w1, signal, self.w1Clicked) self.connect(w2, signal, self.w2Clicked) ie. can I predefine all signals in my app, save them somew

Re: [PyQt] Bug in QTableView.setModel()

2008-01-08 Thread Aaron Digulla
Quoting Aaron Digulla <[EMAIL PROTECTED]>: Another wa would be to save all objects which pass through SIP in map (QObject -> Python wrapper), connect to the destroyed(QObject) signal and check the state when it is emitted. Does SIP notice when the python wrapper is destroyed? If

Re: [PyQt] Bug in QTableView.setModel()

2008-01-08 Thread Aaron Digulla
Quoting Hans-Peter Jansen <[EMAIL PROTECTED]>: First of all, happy new year, Phil & and PyQtnistas! Thanks, to you, too. :) The difference is that in C++ the effect of the bug is a memory leak, but in PyQt it is often a crash. This part is what bugs me, and surely caught every PyQt user in

[PyQt] 10.7: super and PyQt classes

2008-01-08 Thread Aaron Digulla
Hello, Please clarify the docs (http://www.riverbankcomputing.com/Docs/PyQt4/pyqt4ref.html#super-and-pyqt-classes): Does that mean super() can't / shouldn't / mustn't be used when deriving from PyQt classes? What is the fix? Maybe give an example what won't work and how to fix it or provi

Re: [PyQt] Bug in QTableView.setModel()

2008-01-08 Thread Aaron Digulla
Quoting Phil Thompson <[EMAIL PROTECTED]>: I'm happy to consider ways to make this more obvious (even if it's just a better FAQ), but I'm not happy about departing from the Qt API and introducing inconsistencies in fundamental behaviour. Then let me put it this way: If I wanted to care about w

Re: [PyQt] Bug in QTableView.setModel()

2008-01-08 Thread Aaron Digulla
Quoting Aaron Digulla <[EMAIL PROTECTED]>: I'm talking about preventing the python class which is used as the model being garbage collected; it doesn't matter from which Qt class it is derived. As it is, the class pointer is copied into the view class and then python frees

Re: [PyQt] Bug in QTableView.setModel()

2008-01-08 Thread Aaron Digulla
Quoting Andreas Pakulat <[EMAIL PROTECTED]>: I'm talking about preventing the python class which is used as the model being garbage collected; it doesn't matter from which Qt class it is derived. As it is, the class pointer is copied into the view class and then python frees the memory. That ca

Re: [PyQt] Bug in QTableView.setModel()

2008-01-07 Thread Aaron Digulla
Quoting Andreas Pakulat <[EMAIL PROTECTED]>: On 06.01.08 21:13:44, Aaron Digulla wrote: The root cause is that setModel() doesn't increment the usage counter of the python class passed in, so Python will GC it if I don't save a pointer elsewhere. Thats by purpose. One reaso

[PyQt] Bug in QTableView.setModel()

2008-01-06 Thread Aaron Digulla
Hello, When I create a python implementation of a table model derived from QAbstractTableModel and use that in QTableView.setModel(), I have spurious errors afterwards: Sometimes, the redraw doesn't work, sometimes, I can't select anything, etc. The root cause is that setModel() doesn't increment

Re: [PyQt] Is it possible to override/extend QTextCursor?

2008-01-06 Thread Aaron Digulla
Phil Thompson schrieb: >> I'm using openSUSE Linux and python-qt4 4.3-19. The methods are defined >> in qtextcursor.sip, only insertText() is confusing: >> >> void insertText(const QString &text); >> void insertText(const QString &text, const QTextCharFormat &format); >> >> Which one will

[PyQt] Is it possible to override/extend QTextCursor?

2008-01-06 Thread Aaron Digulla
Hello, I tried to overload insertText() of QTextCursor like this: from PyQt4.QtGui import QTextEdit, QTextCursor, QApplication import sys class MyCursor(QTextCursor): def __init__(self, doc): super(MyCursor, self).__init__(