[Qt-interest] QTableView with summary footer
André Somers
andre at familiesomers.nl
Wed Sep 7 09:35:28 CEST 2011
Hi,
On Wed, Sep 7, 2011 at 9:07 AM, Linos <info at linos.es> wrote:
> El 07/09/11 09:03, Giuseppe D'Angelo escribió:
> > On Tue, Sep 6, 2011 at 7:02 PM, Linos <info at linos.es> wrote:
> >> Hi,
> >> i am trying to create a QTableView subclass that allows me to
> show a
> >> QHeaderView inside the viewport (above the horizontal scrollbar) with
> summary
> >> data of the columns of the model, but i am getting a difficult time
> getting this
> >> to work, anyone have created something like this and can point me in the
> correct
> >> direction please? Thanks.
> >
> > Did you try with the same approach of the frozen column example?
> > http://doc.qt.nokia.com/4.7/itemviews-frozencolumn.html
> >
> > Cheers,
>
> No, i saw the example but i would like to have a summary QHeaderView in
> footer,
> not a frozen row with summary values, apart from the visual difference i
> would
> like to attach any model to the table (Ex: QSqlQueryModel) without attach
> the
> model to a proxy where i would calculate this last frozen row summary
> values.
>
What you could do is a little bit of style sheet magic to make space in the
QTableView on the bottom of the view. That way, you have space to put your
header/footer there (or draw your own stuff or put some other widget there),
and it will look like a proper single widget. Of course, it is up to you to
make sure the column widths match, but that seems solveable. I used the same
technique to slide up passive notifications into QScrollArea based widgets
before, and it works quite nicely.
Andre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110907/d1ba72b6/attachment.html
More information about the Qt-interest-old
mailing list