Results 1 to 4 of 4

Thread: Verticalheader

  1. #1

    Default Verticalheader

    hi all, i have a verticalHeader of my QtableView, i'd like insert a data inside it but i can't i tried it through headerView->setHeaderData but it doesn't insert, it's something weird because if i try it on my horizontalHeader it works fine, i don't know how make.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Verticalheader

    May we see some code? First of all, QAbstractItemModel::setHeaderData() is not a method of QHeaderView. Secondly, which model are you using?
    J-P Nurmi

  3. #3

    Default Re: Verticalheader

    sorry jpn, i was in a hurry and i can't explain better.
    at the moment i am doing this:
    MyHeaderView->model()->setHeaderData (index, Qt::Vertical,index);
    MyHeaderView->headerDataChanged (Qt::Vertical, index, index);
    where 'index' is the section clicked on MyHeaderView (Vertical always ok)
    and it has any effect, i mean that these lines don't insert any value inside MyHeaderView.

    My model is a QSqlQueryModel subclassed, i just reimplemented the flags method. the Doc says that setHeaderData of QSqlQueryModel can insert datas inside horizontal header only. Maybe this is the cause of my problem, but i am not sure, acuatlly that i need is the next:

    1. you can see my vertical header here: http://imagebin.ca/view/bW6L1uCU.html
    i need order my vertical header in a ascending order , simply that is i need.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Verticalheader

    It's the actual model which provides data for headers. Don't use "MyHeaderView->model()->setHeaderData(...)" but something like "sqlModel->setHeaderData(...)".
    J-P Nurmi

Similar Threads

  1. Replies: 2
    Last Post: 22nd January 2008, 16:10
  2. How to set verticalHeader() indexing for QTableWidget ?
    By balazsbela in forum Qt Programming
    Replies: 3
    Last Post: 30th July 2007, 13:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.