Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to make move icon disappeared when moving column outside of QHeaderView ?



  • Hi Everyone,

    I am using QTableView and QHeaderView in my application.
    I am using setSectionsMovable(true) method and I can move columns.

    I have two problems:

    1. I want move icon (which is slightly transparent "Color" icon for this case) to disappear when the mouse is not on the header while I am dragging.
      question.png
      For the case above, it should disappear. Also columns should not change if I release the mouse button on that area.

    2. I want to change the mouse icon, when it is outside of QHeaderView.

    How do I do that ?

    Thank you,


  • Lifetime Qt Champion

    Hi,

    By instinct, I would say look at the mouseMoveEvent method.

    Taking a look at the code of QHeaderView, I don't think it's something you'll be able to do by just subclassing.


Log in to reply