本文整理汇总了Python中helper.QHelper.getValue方法的典型用法代码示例。如果您正苦于以下问题:Python QHelper.getValue方法的具体用法?Python QHelper.getValue怎么用?Python QHelper.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.QHelper
的用法示例。
在下文中一共展示了QHelper.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import getValue [as 别名]
def __init__( self ):
QForm.__init__( self )
self.setWindowTitle( 'Login' + ' - ' + DBConf.get( 'appname' ) )
self.resize( 450, 200 )
self.move( 350, 350 )
grid = QtGui.QGridLayout()
self.heading = QtGui.QLabel( 'Please enter your login and password' )
grid.addWidget( self.heading, 0, 0, 1, 2 )
self.status = QtGui.QLabel( '' )
grid.addWidget( self.status, 1, 0, 1, 2 )
grid.addWidget( QtGui.QLabel( 'username' ), 2, 0 )
grid.addWidget( self.lineEditField( 'username', DBConf.get( 'username' ), 'username' ), 2, 1 )
grid.addWidget( QtGui.QLabel( 'password' ), 3, 0 )
grid.addWidget( self.lineEditField( 'passwd', DBConf.get( 'passwd' ), 'password' ), 3, 1 )
self.submit = QtGui.QPushButton( 'Login', self )
self.submit.clicked.connect( lambda: QHelper.master().emit( QtCore.SIGNAL( 'loginSubmit' ), QHelper.getValue( self.fields['username'] ), QHelper.getValue( self.fields['passwd'] ) ) )
self.quit = QtGui.QPushButton( 'Cancel', self )
self.quit.clicked.connect( lambda: QHelper.master().emit( QtCore.SIGNAL( 'loginCancel' ) ) )
self.preferences = QtGui.QPushButton( 'Preferences', self )
self.submit.clicked.connect( lambda: QHelper.master().emit( QtCore.SIGNAL( 'loginSubmit' ), QHelper.getValue( self.fields['username'] ), QHelper.getValue( self.fields['passwd'] ) ) )
QHelper.master().connect( self.preferences, QtCore.SIGNAL( 'clicked()' ), lambda:self.hide() or QHelper.master().Action.preferencesActionCallback() )
hbox = QtGui.QHBoxLayout()
hbox.addStretch( 1 )
hbox.addWidget( self.preferences )
hbox.addWidget( self.submit )
hbox.addWidget( self.quit )
buttons = QtGui.QWidget()
buttons.setLayout( hbox )
grid.addWidget( buttons, 4, 0, 1 ,2 )
self.setLayout( grid )
self.connect( QHelper.master(), QtCore.SIGNAL( 'loginSubmit' ), self.loginSubmitCallback )
self.connect( QHelper.master(), QtCore.SIGNAL( 'loginSuccess' ), self.loginSuccessCallback )
self.connect( QHelper.master(), QtCore.SIGNAL( 'loginError' ), self.loginErrorCallback )
self.connect( QHelper.master(), QtCore.SIGNAL( 'loginCancel' ), self.loginCancelCallback )
self.connect( QHelper.master(), QtCore.SIGNAL( 'preferencesSubmit' ), self.preferencesSubmitCallback )
self.connect( QHelper.master(), QtCore.SIGNAL( 'preferencesCancel' ), self.preferencesCancelCallback )
示例2: loginSuccessCallback
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import getValue [as 别名]
def loginSuccessCallback( self ):
QHelper.log( '::CONNECT:QLoginView:loginSuccess' )
DBConf.set( 'username', QHelper.getValue( self.fields['username'] ) )
DBConf.set( 'passwd', QHelper.getValue( self.fields['passwd'] ) )
self.hide()
self.status.setText( '' )
示例3: values
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import getValue [as 别名]
def values( self ):
return dict( [( k, QHelper.getValue( v ) ) for k, v in self.fields.items()] )