Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54263 > unrolled thread
| Started by | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| First post | 2013-09-17 08:50 +0430 |
| Last post | 2013-09-17 08:50 +0430 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Qt connect and first connect or unicode Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-17 08:50 +0430
| From | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| Date | 2013-09-17 08:50 +0430 |
| Subject | Re: Qt connect and first connect or unicode |
| Message-ID | <mailman.48.1379391610.18130.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web