Results 1 to 14 of 14

Thread: QAbstractScrollArea and paintEvent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: QAbstractScrollArea and paintEvent

    So why not put a QLabel inside QScrollArea and forget about the whole problem?
    if i need to have zoom and image moving features(through wheel event and mouse move event) ,should i have to reimplement the QLabel.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QAbstractScrollArea and paintEvent

    No, you just set the zoomed pixmap to the label. Panning should work out of the box.

  3. #3
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: QAbstractScrollArea and paintEvent

    So why not put a QLabel inside QScrollArea and forget about the whole problem?
    i am following the same .I need rubberband zooming .Is it possible with QScrollArea.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QAbstractScrollArea and paintEvent

    Yes, of course. Use QRubberBand and calculate the zoom rectangle based on the position of the viewport.

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.