Results 1 to 4 of 4

Thread: How to scroll MainWindow

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How to scroll MainWindow

    Hello
    I have simple question: How to add scrolling to MainWindow in QT designer, if MainWindow is smaller than widget inside it? I think I should place ScrollArea to MainWindow and change its size always when MainWindow size is changing. But Idon't know how to do it. Thanks for help.

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

    Default Re: How to scroll MainWindow

    But Idon't know how to do it.
    Drag a scroll area to the main window and drop it there. Apply a layout on the centralWidget of the window so that the scroll area "snaps" into place. Then drag and drop contents you want to have in the window into the scroll area, apply a layout and set "widgetResizable" property of the scroll area to true.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to scroll MainWindow

    Thanks!! It works, but... I must add layouts to scroll area. Is it Any way to deploy my buttons within layouts, to avoid moving them when window size is changing?



    Quote Originally Posted by wysota View Post
    Drag a scroll area to the main window and drop it there. Apply a layout on the centralWidget of the window so that the scroll area "snaps" into place. Then drag and drop contents you want to have in the window into the scroll area, apply a layout and set "widgetResizable" property of the scroll area to true.

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

    Default Re: How to scroll MainWindow

    There is no difference in using layouts with and without QScrollArea. You place items in the scroll area and then apply the layout to the scroll area.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Scroll bars in scroll area not comming in scroll area
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 06:50
  2. Scroll bars in scroll area not comming
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2011, 19:56
  3. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2010, 23:05
  4. Replies: 0
    Last Post: 28th December 2009, 12:24
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.