[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Cannot get data to be fetched by QTableView through
From:       Bjorn Egil Ludvigsen <bludvigsen () gmail ! com>
Date:       2010-04-27 13:29:38
Message-ID: l2i5ec0fe121004270629h6dd8a822uc5c9b26c458463dc () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


FYI, this problem was fixed by using "self.reset()" directly after loading
data.

Bjorn

On Fri, Apr 23, 2010 at 9:14 AM, Bjorn Egil Ludvigsen
<bludvigsen@gmail.com>wrote:

> Yes thanks, I deliberately left those out, but they are working fine (as I
> know by having debug output to my log window) and looks like below. I also
> have headerData(). My header is showing up just fine by the way. The
> vertical header is not shown, even if I set it to be shown, which is strange
> because both rows and columns are returned properly:
>
>     def rowCount(self, index=QModelIndex()):
>         return len(self.uncertainties)
>
>     def columnCount(self, index=QModelIndex()):
>         return len(Uncertainty.uncertaintyAttrList)
>
>     def headerData(self, col, orientation, role):
>         if orientation == Qt.Horizontal and role == Qt.DisplayRole:
>             return Uncertainty.uncertaintyAttrList[col]
>         return None
>
>
>
>
> On Fri, Apr 23, 2010 at 9:01 AM, Andreas Pakulat <apaku@gmx.de> wrote:
>
>> On 23.04.10 08:36:22, Bjorn Egil Ludvigsen wrote:
>> > Hi,
>> >
>> > I cannot get any data to be shown in my QTableView and wonder now if
>> > something could be wrong with returning the QVariants(), as someone on
>> > Daniweb said this is not necessary anymore after PyQt 4.6. Also I read
>> the
>> > PyQt documentation about QVariant, but have not gotten any further.
>> >
>> > Without giving you the whole nine yards, can anyone spot any beginners
>> error
>> > below? The data itself is loaded into a list (self.uncertainties) of
>> > Uncertainty() objects. An Uncertainty() has 22 attributes that I want to
>> > show in a table.
>>
>> Unless you deliberitly left these out the below model misses
>> implementations for at least rowCount and columnCount.
>>
>> Andreas
>>
>> --
>> It was all so different before everything changed.
>> _______________________________________________
>> PyQt mailing list    PyQt@riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>

[Attachment #5 (text/html)]

<div>FYI, this problem was fixed by using &quot;self.reset()&quot; directly after \
loading data.</div> <div> </div>
<div>Bjorn<br><br></div>
<div class="gmail_quote">On Fri, Apr 23, 2010 at 9:14 AM, Bjorn Egil Ludvigsen <span \
dir="ltr">&lt;<a href="mailto:bludvigsen@gmail.com">bludvigsen@gmail.com</a>&gt;</span> \
wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; \
PADDING-LEFT: 1ex" class="gmail_quote"> <div>Yes thanks, I deliberately left those \
out, but they are working fine (as I know by having debug output to my log window) \
and looks like below. I also have headerData(). My header is showing up just fine by \
the way. The vertical header is not shown, even if I set it to be shown, which is \
strange because both rows and columns are returned properly:</div>

<div> </div>
<div>    def rowCount(self, index=QModelIndex()):<br>        return \
len(self.uncertainties)<br>        <br>    def columnCount(self, \
index=QModelIndex()):<br>        return len(Uncertainty.uncertaintyAttrList)</div> \
<div> </div> <div>    def headerData(self, col, orientation, role):<br>        if \
orientation == Qt.Horizontal and role == Qt.DisplayRole:<br>            return \
Uncertainty.uncertaintyAttrList[col]<br>        return None </div> <div>
<div></div>
<div class="h5">
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Fri, Apr 23, 2010 at 9:01 AM, Andreas Pakulat <span \
dir="ltr">&lt;<a href="mailto:apaku@gmx.de" \
target="_blank">apaku@gmx.de</a>&gt;</span> wrote:<br> <blockquote \
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" \
class="gmail_quote"> <div>On 23.04.10 08:36:22, Bjorn Egil Ludvigsen wrote:<br>&gt; \
Hi,<br>&gt;<br>&gt; I cannot get any data to be shown in my QTableView and wonder now \
if<br>&gt; something could be wrong with returning the QVariants(), as someone on<br> \
&gt; Daniweb said this is not necessary anymore after PyQt 4.6. Also I read \
the<br>&gt; PyQt documentation about QVariant, but have not gotten any \
further.<br>&gt;<br>&gt; Without giving you the whole nine yards, can anyone spot any \
beginners error<br> &gt; below? The data itself is loaded into a list \
(self.uncertainties) of<br>&gt; Uncertainty() objects. An Uncertainty() has 22 \
attributes that I want to<br>&gt; show in a table.<br><br></div>Unless you \
deliberitly left these out the below model misses<br> implementations for at least \
rowCount and columnCount.<br><br>Andreas<br><font color="#888888"><br>--<br>It was \
all so different before everything \
changed.<br>_______________________________________________<br>PyQt mailing list    \
<a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></font></blockquote></div><br></div></div></blockquote></div><br>




_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic