pyqtGui
index
pyqtGui.py

Module containing the PyQt implementation for the GUI tutorial
 
COMMENTS:
=========
+ More complex widget creation; create a layout for parent widget,
  adding child widgets, but only if parent widget doesn't already have
  a layout (e.g., QHGroupBox)
+ 'Type-safe' signals/slots architecture not really taken advantage
  of in Python (maybe a new feature for pychecker? :)
+ Would be nice if QString's automagically converted to Python strings
+ Nice rich text widget, QTextView
+ Rich set of widgets overall: see QMainWindow for getting started
  (not used in the tutorial)
+ Easy image display (for simple image formats) using QPixmap and QLabel
 
IDIOMS:
=======
+ Create widgets with a parent and a label; add them to QHBoxLayout
  and QVBoxLayout via addWidget()
+ Resizing policy is achieved using the 'expand' flag on addWidget()
  PLUS the parent widget's sizing policy (either override sizePolicy() OR
  call 'setSizePolicy(QSizePolicy()) on parent widget directly)
+ QHBox and QVBox are widgets that auto-manage their children as they
  are created; use QHBoxLayout and QVBoxLayout as layout managers for parent
  widgets when more discrete layout manageement is required
+ Use 'show()' on top level widgets to display that level's hierarchy

 
Modules
            
oogui
os
qt

 
Classes
            
oogui.OOGui
PyQtGui(qt.QApplication, oogui.OOGui)
qt.QApplication(qt.QObject)
PyQtGui(qt.QApplication, oogui.OOGui)
qt.QVGroupBox(qt.QGroupBox)
DisplayFrame

 
class DisplayFrame(qt.QVGroupBox)
      Specialized scrolled frame that displays text and image files
 
  
__del__(self) from qt.Qt
__init__(self, w)
Creates the labeled frame that will contain the displayed file
_init(self, filename=None)
Manages the contained scrolled widget for every file display
binary(self, unused)
Resets/Clears the scrolled text and displays unavailable format
html(self, filename)
Displays the file with HTML fonts/formatting
image(self, filename)
Displays the image contained in filename
sizePolicy(self)
Override default sizing policy and let both dimensions expand
text(self, filename)
Displays the text of the specified file

 
class PyQtGui(qt.QApplication, oogui.OOGui)
      Specialization of OOGui that uses the PyQt widget set
 
  
__del__(self) from qt.Qt
__init__(self, argv, geometry=None, resfile=None, startdir=None)
Create the PyQt QApplication and OOGui base objects
_buildCWD(self)
Private method to construct the working directory frame
_buildGui(self, title)
Override parent's abstract 'hook' method called in ctor
_buildLists(self, w)
Create the frame that contains list of files and text entry
_buildPanes(self)
Build a PanedWidget with panes for lists and display views
_directorySelected(self, *unused) from oogui.OOGui
_displayBinary(self, filename)
Displays binary files in the way it thinks it should.
_displayHTML(self, filename)
Implemented behavior for displaying HTML files
_displayImage(self, filename)
Implemented behavior for displaying image files
_displayText(self, filename)
Implemented behavior for displaying text (other) files
_fileSelected(self, *unused) from oogui.OOGui
_getCurrentDirectory(self)
Returns the full pathname of the current working directory
_getEntries(self, cwd) from oogui.OOGui
_getSelectedDirectory(self)
Returns currently selected directory name
_getSelectedFile(self)
Returns currently selected file name
_getTopLevel(self)
Special access method used by base to ensure top level is created
_loadResources(self, resfile=None)
Load the resources (options) for all the 'named' widgets
_setCWD(self, cwd)
Updates the GUI by setting the current working directory to cwd
_setDirectory(self, *unused)
Slot for signal 'returnPressed' for entry text and for signal
'clicked' for GoTo button so user can enter full pathname to
specify a new working directory.
_setEntries(self)
Sets the names of files and directories in the lists for the
'current selected directory'
_setFile(self, *unused)
Slot for signal 'returnPressed' for entry text so user can enter
full pathname for a file to be displayed.
_setFilename(self, filename)
Sets the filename entry field when a file is selected; called
by base class's _fileSelected() method
_startGui(self, geometry=None)
Runs the application in the main event loop
sizePolicy(self)
Override default sizing policy and let both dimensions expand

 
Functions
            
_getLabeledFrame(w, label='', etchedBorder=0)
Utility function to create a labeled frame
_getLabeledList(w, label='', commandSlot=None)
Utility function to create an expanding listbox in labeled frame

 
Data
             _ANCHOR = <qt.QSizePolicy instance>
__file__ = r'http://www.metaslash.com/brochure/tutorial/pyqtGui.pyc'
__name__ = 'pyqtGui'