Results 1 to 2 of 2

Thread: QTableWidget

  1. #1
    Join Date
    May 2006
    Posts
    6
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QTableWidget

    I'am trying to use QTableWidget in an application. and I want to know how changing the pen of the vertical
    and horizontal Line independently.

    I found the function
    void setGridStyle ( Qt::PenStyle style )

    but the problem with this function is that it applies the same PenStyle on both Vertical and horizontal

    Line of the grid . but I want to apply one penStyle for the vertical Line and another penStyle for

    the horizontals.



    can you help me?



    thanks in advance.

  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: QTableWidget

    Qt doesn't unfortunately support this out of the box.

    You will have to override paint event and do the painting of grid's by yourself.
    Take a look at src/gui/itemviews/qtableview.cpp:
    Qt Code:
    1. void QTableView::paintEvent(QPaintEvent *event)
    To copy to clipboard, switch view to plain text mode 
    for reference how to paint a table (it looks a bit messy, I know..)
    J-P Nurmi

Similar Threads

  1. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  2. QTableWidget (resizing rows, turning off selection, etc.)
    By kiss-o-matic in forum Qt Programming
    Replies: 6
    Last Post: 11th January 2007, 01:57
  3. QTableWidget issues
    By Djony in forum Qt Programming
    Replies: 42
    Last Post: 19th December 2006, 23:27
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.