Results 1 to 14 of 14

Thread: Subclassing QScrollView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    India
    Posts
    54
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 7 Times in 6 Posts

    Default Re: Subclassing QScrollView

    should I reimplement resizecontents() ?
    And is my code of drawcontents sufficient?

    I also attaching my ImageView.
    Attached Images Attached Images
    • File Type: png 1.png (33.2 KB, 11 views)
    Last edited by sumsin; 16th March 2006 at 14:03.

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 80 Times in 74 Posts

    Default Re: Subclassing QScrollView

    no need to reimplement it.

    Just call the slot (not inside drawContents but somewhere before drawContents gets called).

    I think the code inside drawContents will suffice.

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    9
    Thanked 27 Times in 27 Posts

    Default Re: Subclassing QScrollView

    Quote Originally Posted by sumsin
    should I reimplement resizecontents() ?
    And is my code of drawcontents sufficient?

    I also attaching my ImageView.
    why?

    what actually you want to do ?
    a life without programming is like an empty bottle

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Subclassing QScrollView

    How about setting the image on a QLabel and placing the label inside the scroll view?

  5. #5
    Join Date
    Jan 2006
    Posts
    667
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    10
    Thanked 80 Times in 74 Posts

    Default Re: Subclassing QScrollView

    but drawContents called automatically.
    yes. So call resizeContents in function where you get your pixmap.

  6. #6
    Join Date
    Jan 2006
    Location
    India
    Posts
    54
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 7 Times in 6 Posts

    Default Re: Subclassing QScrollView

    I actually want that at startup my widget opens in a default size and if the size of the image is larger than the size of viewport then it should show the scrollbars.
    And when I resize the widget manually it should manage itself so that every time the image try to be in center.

Similar Threads

  1. subclassing QWidget
    By BeS in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2009, 20:38
  2. Subclassing QAbstractItemView
    By psih128 in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2008, 07:32
  3. QScrollView size policy?
    By Henrikas[MI] in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2006, 10:52
  4. Problem with QTreeWidget after subclassing
    By steve918 in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2006, 18:51
  5. How to find size provided by QScrollView
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2006, 09:26

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.