pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | Private Member Functions | List of all members
pycross.forms.BrowseEdit Class Reference

Edit field with internal 'Browse' button to file or folder browsing. More...

Inheritance diagram for pycross.forms.BrowseEdit:

Public Member Functions

def __init__ (self, text='', parent=None, dialogtype=None, btnicon=None, btnposition=None, opendialogtitle=None, filefilters=None, fullpath=True)
 Constructor. More...
 
def reset_action (self)
 Resets the browse action (after setting options). More...
 
def on_btnaction (self)
 Triggered slot for the browse action: opens dialog and sets the edit text. More...
 

Public Attributes

 dialogtype
 str path and dialog type ('file' or 'folder') More...
 
 btnicon
 str icon file name in 'assets/icons' More...
 
 btnposition
 int browse button position (0 or 1) More...
 
 opendialogtitle
 str dialog title More...
 
 filefilters
 str file filters for file browse dialog More...
 
 fullpath
 
 delegate
 
 btnaction
 

Private Member Functions

def _get_dir (self, text=None)
 Gets the start directory for the browse dialog. More...
 
def _clear_actions (self)
 Clears previous actions from the underlying object. More...
 

Detailed Description

Edit field with internal 'Browse' button to file or folder browsing.

Inherited from QtWidgets.QLineEdit

Constructor & Destructor Documentation

◆ __init__()

def pycross.forms.BrowseEdit.__init__ (   self,
  text = '',
  parent = None,
  dialogtype = None,
  btnicon = None,
  btnposition = None,
  opendialogtitle = None,
  filefilters = None,
  fullpath = True 
)

Constructor.

Parameters
textstr initial text in edit field (default = empty)
dialogtypestr path and dialog type:
  • 'fileopen' = open file browse dialog
  • 'filesave' = save file browse dialog
  • 'folder' = folder browse dialog None = 'fileopen' (default)
btniconstr icon file name in 'assets/icons' None = 'folder-2.png' (default)
btnpositionint browse button position:
  • 0 (QtWidgets.QLineEdit.LeadingPosition) = left-aligned
  • 1 (QtWidgets.QLineEdit.TrailingPosition) = right-aligned None = QtWidgets.QLineEdit.TrailingPosition (default)
opendialogtitlestr dialog title (None will use a default title)
filefiltersstr file filters for file browse dialog, e.g. "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
None sets the default filter: "All files (*.*)"

Member Function Documentation

◆ _clear_actions()

def pycross.forms.BrowseEdit._clear_actions (   self)
private

Clears previous actions from the underlying object.

◆ _get_dir()

def pycross.forms.BrowseEdit._get_dir (   self,
  text = None 
)
private

Gets the start directory for the browse dialog.

◆ on_btnaction()

def pycross.forms.BrowseEdit.on_btnaction (   self)

Triggered slot for the browse action: opens dialog and sets the edit text.

◆ reset_action()

def pycross.forms.BrowseEdit.reset_action (   self)

Resets the browse action (after setting options).

Member Data Documentation

◆ btnaction

pycross.forms.BrowseEdit.btnaction

◆ btnicon

pycross.forms.BrowseEdit.btnicon

str icon file name in 'assets/icons'

◆ btnposition

pycross.forms.BrowseEdit.btnposition

int browse button position (0 or 1)

◆ delegate

pycross.forms.BrowseEdit.delegate

◆ dialogtype

pycross.forms.BrowseEdit.dialogtype

str path and dialog type ('file' or 'folder')

◆ filefilters

pycross.forms.BrowseEdit.filefilters

str file filters for file browse dialog

◆ fullpath

pycross.forms.BrowseEdit.fullpath

◆ opendialogtitle

pycross.forms.BrowseEdit.opendialogtitle

str dialog title


The documentation for this class was generated from the following file: