Re: [PyQt] Error building Sip 4.9.1 Snapshots 090929
On Tue, 29 Sep 2009 21:54:47 -0600, Melton Low softw.d...@gmail.com wrote: Error building Sip 4.9.1 Snapshots 090929: LittleMac:sip-4.9.1-snapshot-20090929 melton$ python2.6 configure.py This is SIP 4.9.1-snapshot-20090929 for Python 2.6.2 on darwin. The SIP code generator will be installed in /Library/Frameworks/Python.framework/Versions/2.6/bin. The SIP module will be installed in /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages. The SIP header file will be installed in /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6. The default directory to install .sip files in is /Library/Frameworks/Python.framework/Versions/2.6/share/sip. The platform/compiler configuration is macx-g++. Creating sipconfig.py... Creating top level Makefile... Creating sip code generator Makefile... Creating sip module Makefile... LittleMac:sip-4.9.1-snapshot-20090929 melton$ make cc -c -pipe -Os -w -DNDEBUG -I. -o main.o main.c cc -c -pipe -Os -w -DNDEBUG -I. -o transform.o transform.c cc -c -pipe -Os -w -DNDEBUG -I. -o gencode.o gencode.c cc -c -pipe -Os -w -DNDEBUG -I. -o export.o export.c cc -c -pipe -Os -w -DNDEBUG -I. -o heap.o heap.c cc -c -pipe -Os -w -DNDEBUG -I. -o parser.o parser.c cc -c -pipe -Os -w -DNDEBUG -I. -o lexer.o lexer.c c++ -headerpad_max_install_names -o sip main.o transform.o gencode.o export.o heap.o parser.o lexer.o cc -c -pipe -fPIC -Os -w -DNDEBUG -I. -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -o siplib.o siplib.c siplib.c: In function ‘sip_api_is_py_method’: siplib.c:6062: error: ‘cls’ undeclared (first use in this function) siplib.c:6062: error: (Each undeclared identifier is reported only once siplib.c:6062: error: for each function it appears in.) make[1]: *** [siplib.o] Error 1 make: *** [all] Error 2 LittleMac:sip-4.9.1-snapshot-20090929 melton$ Environment: Mac OS X 10.5.8 Intel Python 2.6.2 Let me know if you need more info. Whoops - will be fixed tonight. Thanks, Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Need a recipe for building
On Tue, 29 Sep 2009 16:52:04 -0600, Brian Brown r...@techgame.net wrote: Hello folks! I'm yet another Snow Leopard user and I'm trying to get 4.6 going (I'm a commercial PyQt user). From a starting place, I'm confused as to what I should be using. - The Qt 4.6 technology preview (tp1), or get a particular version from their repository? PyQt never supports unreleased versions of Qt. The PyQt version number and the Qt version number are completely unrelated. - If you just check out the trunk, it claims to be 4.7 and doesn't work at all - The 4.9 sip release or current snapshot? - The 4.6 PyQt release or current snapshot? If none of this is supported or possible under snow leopard I would expect to see that on the web site or in a README or something. If there is a method of getting this going, could someone put it on the wiki? I'm trying to build it as 32-bit and so am using arch of i386 - I've read the list archives and seen various suggestions to get this to work, and I've tried many of them. Qt itself builds and works just fine, but I currently get the following with Qt 4.6 tp1, Release 4.6 PyQt and Release 4.9 sip. http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#configuring-sip-and-pyqt-for-macos-10-6-snow-leopard Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Need a recipe for building
On Sep 30, 2009, at 1:58 AM, Phil Thompson wrote: http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#configuring-sip-and-pyqt-for-macos-10-6-snow-leopard This is exactly what I did to product the error in the first message: For Sip: python ./configure.py --arch=i386 For PyQt: python ./configure.py --use-arch=i386 ... which is what is frustrating. This should work, I think. - Brian Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] How: more images in Graphics View
Dear reader, i recently started to develop an application in python using pyqt4 as my first project in python. this app when feature complete should allow to annotate photographic images with year, author, occasion, ... right now i do some experiments on how to implement certain features. as my research in the reference and div. other internet platforms did not yield any usable result i would like to ask you. one of these tests deals with loading and displaying multiple images in the program window. is it possible to use QGraphicsScene and QGraphicsView for this job? I tried to add images as Items to a Scene. but the only thing i can see is the last image i added (even without list[-1]). I also tried to use lists of Items, however it is not possible to add such list to a Scene. The following code is the result of what i got so far: import sys from PyQt4 import QtGui, QtCore from set_widget_pos_graphicslayout import Ui_MainWindow class StartGui (QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.pixmp=QtGui.QPixmap() self.pixitem=QtGui.QGraphicsPixmapItem() self.scene=QtGui.QGraphicsScene() self.grview=QtGui.QGraphicsView(self.ui.centralwidget) self.grali=[] QtCore.QObject.connect(self.ui.loadButton,QtCore.SIGNAL(clicked()),self.addIm) def addIm(self): fileName = QtGui.QFileDialog.getOpenFileName(self, Open Image, /home/jos/Fotos, Image Files (*.png *.jpg *.bmp)); if fileName: self.pixmp.load(fileName) klbild=self.pixmp.scaledToHeight(200) self.pixitem.setPixmap(klbild) self.grali.append(self.pixitem) self.scene.addItem(self.grali[-1]) # dirty: no progress, just to have a working code using a list (i did not want to rewrite the code to get rid of the list) self.grview.setScene(self.scene) self.grview.show() if __name__ == __main__: app = QtGui.QApplication(sys.argv) myapp = StartGui() myapp.show() sys.exit(app.exec_()) -- end code -- i am looking forward to your advice, many thanks in advance kind regards Jo -- View this message in context: http://www.nabble.com/How%3A-more-images-in-Graphics-View-tp25685137p25685137.html Sent from the PyQt mailing list archive at Nabble.com. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Semi-transparent QDrag pixmap
Is there any way to make the pixmap on a QDrag object be semi-transparent? Here is the code I've got right now: def startDrag(self, supportedActions): drag = QDrag(self) pixmap = QPixmap(/path/to/my/image.png) alphaChannel = QPixmap(pixmap.width(), pixmap.height()) alphaChannel.fill(QColor(128, 128, 128)) pixmap.setAlphaChannel(alphaChannel) drag.setPixmap(pixmap) drag.exec_(supportedActions) However, setting the alpha channel on the pixmap just makes it look faded, but doesn't actually show the window contents underneath the pixmap, so it's not really transparent. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] How: more images in Graphics View
Am Mittwoch 30 September 2009 schrieb p_tierchen: Dear reader, i recently started to develop an application in python using pyqt4 as my first project in python. this app when feature complete should allow to annotate photographic images with year, author, occasion, ... right now i do some experiments on how to implement certain features. as my research in the reference and div. other internet platforms did not yield any usable result i would like to ask you. one of these tests deals with loading and displaying multiple images in the program window. is it possible to use QGraphicsScene and QGraphicsView for this job? I tried to add images as Items to a Scene. but the only thing i can see is the last image i added (even without list[-1]). I also tried to use lists of Items, however it is not possible to add such list to a Scene. Well, from a cursory look, you're adding just one QGraphicsPixmapItem() to the scene. While I didn't used any QGraphicsView() before, Qt tend to attach great importance to parent child relationship, e.g. add QGraphicsPixmapItem()s with the view as parent, then this ought to be enough to keep your objects alive. Good luck, Pete The following code is the result of what i got so far: import sys from PyQt4 import QtGui, QtCore from set_widget_pos_graphicslayout import Ui_MainWindow class StartGui (QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.pixmp=QtGui.QPixmap() self.pixitem=QtGui.QGraphicsPixmapItem() self.scene=QtGui.QGraphicsScene() self.grview=QtGui.QGraphicsView(self.ui.centralwidget) self.grali=[] QtCore.QObject.connect(self.ui.loadButton,QtCore.SIGNAL(clicked()),self .addIm) def addIm(self): fileName = QtGui.QFileDialog.getOpenFileName(self, Open Image, /home/jos/Fotos, Image Files (*.png *.jpg *.bmp)); if fileName: self.pixmp.load(fileName) klbild=self.pixmp.scaledToHeight(200) self.pixitem.setPixmap(klbild) self.grali.append(self.pixitem) self.scene.addItem(self.grali[-1]) # dirty: no progress, just to have a working code using a list (i did not want to rewrite the code to get rid of the list) self.grview.setScene(self.scene) self.grview.show() if __name__ == __main__: app = QtGui.QApplication(sys.argv) myapp = StartGui() myapp.show() sys.exit(app.exec_()) -- end code -- i am looking forward to your advice, many thanks in advance kind regards Jo ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Need a recipe for building
On Wed, 30 Sep 2009 10:05:40 -0600, Brian Brown r...@techgame.net wrote: On Sep 30, 2009, at 1:58 AM, Phil Thompson wrote: http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#configuring-sip-and-pyqt-for-macos-10-6-snow-leopard This is exactly what I did to product the error in the first message: For Sip: python ./configure.py --arch=i386 For PyQt: python ./configure.py --use-arch=i386 ... which is what is frustrating. This should work, I think. And you also said you were using an unsupported version of Qt. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Need a recipe for building
On Sep 30, 2009, at 1:54 PM, Phil Thompson wrote: And you also said you were using an unsupported version of Qt. So PyQT 4.6 is for version 4.5.4 or Qt? or just the latest stable version of Qt? ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Form/dialog without title bar and actions buttons
Hi Pete, first of all thank you for your anwser. I'm doing a point of sale in PyQt, one of the goals it to work in touch screen devices, for my experience with other software it can't have minime, maximize, etc. buttons, the title bar is also useless. You give the clue, I'm following. Thanks. Regards, Jorge On Monday 28 September 2009 21:42:19 Hans-Peter Jansen wrote: Am Montag 28 September 2009 schrieb zorze: Hi, I'm a newbee in Qt/PyQt but I'm starting to use it. Welcome to the PyQt wonderlands ;-) The first problem that I need to solve is how to remove the title bar from a Dialog/MainWindow? Could you be more specific about your goals? Are you really after the effects of killall $WINDOWMANAGER? Without title bars, users usually cannot resize nor move their windows! Anyway, programmatically, you can play with QWidget.setWindowFlags(...). Real fun starts with sticky windows, skipping taskbars and pagers, title bars without close/min/max buttons and the like.. Enjoy, Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Need a recipe for building
On Sep 30, 2009, at 2:43 PM, Phil Thompson wrote: For all stable releases of Qt. Ok, thanks Phil. I was able to install the stable Qt 4.5.2 on Snow Leopard by installing the packages individually and not installing examples, which is what is breaking their installer on 10.6. Then sip and PyQt installed as expected with the arch flags. Cheers, - Brian ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Form/dialog without title bar and actions buttons
Am Mittwoch 30 September 2009 schrieb zorze: Hi Pete, first of all thank you for your anwser. I'm doing a point of sale in PyQt, one of the goals it to work in touch screen devices, for my experience with other software it can't have minime, maximize, etc. buttons, the title bar is also useless. Ahh, I see. You give the clue, I'm following. Did that already: QWidget.setWindowFlags(...) and also search for Qt::WindowFlags in assistant. Basically, you flag your windows special and hope, that the windowmanager does, what you want.. Since all that is nearly unpossible to predict for all permutations of available window managers and possible flags, you need to experiment. If you can take the woes of window placing yourself, use Qt.FramelessWindowHint, otherwise you may want to try combinations of various hints with Qt.CustomizeWindowHint. If you REALLY need more esoteric behavior, I did some hacking with ctypes calling into xlibs directly. Hmm, admitted, one cannot get much dirtier, even on purpose.. Hth, Pete Thanks. Regards, Jorge On Monday 28 September 2009 21:42:19 Hans-Peter Jansen wrote: Am Montag 28 September 2009 schrieb zorze: Hi, I'm a newbee in Qt/PyQt but I'm starting to use it. Welcome to the PyQt wonderlands ;-) The first problem that I need to solve is how to remove the title bar from a Dialog/MainWindow? Could you be more specific about your goals? Are you really after the effects of killall $WINDOWMANAGER? Without title bars, users usually cannot resize nor move their windows! Anyway, programmatically, you can play with QWidget.setWindowFlags(...). Real fun starts with sticky windows, skipping taskbars and pagers, title bars without close/min/max buttons and the like.. Enjoy, Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Question regarding single model and multiple views...
Hello, I am new(ish) to PyQt and I am trying to build a simple app. The app has several tables that I want to point to a single model (which will load and store all the data). Each table is responsible for displaying a different set of columns from the model. I.e. table 1 will show columns 1-4, table 2 columns 5-11, etc... The app does not know how many tables there will be ahead of time, nor does it know how many columns will be displayed in each table. Both of these are set by reading a config file. I have a version working where I use a QTableWidget and manually sync the data from the model (not actually a subclass of QAbstractTableModel). But there are some issues with this and, anyway, it isn't the correct way of working as far as I can tell. I really want to update the app to use the QAbstractTableModel (no delegates). I mostly understand the process and am pretty far along with one exception. How do I translate the actual column index in the table to the associated index in the model. I.e. if the user updates a cell in column 3 of the 2nd table, that might actually be a bit of data that is in column 7 of the model. I need to be able to map the table column to the model column and vice versa. So I am wondering, is there some way the table view can send along an offset every time it tries to send data to or from the model? If I can get that info, I can always translate inside the model and return/set the correct data. Thanks. -- View this message in context: http://www.nabble.com/Question-regarding-single-model-and-multiple-views...-tp25691301p25691301.html Sent from the PyQt mailing list archive at Nabble.com. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Question regarding single model and multiple views...
On Wednesday 30 September 2009 17:08:40 bvz wrote: Hello, I am new(ish) to PyQt and I am trying to build a simple app. The app has several tables that I want to point to a single model (which will load and store all the data). Each table is responsible for displaying a different set of columns from the model. I.e. table 1 will show columns 1-4, table 2 columns 5-11, etc... The app does not know how many tables there will be ahead of time, nor does it know how many columns will be displayed in each table. Both of these are set by reading a config file. I have a version working where I use a QTableWidget and manually sync the data from the model (not actually a subclass of QAbstractTableModel). But there are some issues with this and, anyway, it isn't the correct way of working as far as I can tell. I really want to update the app to use the QAbstractTableModel (no delegates). I mostly understand the process and am pretty far along with one exception. How do I translate the actual column index in the table to the associated index in the model. I.e. if the user updates a cell in column 3 of the 2nd table, that might actually be a bit of data that is in column 7 of the model. I need to be able to map the table column to the model column and vice versa. So I am wondering, is there some way the table view can send along an offset every time it tries to send data to or from the model? If I can get that info, I can always translate inside the model and return/set the correct data. Thanks. The indexes should always match up. Just use QTableView::setColumnHidden to hide the columns that aren't needed for each view. If for some reason that didn't work it would be somewhat trivial to write a wrapper model that simply provides a subset of the real model. Something like QSortFilterProxyModel, only a much simpler implementation as the mapping is always a constant operation. Matt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] GraphicsItem, QObject Inheritance problem
I am working on a hacked PyQt to play with the new animation features. So this isn't entirely kosher, however. I have the following: class AffineItem(QGraphicsItem): def __init__(self, ..., parent): QGraphicsItem.__init__(self, parent) class WrappedAffineItem(QObject, AffineItem): def __init__(self ...): QObject.__init__(self) AffineItem.__init__(self, ..., parent) The WrappedAffineItem needs to declare properties, so I have to inherit QObject. Here is the traceback of what I am getting: Traceback (most recent call last): i = WrappedAffineTextItem(text, ..., self.items['clipItem']) File C:\Qt\PyQt-win-gpl-4.5.2\Plaza.py in __init__ AffineTextItem.__init__(self, '', font, brush, parent) File C:\Qt\PyQt-win-gpl-4.5.2\Plaza.py, line 8, in __init__ QGraphicsItem.__init__(self, parent) TypeError: argument 1 of PyQt4.QtCore.QObject() has an invalid type Help? Thanks! ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Question regarding single model and multiple views...
Thanks for the quick reply. I was considering that (hiding columns) but that seems really really inefficient. There could be as many as 25 tables with 7-8 columns each (but not much data... rarely more than 20 rows). Hiding columns would mean a lot of duplicated info... scratches head ...unless QT is smart enough not to populate the hidden columns? That actually sounds like it could be the case here. Hmmm. Your other suggestion to write a wrapper has me a little confused. My data model already has the smarts to do all the filtering, it just doesn't know what table is requesting it. I don't understand how wrapping it in anything gets me any additional info. I was considering subClassing QTableView and overriding the setData and data methods. But of course that is just a lot of big talk from a small guy... I don't know what the implications of doing something like that are. Matt Newell wrote: On Wednesday 30 September 2009 17:08:40 bvz wrote: Hello, I am new(ish) to PyQt and I am trying to build a simple app. The app has several tables that I want to point to a single model (which will load and store all the data). Each table is responsible for displaying a different set of columns from the model. I.e. table 1 will show columns 1-4, table 2 columns 5-11, etc... The app does not know how many tables there will be ahead of time, nor does it know how many columns will be displayed in each table. Both of these are set by reading a config file. I have a version working where I use a QTableWidget and manually sync the data from the model (not actually a subclass of QAbstractTableModel). But there are some issues with this and, anyway, it isn't the correct way of working as far as I can tell. I really want to update the app to use the QAbstractTableModel (no delegates). I mostly understand the process and am pretty far along with one exception. How do I translate the actual column index in the table to the associated index in the model. I.e. if the user updates a cell in column 3 of the 2nd table, that might actually be a bit of data that is in column 7 of the model. I need to be able to map the table column to the model column and vice versa. So I am wondering, is there some way the table view can send along an offset every time it tries to send data to or from the model? If I can get that info, I can always translate inside the model and return/set the correct data. Thanks. The indexes should always match up. Just use QTableView::setColumnHidden to hide the columns that aren't needed for each view. If for some reason that didn't work it would be somewhat trivial to write a wrapper model that simply provides a subset of the real model. Something like QSortFilterProxyModel, only a much simpler implementation as the mapping is always a constant operation. Matt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- View this message in context: http://www.nabble.com/Question-regarding-single-model-and-multiple-views...-tp25691301p25692011.html Sent from the PyQt mailing list archive at Nabble.com. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Question regarding single model and multiple views...
On Wednesday 30 September 2009 18:51:39 bvz wrote: Thanks for the quick reply. I was considering that (hiding columns) but that seems really really inefficient. There could be as many as 25 tables with 7-8 columns each (but not much data... rarely more than 20 rows). Hiding columns would mean a lot of duplicated info... scratches head ...unless QT is smart enough not to populate the hidden columns? That actually sounds like it could be the case here. Hmmm. It's not inefficient at all. I'm pretty sure that none of the item views in qt would be asking for any data from the model for any hidden columns or rows. No info would be duplicated because the views don't store any data, they retrieve the data from the model on demand. Your other suggestion to write a wrapper has me a little confused. My data model already has the smarts to do all the filtering, it just doesn't know what table is requesting it. I don't understand how wrapping it in anything gets me any additional info. The wrapper would simply make the existing model appear to only have the columns that each view desires. So you would have an instance per view. Since it would only be passing on calls for data after mapping the QModelIndex, it wouldn't duplicate data or have much overhead. This isn't needed though if you simple need to hide columns, as QTreeView and QTableView both support that fine. That's the very design of those classes, to show what columns you want, in what order you want. Matt ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt