Re: [PyQt] Compacting long file names or strings

2013-01-16 Thread Wolfgang Rohdewald
Am Mittwoch, 16. Januar 2013, 09:54:43 schrieb Timothy W. Grove: > Suppose I have a long file name such as "C:\Users\Public\Videos\Sample > Videos\Wildlife.wmv" that I want to display on a button but there isn't > enough room to display the entire name. I want to compact it down to, > say, "C:\U

Re: [PyQt] model test

2012-12-14 Thread Wolfgang Rohdewald
On Friday 14 December 2012 11:10:51 José M. Rodriguez Bacallao wrote: > I downloaded and put it in my test but this model test is made for API v1 > not API v2, my model use API v2 for QVariant, any suggestions? last time I tried I was not able to make the conversion to v2 because PyKDE4 produced s

Re: [PyQt] model test

2012-12-14 Thread Wolfgang Rohdewald
On Friday 14 December 2012 08:38:37 José M. Rodriguez Bacallao wrote: > I have tested the modeltest that came with pyqt4 in my Archlinux > installation (4.9.5) but it doesn't seen to work. Any suggestions? there are several versions floating around. one of them (IMHO the best maintaned one) is pa

[PyQt] toPyObject is undocumented

2012-09-16 Thread Wolfgang Rohdewald
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html#toPyObject says nothing about what it does. I just found out it alway returns python long even for small integers. Is that intended or a bug? ii python-qt4 4.9.1-2ubuntu1

Re: [PyQt] accessing variables of class

2012-05-11 Thread Wolfgang Rohdewald
Am Freitag, 11. Mai 2012, 18:18:18 schrieb Enes Albay: > self.clicked.connect(A.handleLetter) > AttributeError: 'function' object has no attribute '__pyqtSignature__' is A a class or an instance? It should be an instance. conventionally instance names should not start uppercase -- Wolfgang ___

Re: [PyQt] accessing variables of class

2012-05-11 Thread Wolfgang Rohdewald
Am Freitag, 11. Mai 2012, 16:12:18 schrieb Enes Albay: > Thanks for reply. But, unfortunately, it doesn't solve my problem. it might be helpful if you post a complete runnable example for the problem. that would also tell us if your class C calls __init__ for QPushButton - my favourite guess for

Re: [PyQt] accessing variables of class

2012-05-10 Thread Wolfgang Rohdewald
Am Donnerstag, 10. Mai 2012, 22:41:06 schrieb Enes Albay: > class C(QtGui.QPushButton): > > def __init__(self, parent, letter): > self.clicked.connect(self.handleLetter) > > def handleLetter(self): > > > > I want to do that: > > lineEdit.setText("bla bla")

Re: [PyQt] Synchronized scrolling between two tables

2011-11-02 Thread Wolfgang Rohdewald
Am Mittwoch, 2. November 2011, 06:23:36 schrieb Nader Abedrabbo: > If their is a way to disable certain columns in a table from being selected, > I would appreciate if you can guide me to it. you can define you own model, deriving from a Qt standard model, and override flags(). In the link I gave

Re: [PyQt] Synchronized scrolling between two tables

2011-11-01 Thread Wolfgang Rohdewald
Am Dienstag, 1. November 2011, 14:02:48 schrieb Nader Abedrabbo: > What I would like though is a synchronized scrolling of the two tables, i.e. > if I scroll the first table, then the second table should scroll to the > same view (same row level) as the first table. > > Is that possible? yes. Ha

Re: [PyQt] qtreewidget only printing first character of my strings

2011-04-21 Thread Wolfgang Rohdewald
On Donnerstag 21 April 2011, Jason Rahm wrote: > If I uncomment my print statements, each string is printed as > expected, but in the QTreeWidget, I only get the first > character: I think QTreeWidgetItem expects a string list, not a string. Maybe [x] instead of x works better? -- Wolfgang _

Re: [PyQt] distinguish / enable / disable multiple pointer devices

2011-03-24 Thread Wolfgang Rohdewald
On Freitag 25 März 2011, Gelonida wrote: > I have a PC (Windows) with a mouse, a touch screen and a > graphics tablet. > > > Is there any way to know with which device a widget was > clicked? something like QKeyEvent, QMouseEvent, QTabletEvent, QTouchEvent and QWheelEvent? class MyWidget(QWidge

[PyQt] configure.py on windows

2011-03-19 Thread Wolfgang Rohdewald
I am using the kde-windows emerge tool for building pyqt (msv2010 compiler), and I am building everything in Debug mode only. No pyqt previously installed. For that environment, PyQt-win-gpl-4.8.3/configure.py needs some changes: 1. configure.py --debug should use the debug makefile qtdirs.mk.Deb

Re: [PyQt] 2 Updates for the modeltest in PyQt4

2011-02-21 Thread Wolfgang Rohdewald
On Montag 21 Februar 2011, Andreas Pakulat wrote: > Now did a closer look at the diff between that version of > mine, the attached 3 patches (one is the add vs. append > change) contain the changes. > > > I made a few bug fixes and I believe I mailed them back to > > the author but now that I chec

Re: [PyQt] 2 Updates for the modeltest in PyQt4

2011-02-20 Thread Wolfgang Rohdewald
On Sonntag 20 Februar 2011, Andreas Pakulat wrote: > I didn't test yet against an actual model, so might have done > something wrong in porting. yep. lists have no add, it is append I didn't test either but pylint did Where do you maintain modeltest.py? I got it from http://bazaar.launchpad.ne

Re: [PyQt] vertical alignment of richtext in a table view

2010-12-18 Thread Wolfgang Rohdewald
On Dienstag 07 September 2010, Mark Summerfield wrote: > > > The offset you need might be made up of the > > > option.decorationSize's width; not sure about the height > > > offset. > > > > > > > > decorationSize is (16,16) - that does not explain it. > > Then I'm not sure. Could try experimentin

Re: [PyQt] segfault, from qt or pyqt?

2010-12-16 Thread Wolfgang Rohdewald
On Donnerstag 16 Dezember 2010, Hans-Peter Jansen wrote: > > I've just checked, every Qt lib on my system has version > > 4:4.6.3-4 (same as libqt4-dbg) > > Sorry, my fault. It looks like you're missing the PyQt debug > symbols. Ubuntu has a problem - it installs the PyQt debug symbols in the wr

Re: [PyQt] bug: QProcessEnvironment insert failing

2010-12-10 Thread Wolfgang Rohdewald
On Freitag 10 Dezember 2010, Scott Ballard wrote: > The insert method of QProcessEnvironment overwrites the > environment variable instead of inserting into it. according to the manual, this is correct. Inserts the environment variable of name name and contents value into this QProcessEnvironmen

Re: [PyQt] QSqlTableModel.rowCount bug? (and still need infor for beforeInsert)

2010-12-03 Thread Wolfgang Rohdewald
On Freitag 03 Dezember 2010, Andreas Pakulat wrote: > It also doesn't mention that its based on > QSqlQueryModel::rowCount(). That one however does explain > what it returns in its API docs. So it seems like your DB is > at fault, as its not able to return the complete size of the > query. You are

Re: [PyQt] QSqlTableModel.rowCount bug? (and still need infor for beforeInsert)

2010-12-03 Thread Wolfgang Rohdewald
On Freitag 03 Dezember 2010, KONTRA, Gergely wrote: > Hi all! > > I suspect QSqlTableModel.rowCount cannot return numbers above > 256. rowCount is not the number of rows in the table but in the model, AFAIK. Use fetchMore() to load more. > And can somebody tell me why this code is this painfull

Re: [PyQt] Reporting Bugs in PyQt/Qt

2010-11-29 Thread Wolfgang Rohdewald
On Montag 29 November 2010, Ian wrote: > Having chased down the definition of the role - not in the > class or method, and not linked from either location http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#data with a note: "See also" http://doc.qt.nokia.com/4.7/qt.html#ItemDataRole-enum there

Re: [PyQt] Bugs galore in QAbstractTableModel???

2010-11-29 Thread Wolfgang Rohdewald
On Sonntag 28 November 2010, Steve Borho wrote: > Indeed, I found these when I started using the file, and > checked in a fixed version here: > > http://bitbucket.org/tortoisehg/thg/src/tip/tortoisehg/hgqt/mo > deltest.py here are some more bug fixes for editable models. The patch is against your

Re: [PyQt] Bugs galore in QAbstractTableModel???

2010-11-28 Thread Wolfgang Rohdewald
On Sonntag 28 November 2010, Steve Borho wrote: > I found an updated version of the file here: > > http://bazaar.launchpad.net/~bzr/ubuntu/maverick/qbzr/bzr-ppa/ > annotate/head:/lib/tests/modeltest.py this still needs more updates. Mostly for editable models. Like -c = insert.pop() +

Re: [PyQt] Bugs galore in QAbstractTableModel???

2010-11-27 Thread Wolfgang Rohdewald
On Samstag 27 November 2010, Ian wrote: > So here are the model and view: you could try to add checks to your methods like in data(): if index.isValid(): if role == Qt.DisplayRole: data() will also be called with role == Qt.CheckStateRole in which case your code returns True or in headerData:

Re: [PyQt] QStandardItemEditorCreator missing

2010-11-25 Thread Wolfgang Rohdewald
On Donnerstag 25 November 2010, Hans-Peter Jansen wrote: > If you run the scripts, and press "Arrow left", "blank", > "Arrow down", "Return", "Return", something similar the > following is printed: you probably mean "Arrow right", "blank", "Arrow down", "Return", "Return" I attached the interes

Re: [PyQt] unicode and pyqt4

2010-11-24 Thread Wolfgang Rohdewald
On Mittwoch 24 November 2010, Janwillem van Dijk wrote: > When I run the script from > Eric4 or directly from a terminal with "python scriptname.py" > all is OK. However I want to run it as a subprocess and than > the special chars generate errors: if stdout is pipelined, python tries to encode

[PyQt] dead link at riverbankcomputing.co.uk

2010-10-04 Thread Wolfgang Rohdewald
this page http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#downloading- sip has a dead link to the SIP documentation -- Wolfgang ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo

Re: [PyQt] pyuic4 vs uic.loadUI

2010-09-28 Thread Wolfgang Rohdewald
On Dienstag 28 September 2010, Sebastian Wiesner wrote: > So basically it "just works", whereas pyuic4 means additional > work. UI compilers are fine for C++, where you have to > compile anyway, but in Python things are easier. Just my > opinion ... +1 however I never tested how much time eithe

Re: [PyQt] KConfigSkeleton and pyqt4 API version 2

2010-09-17 Thread Wolfgang Rohdewald
On Freitag 17 September 2010, Hans-Peter Jansen wrote: > first of all, this is the wrong list for PyKDE issues. Try to > resend this to the kde-bindings ML: will do, thank you for pointing me there. > You're missing to create a {Q,K}Application instance here. not needed for this minimal exampl

[PyQt] KConfigSkeleton and pyqt4 API version 2

2010-09-16 Thread Wolfgang Rohdewald
Hi, this code prints random output. How should I fix this? import sip sip.setapi('QString', 2) from PyKDE4.kdeui import KConfigSkeleton a = KConfigSkeleton() name = 'tilesetName' value = 'I am a value' s = a.addItemString(name, value) print s.value() == output: == value is: 䱀Ɨ!䱠Ɨ彐Ɨ美繈

Re: [PyQt] vertical alignment of richtext in a table view

2010-09-07 Thread Wolfgang Rohdewald
On Dienstag 07 September 2010, Mark Summerfield wrote: > I should have mentioned before that it is better to inherit > from QStyledItemDelegate rather than QItemDelegate. I'd try > that first & see if that improves things at all. makes no difference. > The offset you need might be made up of the

Re: [PyQt] vertical alignment of richtext in a table view

2010-09-06 Thread Wolfgang Rohdewald
On Montag 06 September 2010, Mark Summerfield wrote: > I'm tending to use a differnt approach for rich text delegates > nowadays. Instead of using a QTextDocument, I store a > class-level QLabel, something like this: your solution certainly looks cleaner than my temporary fix (document.setDocument

[PyQt] vertical alignment of richtext in a table view

2010-09-05 Thread Wolfgang Rohdewald
Hi, in Mark Summerfields book "Rapid GUI programming with Python and QT", there is an example on page 485 with a table column having a delegate that displays richtext. In the book, the text in this column has a vertical alignment in the middle of the cells, just like the other columns. but if I e

[PyQt] QMessagebox.exec_() documentation

2010-05-09 Thread Wolfgang Rohdewald
the doc at http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qmessagebox.html#exec says that the exec_() slot returns the StandardButtons value of the button that was clicked. The C++ doc says if user defined buttons are used, an opaque value is returned. This is not mentioned in the Py

Re: [PyQt] How to retrieve number of fields of a query from QSqlQuery object

2010-03-24 Thread Wolfgang Rohdewald
On Mittwoch 24 März 2010, bar tomas wrote: > Hi, > QSqlQuery's size method gives the number of rows retrieved > with a query. But is there some way to get the number of > fields (columns) of that query? > Many thanks. if self.query.isSelect(): record = self.query.record() qFields = [record.fie

[PyQt] Problem with KDialogButtonBox.addButton

2010-03-02 Thread Wolfgang Rohdewald
Hi, how can I pass my own python slot to addButton? def slotInsert(self): pass newItem = KGuiItem(QString("&New"), KIcon("document-new")) self.newButton = self.buttonBox.addButton(newItem, KDialogButtonBox.ActionRole, self, self.slotInsert) TypeError: KDialogButtonBox.addButton(): arguments

Re: [PyQt] Sudoku Grid - Recommended Approaches

2010-02-03 Thread Wolfgang Rohdewald
On Thursday 04 February 2010, Kareem Yusuf wrote: > I'm looking for some advice on the best way to implement a sudoku > grid using PyQt. I am new to PyQt and Python so my following > thoughts are shaped by other language experiences (c# and Java). did you consider a QGraphicsScene and QGraphicsRec

[PyQt] Kajongg - a new game base on PyQt and twisted

2010-01-25 Thread Wolfgang Rohdewald
I would like to announce Kajongg - it is a Mah Jongg game (not yet another solitaire but the real game for four players). It is written 100% in python and regular expressions. The GUI is done with PyQt4, and the network part is written using twisted. Dear twisted people - you have a list of proj

[PyQt] Re: Global Shorcuts

2009-11-03 Thread Wolfgang Rohdewald
On Wednesday 04 November 2009, Manuel Enrique wrote: > How can I set a global shorcut for my app? look up setShortcutContext in the docu: res = KAction(self) # should also work with QAction, I suppose res.setShortcut( Qt.CTRL + shortcut) res.setShortcutContext(Qt.ApplicationShortcut) -- Wolfg

[PyQt] Re: Those bl**dy signals again

2009-10-03 Thread Wolfgang Rohdewald
On Saturday 03 October 2009, Thomas Olsen wrote: > def amount_editing_finished() that should return a syntax error, missing ":" should that not be def amount_editing_finished(self): -- Wolfgang ___ PyQt mailing listPyQt@riverbankcomputin

Re: [PyQt] determining pyqt version

2009-07-18 Thread Wolfgang Rohdewald
On Saturday 18 July 2009, Phil Thompson wrote: > On Sat, 18 Jul 2009 11:59:23 +0200, Wolfgang Rohdewald > wrote: > > is there any other way to find out the current version? > > PyQt4.QtCore.PYQT_VERSION_STR > PyQt4.QtCore.PYQT_VERSION than

[PyQt] determining pyqt version

2009-07-18 Thread Wolfgang Rohdewald
I am doing that with: import PyQt4.pyqtconfig PYQTVERSION = PyQt4.pyqtconfig.Configuration().pyqt_version_str but now that I tried to deploy it I see that this imports sipconfig which is part of the ubuntu package python-sip4-dev I do not want to depend on -dev packages on target machines, is th

Re: [PyQt] Qt.WindowCloseButtonHint undefined

2009-06-07 Thread Wolfgang Rohdewald
On Sonntag, 7. Juni 2009, Phil Thompson wrote: > It was added in Qt v4.5. thank you. -- Wolfgang ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Qt.WindowCloseButtonHint undefined

2009-06-07 Thread Wolfgang Rohdewald
Hello, flags = self.windowFlags() newflags = flags | Qt.WindowStaysOnTopHint newflags = flags & ~ Qt.WindowCloseButtonHint self.setWindowFlags(newflags) self.show() AttributeError: WindowCloseButtonHint WindowStaysOnTopHint is defined, but not WindowClos

Re: [PyQt] Re: tooltips in menu: how?

2009-04-19 Thread Wolfgang Rohdewald
On Sonntag, 19. April 2009, projetmbc wrote: > This is normal. When the menu is activated ther is no reason to give a > tooltip about it because we know wath is in. let me restate what I observed: if the tip click here... appears, the tips "tooltip 0" etc will never appear unless the program i

[PyQt] Re: tooltips in menu: how?

2009-04-18 Thread Wolfgang Rohdewald
On Saturday, 18. April 2009, projetmbc wrote: > V. Armando Solé is right. With this solution the tooltips come quickly > in my computer. The corresponding PyQt code is : this code works here too - but not always. First place the mouse over the menu and wait until the tooltip "Click here..." appe

[PyQt] Re: Connecting two QGraphicsItems

2009-04-09 Thread Wolfgang Rohdewald
On Thursday, 9. April 2009, Mads wrote: > is it possible to control the position of the item? just use item.setPos() - this uses a coordinate system relative to the parent item. -- Wolfgang ___ PyQt mailing listPyQt@riverbankcomputing.com http://ww

[PyQt] Re: QWebView in QGraphicsScene - drag and drop issue

2009-04-06 Thread Wolfgang Rohdewald
On Montag, 6. April 2009, Tom Batkiewicz wrote: > I get a hard crash with the following code if you drag/drop inside a > QWebView that is being rendered inside of a QGraphicsScene. > The trick is that it functions properly if you use addWidget() to > directly put the widget into the scene, but if

[PyQt] Re: Connecting two QGraphicsItems

2009-04-06 Thread Wolfgang Rohdewald
On Montag, 6. April 2009, Marcell Mars wrote: > On Mon, Apr 6, 2009 at 4:13 PM, Mads wrote: > > each item needs to have separate functionality, so you should be able to > > set different > > attributes on each item. Is the createItemGroup, still the best way forward? > > to be more sure i would

[PyQt] segfault with KXmlGuiWindow

2009-04-02 Thread Wolfgang Rohdewald
This is a problem since I started using pykde, it persists after updating from kubuntu intrepid to jaunty. See the example below. At program exit, I have a segfault. If I remove "def main" and execute its content directly, I have no segfault. But this is no real solution for me because in my full

[PyQt] caching qgraphicssvgitem is buggy

2009-03-29 Thread Wolfgang Rohdewald
I am using qt4.5 with python-qt4.4.4 (ubuntu jaunty) In my application I have a qgraphicssvgitem. When I change the element to be rendered with setElementId(), this change does not do anything. I still see the old element displayed. Only after I invalidate the cache or resize the view (which al

[PyQt] Re: dragging a QGraphicsSvgItem

2009-03-18 Thread Wolfgang Rohdewald
On Mittwoch, 18. März 2009, Matt Smith wrote: > I use a graphics scene and I never have to explicitly paint anything. > It seems like you could create a pixmap item when you load the svg then > you wouldn't have to render it again later. My view scales the svg images matching to the available spac

[PyQt] dragging a QGraphicsSvgItem

2009-03-17 Thread Wolfgang Rohdewald
While dragging it, I want to see the whole image of the item move. What works is something like this: (code goes into class Tile(QGraphicsSvgItem), def mousePressEvent) ... pmapSize = self.tileset.tileSize.toSize() if self.pixmap is None or self.pixmap.size() !

Re: [PyQt] Re: PyQT lost reference (was: Re: PyKDE: KConfigSkeleton not writing configuration)

2009-03-13 Thread Wolfgang Rohdewald
On Freitag, 13. März 2009, Phil Thompson wrote: > Which is why eliminating QStrings is an incompatible change and will > require changes to your code. Sorry, it seems I misread your roadmap - I thought this would be a compatible change. -- Wolfgang _

[PyQt] Re: PyQT lost reference (was: Re: PyKDE: KConfigSkeleton not writing configuration)

2009-03-13 Thread Wolfgang Rohdewald
On Freitag, 13. März 2009, Till Gerken wrote: > The QString() that I am passing as reference to the C++ class > KCoreConfigSkeleton exists as local variable in my Python class > derived from KCoreConfigSkeleton. Now any code that interacts with > KCoreConfigSkeleton (C++ or Python) may change this

[PyQt] QString mutable, unicode string immutable

2009-02-26 Thread Wolfgang Rohdewald
Hi, I just found out the hard way what the subject says Now I am curious: The PyQt roadmap says that non-pythonic classes like QString will be removed. So the result of some Qt/KDE methods will no longer return a mutable result but an immutable result. Could this not break code that relies on the

[PyQt] Re: LGPL license.

2009-02-10 Thread Wolfgang Rohdewald
On Dienstag, 10. Februar 2009, Knapp wrote: > Why do we live? not for searching the pyqt archives :-) -- Wolfgang ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Re: Is it possible to subclass QSqlDatabase?

2009-02-06 Thread Wolfgang Rohdewald
On Freitag, 6. Februar 2009, Mattia Borsalino wrote: > class MyDatabase(QSqlDatabase): > """ > subclasses QSqlDatabase > """ > def __init__(self, parent=None): > super(MyDatabase, self).__init__(parent) according to the docu, parent should either not be passed or it should

Re: [PyQt] QSqlDatabase: available drivers: QSQLITE

2008-12-18 Thread Wolfgang Rohdewald
On Donnerstag, 18. Dezember 2008, lucabe...@libero.it wrote: > I need to connect to mysql db but when i try i see that i have only availabe > the driver for sqlite, how can i add the mysql driver? maybe you need to install the package libqt4-sql-mysql (I am running ubuntu) -- Wolfgang ___

[PyQt] kde4: where is pykdedocs?

2008-12-04 Thread Wolfgang Rohdewald
Hi, on kubuntu 8.10, the file /usr/share/doc/python-kde4-doc/html/pykdedocs.html says there is a script installdocs.py for installing kykdedocs. Where can I find this script? Not on my computer, and I think I installed all relevant packages. specifically, I am trying to do something like self.