Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Object type and how to fetch it

Object type and how to fetch it

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 567 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m_pahlevanzadeh
    wrote on last edited by
    #1

    Dear all,

    I filled up a dict : {checkboxString:ItsObejct} such as:
    @ for row in xrange(len(uniqueFields)):
    instance = QtGui.QCheckBox(uniqueFields[row])
    projectsFindInstance.projectsInstance.addOnFieldsInstance.update({"%s" % uniqueFields[row]:instance})
    projectsFindInstance.tableWidget.setCellWidget(row,0,instance)
    projectsFindInstance.tableWidget.setRowCount(projectsFindInstance.tableWidget.rowCount()+1)
    @
    Then i wrote a loop for connect function:
    @ for key, val in self.projectsInstance.addOnFieldsInstance.items():
    instance = getattr(self,"%s" % self.projectsInstance.addOnFieldsInstance.get(key))
    QtCore.QObject.connect(instance, QtCore.SIGNAL(_fromUtf8("stateChanged (int)")),
    lambda: self.projectsInstance.setFilterDict_Find("TWCH",self,"addonfields",instance.CheckState(),instance))
    @
    Then i got the following traceback:

    @Traceback (most recent call last):
    File "./main.py", line 117, in <module>
    main()
    File "./main.py", line 104, in main
    x.showFindProjects()
    File "/home/mohsen/codes/amlak/amlak/src/UIInterface.py", line 101, in showFindProjects
    self.uiProjectsFind.setupUi(self.projectsFind)
    File "/home/mohsen/codes/amlak/amlak/src/projectsFind.py", line 267, in setupUi
    instance = getattr(self,"%s" % self.projectsInstance.addOnFieldsInstance.get(key))
    AttributeError: 'Ui_ProjectsFind' object has no attribute '<PyQt4.QtGui.QCheckBox object at 0x96b5d64>'
    @
    value of each item of dict is an obejct of QCheckBox, hwo i access them?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved