Re: [PyQt] sizing a QTextEdit...

2010-09-08 Thread Algis Kabaila
On Thursday 09 September 2010 14:12:00 Peter Milliken wrote: > Sorry, that previous email should have explained that within the main > QFrame I am attempting to lay everything out using gridlayout. > > On Thu, Sep 9, 2010 at 2:06 PM, Peter Milliken wrote: > > Probably not. The code snippet might

Re: [PyQt] Selecting the last added item in a QAbstractTableModel

2010-09-08 Thread Brian Zambrano
You can do this with setCurrentIndex in the view. You'll simply need to select an index in the row you just added. http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qabstractitemview.html#setCurrentIndex In your case, it may be something like: # assume you have a reference to the view

Re: [PyQt] sizing a QTextEdit...

2010-09-08 Thread Peter Milliken
Sorry, that previous email should have explained that within the main QFrame I am attempting to lay everything out using gridlayout. On Thu, Sep 9, 2010 at 2:06 PM, Peter Milliken wrote: > Probably not. The code snippet might be a bad example. I am attempting to > create a QFrame in the MainWindo

Re: [PyQt] sizing a QTextEdit...

2010-09-08 Thread Peter Milliken
Probably not. The code snippet might be a bad example. I am attempting to create a QFrame in the MainWindow and populate it with a number of pairs of lQLabel/QLineEdit. One of the "pairs" needs to be a QLabel/QTextEdit and unfortunately as soon as I add that the grid seems to 'explode' - in the ver

Re: [PyQt] sizing a QTextEdit...

2010-09-08 Thread Algis Kabaila
On Thursday 09 September 2010 13:03:14 Peter Milliken wrote: > I cannot work out how to (re)size a QTextEdit widget. I have tried various > methods, without success. I show one method in the following code snippet, > I would appreciate it if somebody could point out my error :-) > > Thanks > Peter

[PyQt] sizing a QTextEdit...

2010-09-08 Thread Peter Milliken
I cannot work out how to (re)size a QTextEdit widget. I have tried various methods, without success. I show one method in the following code snippet, I would appreciate it if somebody could point out my error :-) Thanks Peter from PyQt4.QtCore import * from PyQt4.QtGui import * import PyQt4.Qt as

Re: [PyQt] Drop to system

2010-09-08 Thread David Boddie
On Wed Sep 8 22:33:17 BST 2010, Hugo Leveille wrote: > I have looked at the doc but all I could find was drag and drop within the > pyqt app itself. What id like to do is the, for exemple, attach an url or > whatever needed to an item so that if I drag the item into my desktop, in a > explorer wi

[PyQt] Selecting the last added item in a QAbstractTableModel

2010-09-08 Thread AmFreak
Hi, i have a QAbstractTableModel in which i insert data (rows) with a button that opens a dialog and calls the insertRow method after the dialog is closed: def insertRow (self, row, filesystem, parent = QModelIndex() ): self.beginInsertRows(QModelIndex(), len(self.fList), len(self

Re: [PyQt] Drop to system

2010-09-08 Thread Massimo Di Stefano
Hi All. i'm tring to learn a similar things ... but i can't find a solution yet :-( i wrote a sample code from where i'm tring to start to learn how to implement a drag-ndrop action : import sys import os from PyQt4 import QtCore, QtGui from table_ui import Ui_Form class Gui(QtGui.QWidget, U

[PyQt] Drop to system

2010-09-08 Thread Hugo Leveille
I have looked at the doc but all I could find was drag and drop within the pyqt app itself. What id like to do is the, for exemple, attach an url or whatever needed to an item so that if I drag the item into my desktop, in a explorer window or whatever othe app that support drag drop, it will re

Re: [PyQt] Drag to system

2010-09-08 Thread Baz Walter
On 08/09/10 15:27, Hugo Léveillé wrote: I did but I couldn't find how to do it even if I know the info is there somewhere in the doc. Any hints are welcomed On Wed, 08 Sep 2010 15:50 +0200, "Hans-Peter Jansen" wrote: On Wednesday 08 September 2010, 15:05:21 Hugo Léveillé wrote: I have made a

Re: [PyQt] Drag to system

2010-09-08 Thread Ken Kriegel
Pete and Phil, The one reference that I was able to find to "Drag and Drop guide" in the current doc tree, http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/dnd.html, is 404. Perhaps the doc generator has missed something? Or have I missed something? Thanks, Ken On Wed, Sep 8, 2010 at 7

Re: [PyQt] Drag to system

2010-09-08 Thread Hugo Léveillé
I did but I couldn't find how to do it even if I know the info is there somewhere in the doc. Any hints are welcomed On Wed, 08 Sep 2010 15:50 +0200, "Hans-Peter Jansen" wrote: > On Wednesday 08 September 2010, 15:05:21 Hugo Léveillé wrote: > > I have made a event to get the path of a file dragg

Re: [PyQt] Drag to system

2010-09-08 Thread Hans-Peter Jansen
On Wednesday 08 September 2010, 15:05:21 Hugo Léveillé wrote: > I have made a event to get the path of a file dragged into my pyqt app > with this: > > path = event.mimeData().urls() > > But I would like to make to exact opposite ( to drag an item of my app > into another app that expect a file dro

[PyQt] Drag to system

2010-09-08 Thread Hugo Léveillé
I have made a event to get the path of a file dragged into my pyqt app with this: path = event.mimeData().urls() But I would like to make to exact opposite ( to drag an item of my app into another app that expect a file drop) I looked in the doc on how I could set an URL to my listWidgetItem but

[PyQt] order of flags significant in coercing

2010-09-08 Thread Hans-Peter Jansen
Hi Phil, there's an issue with the order of flags when coercing to int for e.g. QPainter.paintText(): >>> from PyQt4.QtCore import * >>> type(Qt.AlignLeft|Qt.TextWordWrap|Qt.AlignTop) >>> type(Qt.AlignLeft|Qt.AlignTop|Qt.TextWordWrap) Traceback (most recent call last): File "", line 1, in T

Re: [PyQt] Keypressevent

2010-09-08 Thread Hans-Peter Jansen
[Resend to list also] On Wednesday 08 September 2010, 11:06:59 lucabe...@libero.it wrote: > hello i need to intercept the return and the enter key in a plaintextedit > and i have write this > def keyPressEvent(self, event): > self.plainTextEdit.keyPressEvent(event) > if event.key()

Re: [PyQt] Keypressevent

2010-09-08 Thread Vincent Vande Vyvre
Le 08/09/10 11:06, lucabe...@libero.it a écrit : hello i need to intercept the return and the enter key in a plaintextedit and i have write this def keyPressEvent(self, event): self.plainTextEdit.keyPressEvent(event) if event.key() == QtCore.Qt.Key_Return : pri

[PyQt] Keypressevent

2010-09-08 Thread lucabe...@libero.it
hello i need to intercept the return and the enter key in a plaintextedit and i have write this def keyPressEvent(self, event): self.plainTextEdit.keyPressEvent(event) if event.key() == QtCore.Qt.Key_Return : print ' return' elif event.key() == QtCore.Qt.Key_