Results 1 to 2 of 2

Thread: QSrollArea as centralwidget of QMainWindow

  1. #1
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QSrollArea as centralwidget of QMainWindow

    Hi,

    How can I set QScrollArea as centralwidget in QMainWindow? It would be even better if there is a way to do it with designer.

    D.

  2. #2
    Join Date
    Apr 2011
    Location
    Palma de Mallorca, Islas Baleares, Spain
    Posts
    24
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QSrollArea as centralwidget of QMainWindow

    Hi,

    I'm not working with the designer. The code is:

    Qt Code:
    1. centralWidget = new QWidget(this);
    2. centralWidget->setObjectName(tr("centralWidghet"));
    3.  
    4. scrollArea = new QScrollArea(centralWidget);
    5. scrollArea->setBackgroundRole(QPalette::Dark);
    6.  
    7. setCentralWidget(centralWidget);
    To copy to clipboard, switch view to plain text mode 

    I hope it will be useful

  3. The following user says thank you to sergio87 for this useful post:

    dpatel (10th June 2011)

Similar Threads

  1. QtDesigner: set centralWidget of QMainWindow
    By Florianx in forum Newbie
    Replies: 1
    Last Post: 25th June 2010, 18:17
  2. QMainWindow/centralWidget question
    By graciano in forum Qt Programming
    Replies: 6
    Last Post: 15th April 2010, 22:49
  3. QMainWindow -> centralWidget size
    By lalesculiviu in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2009, 09:40
  4. QMainWindow->centralWidget with alpha?
    By wafto in forum Newbie
    Replies: 2
    Last Post: 7th December 2008, 02:52
  5. QMainWindow: problem changing centralWidget
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 4th October 2007, 13:00

Tags for this Thread

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.