Results 1 to 4 of 4

Thread: TableEditDelegate paint issue

  1. #1
    Join Date
    Feb 2014
    Posts
    60
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default TableEditDelegate paint issue

    hi,
    I have check box in my tableView ,i paint it using delegate but there is a problem in getting state of checkBox.For example if i disable the table i want the check box to look like SUNKEN state.how can i do this in paint of delegate.Initially i set the state of check box in paint method as STATE_ENABLED.In short i want set the state of checkBox as STATE_SUNKEN when table is disabled and STATE_ENABLED when table is enabled.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TableEditDelegate paint issue

    If you want the box to be sunken then add a QStyle::State_Sunken flag to the state member of QStyleOptionButton you use wen drawing the check box.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2014
    Posts
    60
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: TableEditDelegate paint issue

    @wysota:I want this sunken state only when the table is disable how will i check this in delegate.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TableEditDelegate paint issue

    QStyleOptionViewItem.state contains the item state flags.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Eraser like MS Paint in Qt
    By dropper in forum Newbie
    Replies: 1
    Last Post: 30th October 2012, 18:32
  2. Paint() calls
    By alitoh in forum Newbie
    Replies: 1
    Last Post: 10th May 2011, 02:05
  3. Paint events
    By GrahamLabdon in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2010, 12:12
  4. Immediate paint
    By zgulser in forum Qt Programming
    Replies: 11
    Last Post: 15th March 2010, 07:34
  5. paint
    By xyzt in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2008, 18:22

Tags for this Thread

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.