Results 1 to 10 of 10

Thread: QTreeView Mouse Highlighter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView Mouse Highlighter

    I am not sure about your setup but if you want a widget to update, i.e. get its paintEvent() called by Qt, then you call update() on it.

    Cheers,
    _

  2. #2
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTreeView Mouse Highlighter

    ok that worked. Thank you.

    The problem I have now is that the vertical line only shows up only next to the items in the tree view.
    This is an issue because if the items only fill half the tree view, then the vertical line only covers half the screen.
    I want the line to cover the whole height of the tree view. Is there a way to get the tree size/height?

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView Mouse Highlighter

    If you want the line to go on top of all items and even empty space, you could draw it in the view's paintEvent() method.

    Or maybe on the viewport, e.g. by setting a custom widget as the viewport.

    Cheers,
    _

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView Mouse Highlighter

    I am still confused at what the OP wants, but it seems you guys do understand - could some one enlighten me please?
    To me it sounds as what he wants is to have a custom mouse pointer when over the tree view - for that there is no need to do any custom painting, just set an image to the cursor when it enters the tree view.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView Mouse Highlighter

    Quote Originally Posted by high_flyer View Post
    I am still confused at what the OP wants, but it seems you guys do understand - could some one enlighten me please?
    My interpretation is that the view should show a vertical line over its full height at the position of the mouse cursor, like a ruler or reference line.

    Cheers,
    _

  6. #6
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTreeView Mouse Highlighter

    Yes,that's exactly what I mean.

Similar Threads

  1. Replies: 3
    Last Post: 23rd August 2012, 15:06
  2. xml highlighter
    By inspiron18 in forum Newbie
    Replies: 1
    Last Post: 4th March 2012, 00:48
  3. Using QtDesigner highlighter in my own application
    By elcuco in forum Qt Programming
    Replies: 5
    Last Post: 30th July 2011, 18:59
  4. textbox+highlighter
    By nima in forum Qt Programming
    Replies: 0
    Last Post: 27th June 2011, 15:39
  5. QTextEdit with syntax highlighter
    By sarode in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2006, 07:20

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.