[PyKDE] QLabel flashes on setPixmap
I'm building an application where a cutaway view of the human body has various organ systems coded by color. This is a single raster image, displayed using a QLabel with a pixmap. I want to perform simple operations: changing colors of the organs when the user selects a different data set, and scaling the image when the size of the main application window changes. I retain a high-resolution QImage as self.masterImage, scaling it when the main window size changes. I maintain a lower-resolution QImage as well because the more common operation will be changing the image palette and converting it to a pixmap, and I don't want the performance overhead of rescaling the image (from the high-resolution master) every time the palette changes. So far things work pretty satisfactorily (I haven't yet added the palette changing), but the QLabel flashes in a distracting fashion whenever I call setPixmap. Going to a double-buffered QCanvas seems like overkill for my problem; I really only want to display/update this single graphic. How would I go about eliminating the flashing? I've read a bit about eliminating flashing in custom widgets with double buffering, but this is a stock Qt widget and I was surprised that updating its pixmap was so visually jarring. def slotUpdateImage(self): x, y = self.masterImage.width(), self.masterImage.height() if not hasattr(self, 'currentImage'): self.scaledImage = self.masterImage.scale(x * (float(self.controlframe.height()) / y), self.controlframe.height()) self.currentImage = QPixmap() elif self.controlframe.height() != self.oldHeight: self.scaledImage = self.masterImage.scale(x * (float(self.controlframe.height()) / y), self.controlframe.height()) self.oldHeight = self.controlframe.height() self.currentImage.convertFromImage(self.scaledImage) self.skellabel.setPixmap(self.currentImage) ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QScintilla for windows
On Sunday 18 April 2004 1:39 am, Dianhong wrote: Hi, I just bought a BlackAdder personal edition, which includes pyQt, qt, sip, but it does not include QScintilla, which is needed for eric3. So can anyone be kind tell me how to build and install Build and install QScintilla for windows? You have to buy the commercial versions of Qt and PyQt. Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Eric questions
Hi, Thanks for help concerning cvs handling. I nearly succeed in creating my new cvs base threw eric interface! I have created the cvs repository successfuly and correctly imported my sources files as root user. Now, I've just a little problem of permissions when trying to import this project from the repository, for a non-root user. I have done as follow: Project - Version Control...- New from repository and I gave the correct path for cvs repository and archive name ('clim_project' in my case) Then I obtain the following error in a two part window : cvs -f -d /usr/local/cvsroot/ checkout -r clim_project clim_project *** cvs checkout: failed to create lock directory for `/usr/local/cvsroot/clim_project' (/usr/local/cvsroot/clim_project/#cvs.lock): Permission denied cvs checkout: failed to obtain dir lock in repository `/usr/local/cvsroot/clim_project' cvs [checkout aborted]: read lock failed - giving up I believe this is mostly a cvs question, but what must I do to obtain permissions for a non root user? Regards. ++ Jul. Detlev Offenbach wrote: hi, Am Samstag, 10. April 2004 18:23 schrieb jul: 3) Is anyone have used the CVS functionnalities of eric (Project Menu - Version Control) ? I'm very interessed by this function, but I have no idea make it work with eric3. Is there any doc somewhere ? Unfortunately user documentation is eric's weak point. Any help in this area is welcome. To create a new project select Project-Version Control-New from repository... and enter the relevant info into the dialog. Use the What's this help for further infos. ...-Add to repository adds a local project to the repository. If you create a new local project, you have the option to place it into the repository as well (see checkboy in the new project dialog). The other menu entries should be fairly self explanatory. To add a project file to the repository just bring up the context menu for this file in the project sources browser (or one of the others) and select 'Add to repository'. Regards Detlev ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] Eric questions
Hi, Am Sonntag, 18. April 2004 22:24 schrieb jul: Hi, Thanks for help concerning cvs handling. I nearly succeed in creating my new cvs base threw eric interface! I have created the cvs repository successfuly and correctly imported my sources files as root user. Now, I've just a little problem of permissions when trying to import this project from the repository, for a non-root user. I have done as follow: Project - Version Control...- New from repository and I gave the correct path for cvs repository and archive name ('clim_project' in my case) Then I obtain the following error in a two part window : cvs -f -d /usr/local/cvsroot/ checkout -r clim_project clim_project *** cvs checkout: failed to create lock directory for `/usr/local/cvsroot/clim_project' (/usr/local/cvsroot/clim_project/#cvs.lock): Permission denied cvs checkout: failed to obtain dir lock in repository `/usr/local/cvsroot/clim_project' cvs [checkout aborted]: read lock failed - giving up I believe this is mostly a cvs question, but what must I do to obtain permissions for a non root user? Indeed, this is a cvs question. You should make sure, that the repository is owned by the group of the developers and that it has write permission for the group. Regards. ++ Jul. Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] segfault with pyqt sip latest snapshots
I had this problem but with a different version of both. I found that removing and rebuilding and reinstalling both solved this problem. I don't know why the problem occured though. The second time i didn't use any build options at all, just python build.py How exactly did you remove the installed stuff - is there a make target? Regards, Diez ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] QSettings problem
Hi, I'm trying to use QSettings.setPath method for configuring my application but it seems to be completely ignored. For instance, this simple script: -- #!/usr/bin/env python from qt import * c = QSettings() c.setPath('MyCompany.com', 'MyApplication') c.writeEntry('/Look/currentStyle', 'Platinum') -- creates the file $HOME/.qt/lookrc with content: [General] CurrentStyle=Windows If I add a search path with insertSearchPath, let's say $HOME/test, then I get a $HOME/test/lookrc file, with the same content as before I've revised this mailing list archives looking for a solution, but with no success. What I'm doing wrong? Thanks in advance for your help. -- Share what you know, learn what you don't pgp0.pgp Description: signature
[PyKDE] QSettings problem (II)
Ooops! I'm running a Linux box with Python 2.3.3 Qt 3.2.3 PyQt 3.10 SIP 4.0rc2 -- Share what you know, learn what you don't pgp0.pgp Description: signature
Re: [PyKDE] QSettings problem
On Sunday 18 April 2004 8:55 pm, Vicent Mas wrote: Hi, I'm trying to use QSettings.setPath method for configuring my application but it seems to be completely ignored. For instance, this simple script: -- #!/usr/bin/env python from qt import * c = QSettings() c.setPath('MyCompany.com', 'MyApplication') c.writeEntry('/Look/currentStyle', 'Platinum') -- What does writeEntry() return? creates the file $HOME/.qt/lookrc with content: [General] CurrentStyle=Windows If I add a search path with insertSearchPath, let's say $HOME/test, then I get a $HOME/test/lookrc file, with the same content as before Are you sure? CurrentStyle != currentStyle. I've revised this mailing list archives looking for a solution, but with no success. What I'm doing wrong? Thanks in advance for your help. Most likely the user doesn't have permissions on the global settings. Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] ListViewItem/setStyle segfault
This only seems to occur when trying to switch styles to plastik, but not in the C++ Qt. Crashing/segfaulting code (requires plastik): import sys from qt import * def main(args): app = QApplication(args) listview = QListView() app.setMainWidget(listview) listview.addColumn(A column) item= QListViewItem(listview, An item) subitem = QListViewItem(item, A subitem) item.setOpen(True) listview.show() app.setStyle(plastik) app.exec_loop() main(sys.argv) Part of the GDB output for python crash.py Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 17486)] 0x4114b251 in QGList::find(void*, bool) (this=0x81bfe60, d=0x41736204, fromStart=true) at tools/qglist.cpp:751 751 tools/qglist.cpp: No such file or directory. in tools/qglist.cpp Non-crashing C++ code (is this equivalent?): #include qapplication.h #include qlistview.h int main(int argc, char **argv) { QApplication *a = new QApplication(argc, argv); QListView *listview = new QListView(); a-setMainWidget(listview); qlv-addColumn(A column); QListViewItem *item = new QListViewItem(listview,An item); QListViewItem *subitem = new QListViewItem(item, A subitem); item-setOpen(TRUE); listview-show(); a-setStyle(plastik); return a-exec(); } Environment: PyQt: 3.11 PyKDE: not installed SIP: 4.0_rc3 KDE: 3.2.1 Qt: 3.3.0 Moving the app.setStyle to the top avoids the crash. So does changing the argument to something other than plastik. The crash only occurs when the program exits. Removing setOpen() avoids the crash, so does calling setOpen(False) before setStyle is called. Does this look like a PyQt problem or a Qt/KDE/Plastik problem? -- Jason Lai smime.p7s Description: S/MIME Cryptographic Signature