Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-19 Thread david
  I put an editable QComboBox in a cell of QTable with setCellWidget() :
 
  self.combo = QComboBox(self.table)
  self.combo.setEditable(1)
  self.table.setCellWidget(line,col,self.combo)
 
  When I'm writing in comboBox, the first character is in the comboBox,
  and after, characters are in a other cell.
 
 Please provide a small self contained example of your problem.


Hello,

Here is a little example, I'm using PyQt 3.5 and Qt 2.3 :

import sys
from qttable import *
from qt import *


class Form(QDialog):
def __init__(self,parent = None,name = None,modal = 0,fl = 0):
QDialog.__init__(self,parent,name,modal,fl)

self.setProperty('caption',QVariant(self.tr(Form)))
self.table = QTable(self,'table')
self.table.setNumRows(4)
self.table.setNumCols(4)
combo = QComboBox(self.table)
combo.setEditable(1)
combo.insertItem('a')
combo.insertItem('b')
combo.insertItem('c')
self.table.setCellWidget(1,1,combo)

if __name__ == '__main__':
a = QApplication(sys.argv)
QObject.connect(a,SIGNAL('lastWindowClosed()'),a,SLOT('quit()'))
w = Form()
a.setMainWidget(w)
w.show()
a.exec_loop()


Thanks for your help.

David

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-19 Thread Hans-Peter Jansen
Hi David,

please have a look into the smalltable.py example, and you will see,
what's wrong. Also reading the docs for QTableItem will help you here.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


Re: [PyKDE] Editable QComboBox in QTable problem ?

2003-03-19 Thread Hans-Peter Jansen
On Wednesday 19 March 2003 17:20, david wrote:
 Le mer 19/03/2003 à 15:13, Hans-Peter Jansen a écrit :
  Hi David,
 
  please have a look into the smalltable.py example, and you will see,
  what's wrong. Also reading the docs for QTableItem will help you here.
 
  Pete

 Hello Pete,

 Thank you for your help.
 I looked smalltable.py, it's an example for Qt 3.x, with Qt 2.x, there
 isn't QComboTableItem().

Oups. My fault. Sorry, but Qt2 was before my PyQt era started.

 With Qt 2.x, I haven't other solution that using setCellWidget().

 True or wrong ?

Don't know. See above. 

 button, checkBox, comboBox works fine with setCellWidget() but with
 editable comboBox, when I'm writing, I lose my focus.

 any ideas ?

Does Qt2 has an QTableItem you can subclass from? Testing your example
here with Qt3 made the QCombo disappear as soon as I entered some text
in this field, independant from, how is was instanced, BTW. 

 Thanks Pete.

You're welcome.

Pete

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde


[PyKDE] Editable QComboBox in QTable problem ?

2003-03-17 Thread david
Dear all,

I put an editable QComboBox in a cell of QTable with setCellWidget() :

self.combo = QComboBox(self.table)
self.combo.setEditable(1)
self.table.setCellWidget(line,col,self.combo)
When I'm writing in comboBox, the first character is in the comboBox, 
and after, characters are in a other cell.

I don't know why, I'm using PyQt 3.5 and Qt 2.3.0

Thank you.

David

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde