[PyKDE] QSqlPropertyMap

Torsten Bielen bielen at gmx.de
Tue Feb 24 22:17:00 GMT 2004


Hi,

I want to use my own QSqlPropertyMap in a form to install a customized editor. 
Is there any example how to use QSqlPropertyMap in python. I wrote the code 
below but it doesn't work. 

class IdEditor(QWidget):
   """ 
   custom editor for a combo box (without any functionality yet)
   """
    def __init__(self, cmbBox):
        QWidget.__init__(self)
        self.cmbBox = cmbBox
        self._itemId = 0
        
    def itemId(self):
        debug("itemId called")
    def setItemId(self, id):
        debug("setItemId called")
  

... ...
        self.sqlPropMap = QSqlPropertyMap()
        self.sqlPropMap.insert("IdEditor", "itemId")
        self.sqlForm = QSqlForm(self, "frmAccount_SqlForm")
        self.sqlForm.installPropertyMap(self.sqlPropMap)
        
        self.sqlForm.insert(self.lineEditLoginName, "login_name")
        self.sqlForm.insert(self.lineEditFullName, "full_name")
        self.sqlForm.insert(self.checkBoxLocked , "locked")
        self.sqlForm.insert(self.textEditDesc, "long_desc")
        self.sqlForm.insert(IdEditor(self.comboBoxPrimaryGroup), 
					"primary_group")
	
In the form is a combo box. I want to translate ids stored in the database 
into strings (group names). My idea was to wrap the combo box with my own 
editor and translate it to strings stored in the combo box. 

Thanks 
Torsten
-- 
Torsten Bielen
bielen at gmx.de

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser 
Mail ist nicht gestattet.Diese Nachricht kann vertrauliche oder rechtlich 
geschuetzte Daten

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is 
strictly forbidden.




More information about the PyQt mailing list