eric3.UI.Browser

Module implementing a browser with class browsing capabilities.

The class browsing part is based on IDLE's classbrowser.

Classes

Browser Class used to display a file system tree.
BrowserClass Class implementing a BrowserNode that represents a python class or function.
BrowserClassAttributes Class implementing a BrowserNode that represents the attributes of a python class.
BrowserDirectory Class implementing a BrowserNode that represents a directory.
BrowserFile Class implementing a BrowserNode that represents a file.
BrowserMethod Class implementing a BrowserNode that represents a python method.
BrowserNode Class implementing a thin wrapper around QListViewItem.
BrowserSysPath Class implementing a BrowserNode that represents the Python sys.path.

Functions

None

Browser

Class used to display a file system tree. Via the context menu that is displayed by a right click the user can select various actions on the selected file.

Signals

designerFile(string)
emitted to open a Qt-Designer file
linguistFile(string)
emitted to open a Qt-Linguist file
pixmapFile(string)
emitted to open a pixmap file
projectFile(string)
emitted to open an eric3 project file
pythonFile(string, int)
emitted to open a Python file at a line
unittestOpen(string)
emitted to open a Python file for a unittest

Derived from

QListView

Methods

Browser Constructor
contentsMouseDoubleClickEvent Protected method of QListView.
createPopupMenus Private method to generate the various popup menus.
getSelectedItems Public method to get the selected items.
getSelectedItemsCount Public method to get the count of items selcted.
handleContextMenu Private slot to show the context menu of the listview.
handleOpen Private slot to handle the open popup menu entry.
handlePreferencesChanged Public slot used to handle the preferencesChanged signal.
handleProgramChange Public slot to handle the programChange signal.
handleUnittest Private slot to handle the unittest popup menu entry.
refreshTree Private slot to refresh the tree.
wantedSelectedItem Private method to check type of a listview item.

Browser (Constructor)

Browser(parent=None)

Constructor

parent
parent widget (QWidget)

Browser.contentsMouseDoubleClickEvent

contentsMouseDoubleClickEvent(mouseEvent)

Protected method of QListView. Reimplemented to disable expanding/collapsing of items when double-clicking. Instead the double-clicked entry is opened.

mouseEvent
the mouse event (QMouseEvent)

Browser.createPopupMenus

createPopupMenus()

Private method to generate the various popup menus.

Browser.getSelectedItems

getSelectedItems(filter=None)

Public method to get the selected items.

filter
list of class to check against
Returns:
list of selected items (list of QListViewItem)

Browser.getSelectedItemsCount

getSelectedItemsCount(filter=None)

Public method to get the count of items selcted.

filter
list of class to check against
Returns:
count of items selected (integer)

Browser.handleContextMenu

handleContextMenu(itm, coord, col)

Private slot to show the context menu of the listview.

col
the column of the mouse pointer (int)
coord
the position of the mouse pointer (QPoint)
itm
the selected listview item (QListViewItem)

Browser.handleOpen

handleOpen()

Private slot to handle the open popup menu entry.

Browser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Browser.handleProgramChange

handleProgramChange(fn)

Public slot to handle the programChange signal.

Browser.handleUnittest

handleUnittest()

Private slot to handle the unittest popup menu entry.

Browser.refreshTree

refreshTree()

Private slot to refresh the tree. The tree is refreshed by closing all open items and reopening them.

Browser.wantedSelectedItem

wantedSelectedItem(itm, filter=None)

Private method to check type of a listview item.

filter
list of class to check against
itm
the listview item to check (QListViewItem)
Returns:
flag indicating item is a valid type (boolean)

Up

BrowserClass

Class implementing a BrowserNode that represents a python class or function.

Derived from

BrowserNode

Methods

BrowserClass Constructor
setOpen Public slot to set/reset the open state.

BrowserClass (Constructor)

BrowserClass(parent, cl, after, filename, isPublic=None)

Constructor

after
sibling this node is positioned after
cl
Class object to be shown
filename
filename of the file defining this class
isPublic
flag indicating visibility if not None. It is one of
parent
parent Browser or BrowserNode

BrowserClass.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up

BrowserClassAttributes

Class implementing a BrowserNode that represents the attributes of a python class.

Derived from

BrowserNode

Methods

BrowserClassAttributes Constructor
setOpen Public slot to set/reset the open state.

BrowserClassAttributes (Constructor)

BrowserClassAttributes(parent, after, attributes)

Constructor

after
sibling this node is positioned after
attributes
list of attribute names
parent
parent Browser or BrowserNode

BrowserClassAttributes.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up

BrowserDirectory

Class implementing a BrowserNode that represents a directory.

Derived from

BrowserNode

Methods

BrowserDirectory Constructor
fileName Public method returning the directory name of this node.
setOpen Public slot to set/reset the open state.

BrowserDirectory (Constructor)

BrowserDirectory(parent, dinfo, after, full=1, bold=0)

Constructor

after
sibling this node is positioned after
bold
flag indicating a highlighted display (boolean)
dinfo
dinfo is the string for the directory (string or QString)
full
flag indicating full pathname should be displayed (boolean)
parent
parent Browser or BrowserNode

BrowserDirectory.fileName

fileName()

Public method returning the directory name of this node.

Returns:
directory name (string)

BrowserDirectory.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up

BrowserFile

Class implementing a BrowserNode that represents a file.

Derived from

BrowserNode

Methods

BrowserFile Constructor
compare Private method to compare two items.
fileName Public method returning the filename.
isDesignerFile Public method to check, if this file is a Qt-Designer file.
isDesignerHeaderFile Public method to check, if this file is a Qt-Designer header file.
isIdlFile Public method to check, if this file is a CORBA IDL file.
isLinguistFile Public method to check, if this file is a Qt-Linguist.
isPixmapFile Public method to check, if this file is a pixmap file.
isProjectFile Public method to check, if this file is an eric3 project file.
isPythonFile Public method to check, if this file is a Python script.
setOpen Public slot to set/reset the open state.

BrowserFile (Constructor)

BrowserFile(parent, finfo, after, special=0, dtext=None, bold=0, isPyFile=0)

Constructor

after
sibling this node is positioned after
bold
flag indicating a highlighted display (boolean)
dtext
display text if special is set (string or QString)
finfo
the string for the file (string)
isPyFile
flag indicating that this is a Python file even if it doesn't have the .py extension (boolean)
parent
parent Browser or BrowserNode
special
flag indicating special treatment (boolean)

BrowserFile.compare

compare(item, col, ascending)

Private method to compare two items.

BrowserFile.fileName

fileName()

Public method returning the filename.

Returns:
filename (string)

BrowserFile.isDesignerFile

isDesignerFile()

Public method to check, if this file is a Qt-Designer file.

Returns:
flag indicating a Qt-Designer file (boolean)

BrowserFile.isDesignerHeaderFile

isDesignerHeaderFile()

Public method to check, if this file is a Qt-Designer header file.

Returns:
flag indicating a Qt-Designer header file (boolean)

BrowserFile.isIdlFile

isIdlFile()

Public method to check, if this file is a CORBA IDL file.

Returns:
flag indicating a CORBA IDL file (boolean)

BrowserFile.isLinguistFile

isLinguistFile()

Public method to check, if this file is a Qt-Linguist.

Returns:
flag indicating a Qt-Linguist file (boolean)

BrowserFile.isPixmapFile

isPixmapFile()

Public method to check, if this file is a pixmap file.

Returns:
flag indicating a pixmap file (boolean)

BrowserFile.isProjectFile

isProjectFile()

Public method to check, if this file is an eric3 project file.

Returns:
flag indicating an eric3 project file (boolean)

BrowserFile.isPythonFile

isPythonFile()

Public method to check, if this file is a Python script.

Returns:
flag indicating a Python file (boolean)

BrowserFile.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up

BrowserMethod

Class implementing a BrowserNode that represents a python method.

Derived from

BrowserNode

Methods

BrowserMethod Constructor
compare Private method to compare two items.
setOpen Public slot to set/reset the open state.

BrowserMethod (Constructor)

BrowserMethod(parent, fn, after, filename)

Constructor

after
sibling this node is positioned after
filename
filename of the file defining this method
fn
Function object to be shown
parent
parent Browser or BrowserNode

BrowserMethod.compare

compare(item, col, ascending)

Private method to compare two items.

BrowserMethod.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up

BrowserNode

Class implementing a thin wrapper around QListViewItem. It makes sure that it is positioned after the previous sibling.

Derived from

QListViewItem

Methods

BrowserNode Constructor
paintCell Overwritten class to set a different text color, if bold is true.

BrowserNode (Constructor)

BrowserNode(parent, text, after, bold=0)

Constructor

after
sibling this node is positioned after
bold
flag indicating a highlighted font
parent
parent Browser or BrowserNode
text
text to be displayed by this node (string or QString)

BrowserNode.paintCell

paintCell(p, cg, column, width, alignment)

Overwritten class to set a different text color, if bold is true.

alignment
alignment of the cell (int)
cg
the color group (QColorGroup)
column
the column (int)
p
the painter (QPainter)
width
width of the cell (int)

Up

BrowserSysPath

Class implementing a BrowserNode that represents the Python sys.path.

Derived from

BrowserNode

Methods

BrowserSysPath Constructor
setOpen Public slot to set/reset the open state.

BrowserSysPath (Constructor)

BrowserSysPath(parent, after)

Constructor

after
sibling this node is positioned after
parent
parent Browser or BrowserNode

BrowserSysPath.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up