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


Groups > comp.lang.python > #54263

Re: Qt connect and first connect or unicode

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

Show all headers | View raw


On Tue, 2013-09-17 at 08:42 +0430, Mohsen Pahlevanzadeh wrote:
> 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
> 
I see same output in console:
{'stock': 2, 'name': PyQt4.QtCore.QString(u''), 'bought_price': 23}

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


Thread

Re: Qt connect and first connect or unicode Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-17 08:50 +0430

csiph-web