Results 1 to 7 of 7

Thread: QTableView with custom QHeaderView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    7
    Thanked 1 Time in 1 Post

    Default Re: QTableView with custom QHeaderView

    i have started with reimplementing paintEvent ( QPaintEvent * event ) but when i try to create a QPainter as shown in the documentation the console says:

    QPainter::begin: Widget painting can only begin as a result of a paintEvent

    but it is inside paint event.

    code

    HeaderView::HeaderView(Qt::Orientation orientation, QWidget * parent) : QHeaderView(orientation, parent)
    {
    }


    void HeaderView::paintEvent ( QPaintEvent * event )
    {
    QPainter painter(this);
    painter.drawRect(event->rect());
    }

    any idea?

  2. #2
    Join Date
    Sep 2007
    Posts
    7
    Thanked 1 Time in 1 Post

    Default Re: QTableView with custom QHeaderView

    ok this problem is solved. used

    QPainter painter(viewport());
    instead.

    will try to reimplement the QHeaderView. if anyone has an idea on how this could be done otherwhise let me know please. i thought letting table items be tables of its own so that one would automaticly have more headers. the only problem is then how to sort and how to design in model/view architekture. any advices?

    tnx

Similar Threads

  1. Advanced QTableView
    By jpujolf in forum Qt Programming
    Replies: 13
    Last Post: 17th April 2010, 10:15
  2. Custom QHeaderView in Qt 4.1.1
    By Tair in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2006, 10:44

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
  •  
Qt is a trademark of The Qt Company.