Looking at the source code in Qt, I think the reason for this is because
there's no connection between the currentIndex() in the itemview and the
one in its selectionModel. In particular the currentChanged() slot in
the itemview doesn't update its internal currentIndex. I think thats a
bug
On 30.01.10 22:44:24, Claudio Felix wrote:
Looking at the source code in Qt, I think the reason for this is because
there's no connection between the currentIndex() in the itemview and the
one in its selectionModel. In particular the currentChanged() slot in
the itemview doesn't update
Just took a peak at QAbstractItemView class and your right it's fully
implemented. The view is asking the selectionModel what the current
selected index is, and if it has no selection model (not sure if that's
even possible) it returns an invalid QModelIndex. QComboBox.currentIndex
is just
2010/1/27 Andreas Pakulat ap...@gmx.de:
On 26.01.10 17:41:40, Demetrius Cassidy wrote:
I don't think you need to use the view pointer at all - it's
returning QAbstractItemView *, which I would assume it would need to
be casted to the proper class in C++. If that's so, by design the
Abstract
On 27.01.10 09:08:13, Claudio Felix wrote:
2010/1/27 Andreas Pakulat ap...@gmx.de:
On 26.01.10 17:41:40, Demetrius Cassidy wrote:
I don't think you need to use the view pointer at all - it's
returning QAbstractItemView *, which I would assume it would need to
be casted to the proper class
Well, the combobox has initially no selected/current entry - AFAIK. Only
once you select one it'll be set. Hence the invalid index.
However a setCurrentIndex with a value != 0 on the combobox should
change that already I think.
Another thing in your case is that box.view().currentIndex()
On 27.01.10 17:33:18, Claudio Felix wrote:
Well, the combobox has initially no selected/current entry - AFAIK. Only
once you select one it'll be set. Hence the invalid index.
However a setCurrentIndex with a value != 0 on the combobox should
change that already I think.
Another thing
Hi everyone,
I'm developing an app which loads data from a database table into a
QSqlTableModel. At some point I associate this model to a Combo Box
(using QComboBox.setModel). The strange thing is, when I try to read
the current model index from the combo box view, for getting the
selected
Hi everyone,
I'm developing an app which loads data from a database table into a
QSqlTableModel. At some point I associate this model to a Combo Box
(using QComboBox.setModel). The strange thing is, when I try to read
the current model index from the combo box view, for getting the
selected
How about selecting index 0 once the combobox is initialized with the
database data? It sounds to me that it has no valid index when first
initialized, and if you try to programmatically select the first index,
it's returning an invalid one. You don't need to generate a signal, just
use
2010/1/26 Demetrius Cassidy dcassid...@mass.rr.com:
How about selecting index 0 once the combobox is initialized with the
database data? It sounds to me that it has no valid index when first
initialized, and if you try to programmatically select the first index, it's
returning an invalid one.
I don't think you need to use the view pointer at all - it's returning
QAbstractItemView *, which I would assume it would need to be casted to
the proper class in C++. If that's so, by design the Abstract class will
return an invalid index. Try to use self.comboBox.currentIndex() instead
- it
On 26.01.10 17:41:40, Demetrius Cassidy wrote:
I don't think you need to use the view pointer at all - it's
returning QAbstractItemView *, which I would assume it would need to
be casted to the proper class in C++. If that's so, by design the
Abstract class will return an invalid index.
I
13 matches
Mail list logo