Package schrodinger :: Package application :: Package matsci :: Module qualityslider :: Class QualitySlider
[hide private]
[frames] | no frames]

Class QualitySlider

PyQt4.QtGui.QFrame --+
                     |
                    QualitySlider

A widget that allows the user to see and edit the Jaguar keywords for three different accuracy levels.

The QFrame contains either a QSlider or set of QRadioButtons and an SLabeldLineEdit. The QSlider/QRadioButtons can be used to switch between accuracy levels, and the keywords for that accuracy level are displayed in the SLabeledLineEdit

Instance Methods [hide private]
 
__init__(self, parent=None, label='Calculation quality:', useredit=True, layout=None, coarse="", medium="", accurate="", radiobuttons=False)
Create a QualitySlider instance
 
buttonChanged(self)
Callback for radiobutton toggled signals - change the keywords displayed in the KeywordEdit
 
valueChanged(self, newvalue)
Callback for when the QSlider changes value - change the keywords displayed in the KeywordEdit
 
updateKeywordEdit(self, setting)
Change the keywords in the KeywordEdit to be those for the accuracy level of setting
 
setKeywords(self, setting, keywords, append=False)
Set the keywords for a particular accuracy level
str
getKeywordString(self)
Return the current string in the KeywordEdit
dict
getKeywordDict(self)
Return a dictionary whose keys are keywords and values are keyword values for the current KeywordEdit contents.
int
getCurrentSetting(self)
Return the current setting of the QSlider/QRadioButtons
Class Variables [hide private]
  COARSE = 0
  MEDIUM = 1
  ACCURATE = 2
  LABELS = {COARSE: 'Coarse', MEDIUM: 'Medium', ACCURATE: 'Accur...
Method Details [hide private]

__init__(self, parent=None, label='Calculation quality:', useredit=True, layout=None, coarse="", medium="", accurate="", radiobuttons=False)
(Constructor)

 

Create a QualitySlider instance

Parameters:
  • parent (QWidget) - The parent of this QFrame
  • label (str) - The label shown in the frame
  • useredit (bool) - True if the user can edit the keywords, False if not
  • layout (QBoxLayout) - The layout to add this QFrame to
  • coarse (str) - The keyword string for coarse calculations
  • medium (str) - The keyword string for medium calculations
  • accurate (str) - The keyword string for accurate calculations
  • radiobuttons (True if the QFrame should contain 3 radiobuttons rather than a QSlider to pick the accuracy level)

valueChanged(self, newvalue)

 

Callback for when the QSlider changes value - change the keywords displayed in the KeywordEdit

Parameters:
  • newvalue (int) - The current value of the QSlider

updateKeywordEdit(self, setting)

 

Change the keywords in the KeywordEdit to be those for the accuracy level of setting

Parameters:
  • setting (int) - One of the class constants COARSE, MEDIUM or ACCURATE

setKeywords(self, setting, keywords, append=False)

 

Set the keywords for a particular accuracy level

Parameters:
  • setting (int) - One of the class constants COARSE, MEDIUM or ACCURATE
  • keywords (str) - The string to use for the new keywords
  • append (bool) - True if the keywords string should be added to the current string, False (default) if it should replace the current string.

getKeywordString(self)

 

Return the current string in the KeywordEdit

Returns: str
The current string in the KeywordEdit

getKeywordDict(self)

 

Return a dictionary whose keys are keywords and values are keyword values for the current KeywordEdit contents.

Returns: dict
Dictionary of keyword/value pairs
Raises:
  • ValueError - if any tokens do not match the keyword=value format

getCurrentSetting(self)

 

Return the current setting of the QSlider/QRadioButtons

Returns: int
The current setting of the QSlider/QRadioButtons - one of the class constants COARSE, MEDIUM or ACCURATE

Class Variable Details [hide private]

LABELS

Value:
{COARSE: 'Coarse', MEDIUM: 'Medium', ACCURATE: 'Accurate'}