Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Customize QTableView

    General and Desktop
    3
    3
    2226
    Loading More Posts
    • 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
      Diluka last edited by

      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 Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        "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 Reply Quote 0
        • T
          tobias.hunger last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post