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

Find QScrollArea viewport location relative to embedded widget



  • What is the sequence to determine where in a large widget the current QScrollArea viewport exists? I assumed that viewport()->x() and veiwport()->y() would give me the relative offsets where the view port starts in the larger base widget but I was mistaken.

    I catch mouse click events in the QScrollArea window, but I need the event x/y location to be normallized to the whole image, not simply relative to the current visable portion.

    Do I have to query the scrollbars or is there a more direct way?

    Thoughts?


Log in to reply