Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54262

Qt connect and first connect or unicode

Subject Qt connect and first connect or unicode
From Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>
Date 2013-09-17 08:42 +0430
Newsgroups comp.lang.python
Message-ID <mailman.47.1379391172.18130.python-list@python.org> (permalink)

Show all headers | View raw


Dear all,

Unfortunately, i confused and need help... the following code is:
###################################################
##CheckBox:
    QtCore.QObject.connect(self.checkBox,
QtCore.SIGNAL(_fromUtf8("toggled(bool)")), lambda:
self.materialsInstance.setFilterDict("C",self,"name",self.lineEdit.text()))

        QtCore.QObject.connect(self.checkBox_2,
QtCore.SIGNAL(_fromUtf8("toggled(bool)")), lambda:
self.materialsInstance.setFilterDict("C",self,"bought_price",persianToInteger(unicode(self.lineEdit_2.text()))))

        QtCore.QObject.connect(self.checkBox_4,
QtCore.SIGNAL(_fromUtf8("toggled(bool)")), lambda:
self.materialsInstance.setFilterDict("C",self,"stock",persianToInteger(unicode(self.lineEdit_3.text()))))

##LineEdit
        QtCore.QObject.connect(self.lineEdit,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.setFilterDict("L",self,"name",self.lineEdit.text()))

        QtCore.QObject.connect(self.lineEdit_2,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.setFilterDict("L",self,"bought_price",persianToInteger(unicode(self.lineEdit_2.text()))))

        QtCore.QObject.connect(self.lineEdit_3,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.setFilterDict("L",self,"stock",persianToInteger(unicode(self.lineEdit_3.text()))))        

        QtCore.QObject.connect(self.lineEdit,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.responseToRequestForData(self))

        QtCore.QObject.connect(self.lineEdit_2,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.responseToRequestForData(self))

        QtCore.QObject.connect(self.lineEdit_3,
QtCore.SIGNAL(_fromUtf8("editingFinished()")), lambda:
self.materialsInstance.responseToRequestForData(self))        

        QtCore.QObject.connect(self.lineEdit,
QtCore.SIGNAL(_fromUtf8("returnPressed()")), lambda:
self.materialsInstance.responseToRequestForData(self))

        QtCore.QObject.connect(self.lineEdit_2,
QtCore.SIGNAL(_fromUtf8("returnPressed()")), lambda:
self.materialsInstance.responseToRequestForData(self))

        QtCore.QObject.connect(self.lineEdit_3,
QtCore.SIGNAL(_fromUtf8("returnPressed()")), lambda:
self.materialsInstance.responseToRequestForData(self))        

##PushButton:
        QtCore.QObject.connect(self.pushButtonSearch,
QtCore.SIGNAL(_fromUtf8("clicked()")), lambda:
self.materialsInstance.responseToRequestForData(self))



    def setFilterDict(self,widget,obj,field,lineEditContent):
        if field not in obj.materialsInstance.filterNameDict.keys():

obj.materialsInstance.filterNameDict.update({field:lineEditContent})


####################################################
Description:
I have 3 widget:
1. CheckBox:  a. name b. bought_price c. stock
2. LineEdit : a. name b. bought_price c. stock
3. One PushButton

i have three slot: 1. responseToRequestForData()  2.setFilterDict()
3.unSetFilterDict()
responseToRequestForData(): start to search in DB
setFilterDict(): fill a dict from my LineEdit

Problem:
My name is filled in dict but its value doesn't fill up. b and c don't
have any problem.

Yours,
Mohsen

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Qt connect and first connect or unicode Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-17 08:42 +0430
  Re: Qt connect and first connect or unicode Steven D'Aprano <steve@pearwood.info> - 2013-09-17 09:05 +0000
    Re: Qt connect and first connect or unicode Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-09-17 12:32 +0200
    Re: Qt connect and first connect or unicode Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-18 08:04 +0430

csiph-web