Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Customize QTableView

Customize QTableView

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Diluka
    wrote on last edited by
    #1

    Hi
    I need some help for my Qt Application .In my application i had QTableView in this table contain two columns when application load column 2 value greater than column 1 value i want to change that row color into red if any one have idea about that ? or any experience about that ?(specially i want to know what kind of techniques i want to follow to achieve my target )

    Thanks

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      "QStyledItemDelegate":http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html is your friend in that case.
      There are some examples available. But basically you just need to rewrite the paint method in the delegate.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        Or you change the color in the model. That goes against the MVC paradigm, but might be faster to do.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved