Re: [PyQt] Basic 3D Viewer
Here's my own open source project built with pyopengl and pyqt. http://code.google.com/p/ice-cache-explorer/ Hope it helps. -mab "The world goin' one way, people another!" - Poot > From: da...@boddie.org.uk > To: pyqt@riverbankcomputing.com > Date: Mon, 30 May 2011 22:04:06 +0200 > Subject: Re: [PyQt] Basic 3D Viewer > > On Mon May 30 20:04:16 BST 2011, Knacktus wrote: > > > I need to evaluate the options for building a basic 3D viewer with PyQt. > > The scenes are static, but quite large (some hundreds medium complex > > (~500 triangles) objects). Show/Hide objects, rotate, drag, zoom, change > > colors and some other basic operations need to be available. > > > > Currently, I've got some very coarse understanding of OpenGL and > > scenegraphs, but cannot really grasp the complexitiy of the topic. > > It might be worth experimenting with the PyQt OpenGL examples to get a feel > for the subject, but it will be a steep learning curve to go from there to > writing a 3D editor, I think. > > > Can anyone comment on the complexity of building it from scratch? I'm > > looking for some directions, best practices. E.g., do PyOpenGL and PyQt > > play together? > > Yes, you need to create the rendering context using PyQt then use PyOpenGL > for the rendering. There are examples supplied with PyQt that do this. > > > Also, are there some higher level scenegraph libs (or bindings) or 3D > > engines (CAD engine) compatible with PyQt that could be usefull? > > Take a look at this page for suggestions: > > http://www.diotavelli.net/PyQtWiki/Third_Party_Packages_and_Modules > > Building on top of Coin3D is an option you might want to explore. There are > probably other solutions out there as well. > > David > ___ > 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] Basic 3D Viewer
On Mon May 30 20:04:16 BST 2011, Knacktus wrote: > I need to evaluate the options for building a basic 3D viewer with PyQt. > The scenes are static, but quite large (some hundreds medium complex > (~500 triangles) objects). Show/Hide objects, rotate, drag, zoom, change > colors and some other basic operations need to be available. > > Currently, I've got some very coarse understanding of OpenGL and > scenegraphs, but cannot really grasp the complexitiy of the topic. It might be worth experimenting with the PyQt OpenGL examples to get a feel for the subject, but it will be a steep learning curve to go from there to writing a 3D editor, I think. > Can anyone comment on the complexity of building it from scratch? I'm > looking for some directions, best practices. E.g., do PyOpenGL and PyQt > play together? Yes, you need to create the rendering context using PyQt then use PyOpenGL for the rendering. There are examples supplied with PyQt that do this. > Also, are there some higher level scenegraph libs (or bindings) or 3D > engines (CAD engine) compatible with PyQt that could be usefull? Take a look at this page for suggestions: http://www.diotavelli.net/PyQtWiki/Third_Party_Packages_and_Modules Building on top of Coin3D is an option you might want to explore. There are probably other solutions out there as well. David ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Basic 3D Viewer
Hi guys, I need to evaluate the options for building a basic 3D viewer with PyQt. The scenes are static, but quite large (some hundreds medium complex (~500 triangles) objects). Show/Hide objects, rotate, drag, zoom, change colors and some other basic operations need to be available. Currently, I've got some very coarse understanding of OpenGL and scenegraphs, but cannot really grasp the complexitiy of the topic. Can anyone comment on the complexity of building it from scratch? I'm looking for some directions, best practices. E.g., do PyOpenGL and PyQt play together? Also, are there some higher level scenegraph libs (or bindings) or 3D engines (CAD engine) compatible with PyQt that could be usefull? Cheers, Jan ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Maintaining index after sort
On 29.05.11 15:06:17, Marc Rossi wrote: > Thanks for the reply. There must be some core concept of Qt/Model-View > programming I am just missing. > > Makes sense that I can store the data keyed by symbol in the model and > update it that way, but I thought I had to emit a dataChanged signal for the > view to update as shown below: > > self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"), > self.index(index.row(), COL1), self.index(index.row(), COL5)) > > Doing it this way required me to have the index for the column I wanted > refreshed. I see there is a 'match()' function in the QAbstractItemModel > class but when I tried that (calling match for every update) things were > ridiculously slow. Hmm, I don't have that much experience with sorting without a proxy model between the real one and the view, but if the model does not get notified about changes in its indexes then that sounds like a there's a bug somewhere. Andreas ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] jpeg plugin not loading
Hello, I have the same issue as described below and copying qt.conf into c:\python27 solved the problem. This is from a fresh windows install using the 4.8.4 binary installer. Is there some reason this file isn't being copied to its correct location? Luke On Thu, Oct 23, 2008 at 12:16, Phil Thompson wrote: > >> On Thu, 16 Oct 2008 08:02:11 -0400, Doug Bell wrote: > >> > Hi, > >> > > >> > The plugin for jpeg image support is not loading on my windows > >> > installation of PyQt (from the 4.4.3-1 binary installer). Jpeg images > >> > don't show up in a QTextBrowser and jpeg isn't listed as one of the > >> > supported formats in QImageReader.supportedImageFormats(). [snip] > > Does the qt.conf file that should be installed in the Python directory look > Ok? > > Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] stand alone QFileDialog
Hello Janwillem, there is nothing wrong with your setup. It is caused by a bug which was undiscovered for years. Congratulations :-)) It has been fixed for all eric4 variants and eric5 5.1 and pushed to the sourcecode repo. It will be included in the next releases. Detlev On Montag, 30. Mai 2011, Janwillem van Dijk wrote: > Thanks, can it than be that there is something wrong with my debug > settings? I also still have that problem (see 6 April 2011) that when > debuging with Python3 a run time error generates the familiar error with > the correct line number but opens a new tab called and creates a > file called in my home directory (both including the <>). > Debugging with 2.7 does not raise that problem. An example: > number = 5 > print('divide by 1: %d' % (number // 1)) > print('divide by 0: %d' % (number // 0)) > print('finished') > Although a bit large I attached my ini file for using Python3. > > On 05/30/2011 10:23 AM, Detlev Offenbach wrote: > > On Sonntag, 29. Mai 2011, Janwillem van Dijk wrote: > >> Thanks for paying attention to my question. It was about as far as I > >> could get. The example below I made (unfortunaly more based on intuition > >> than understanding) works when called from the command line. However, > >> when called from inside the Eric5 IDE the dialog returns the results but > >> hangs. This made me think my solution is incorrect. > > > > I just tested your script in eric5 and it works ok. I could not observe > > your issue. > > > >> Any comments very welcome, cheers! > >> > >> def open_files(default_dir=None): > >> """Returns list of filenames optionally given a default dir""" > >> from sys import argv > >> from os import environ > >> from PyQt4.QtGui import QApplication, QFileDialog > >> > >> if default_dir == None: > >> default_dir = environ['HOME'] > >> > >> app = QApplication(argv) > >> filenames = QFileDialog.getOpenFileNames(directory=default_dir) > >> app.exit() > >> return list(filenames) > >> > >> if __name__ == '__main__': > >> print('open dialog') > >> lst = open_files() > >> print('dialog finished') > >> > >> for fname in lst: > >> print(fname) > >> > >> for completeness the TkInter version that does work both from the > >> commandline and from Eric5: > >> > >> def open_files(default_dir=None): > >> """Returns list of filenames+paths given default dir""" > >> from os import environ > >> from Tkinter import Tk > >> import tkFileDialog > >> > >> if default_dir == None: > >> default_dir = environ['HOME'] > >> > >> root = Tk() > >> root.withdraw() # Hide root window > >> filenames = tkFileDialog.askopenfilenames(initialdir=default_dir, > >> > >> multiple=True) > >> > >> return list(filenames) > >> > >> if __name__ == '__main__': > >> print('open dialog') > >> lst = open_files() > >> print('dialog finished') > >> > >> for fname in lst: > >> print(fname) > >> > >> On 05/27/2011 10:53 AM, Wilbert Berendsen wrote: > >>> Op woensdag 11 mei 2011 schreef Janwillem: > Is there for opening a file in a non-qui script a PqQt4 equivalent for > the TkInter based function below? > >>> > >>> look for QFileDialog. > >>> http://doc.trolltech.com/4.7/qfiledialog.html and > >>> http://www.riverbankcomputing.com/static/Docs/PyQt4/html/python_v3.html > >>> #q filedialog > >>> > >>> w best regards, > >>> Wilbert Berendsen > >> > >> ___ > >> PyQt mailing listPyQt@riverbankcomputing.com > >> http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- Detlev Offenbach det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] stand alone QFileDialog
On Sonntag, 29. Mai 2011, Janwillem van Dijk wrote: > Thanks for paying attention to my question. It was about as far as I > could get. The example below I made (unfortunaly more based on intuition > than understanding) works when called from the command line. However, > when called from inside the Eric5 IDE the dialog returns the results but > hangs. This made me think my solution is incorrect. I just tested your script in eric5 and it works ok. I could not observe your issue. > > Any comments very welcome, cheers! > > def open_files(default_dir=None): > """Returns list of filenames optionally given a default dir""" > from sys import argv > from os import environ > from PyQt4.QtGui import QApplication, QFileDialog > if default_dir == None: > default_dir = environ['HOME'] > app = QApplication(argv) > filenames = QFileDialog.getOpenFileNames(directory=default_dir) > app.exit() > return list(filenames) > > if __name__ == '__main__': > print('open dialog') > lst = open_files() > print('dialog finished') > for fname in lst: > print(fname) > > for completeness the TkInter version that does work both from the > commandline and from Eric5: > def open_files(default_dir=None): > """Returns list of filenames+paths given default dir""" > from os import environ > from Tkinter import Tk > import tkFileDialog > if default_dir == None: > default_dir = environ['HOME'] > root = Tk() > root.withdraw() # Hide root window > filenames = tkFileDialog.askopenfilenames(initialdir=default_dir, > multiple=True) > return list(filenames) > > if __name__ == '__main__': > print('open dialog') > lst = open_files() > print('dialog finished') > for fname in lst: > print(fname) > > On 05/27/2011 10:53 AM, Wilbert Berendsen wrote: > > Op woensdag 11 mei 2011 schreef Janwillem: > >> Is there for opening a file in a non-qui script a PqQt4 equivalent for > >> the TkInter based function below? > > > > look for QFileDialog. > > http://doc.trolltech.com/4.7/qfiledialog.html and > > http://www.riverbankcomputing.com/static/Docs/PyQt4/html/python_v3.html#q > > filedialog > > > > w best regards, > > Wilbert Berendsen > > ___ > PyQt mailing listPyQt@riverbankcomputing.com > http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- Detlev Offenbach det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt