<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
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 asking the QSqlTableModel for
the row. It doesn't hurt to make a 1 line code
change to test it out. I use QComboBox.currentIndex in my app, though I
have no need to change the model in QComboBox.<br>
<br>
Andreas Pakulat wrote:
<blockquote cite="mid:20100127060951.GB3291@trinity.apaku.dnsalias.org"
type="cite">
<pre wrap="">On 26.01.10 17:41:40, Demetrius Cassidy wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
I don't think so ;) The function currentIndex on the view is not
virtual, so its implemented in the abstract class already properly.
And to get a model index to index into the model its easier to ask the
view for it, rather than constructing it yourself with model->index(
combobox->currentIndex(), <model-column>, QModelIndex())
Andreas
</pre>
</blockquote>
<br>
</body>
</html>