×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    16

    Adding ScrolBar to QWidget obj of TabWidget

    Hi,

    I have a TabWidget and each tab is a QWidget. One of the tabs have elements added dynamically and when elements exceeded the scrollBar has to appear.
    I tried using QScrollArea but its not working for me. My app look like this

    xWidget = new QTabWidget();
    yWidget = new QTabWidget();
    central->addTab(xWidget);
    central->addTab(yWidget);

    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(...);
    vLayout->addWidget(...);
    vLayout->addLayout(...);
    xWidget->setLayout(vLayout);
    QScrollArea *scrollArea = new QScrollArea;
    scrollArea->setWidget(xWidget);

    Here the widgets added are those that are children of xWidget.
    Can anyone please let me how can I add scrollBar here.

    Thanks.

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Adding ScrolBar to QWidget obj of TabWidget

    Hi,

    Have taken a look at the example availabe on the wiki that shows how to use a Scrollearea.
    Check this example on wiki.

    http://wiki.forum.nokia.com/index.ph...of_QScrollArea

    Regards
    Jajal Mehul

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    16

    Re: Adding ScrolBar to QWidget obj of TabWidget

    Hi Jajal Mehul,

    I have gone through that. In my case its not adding to scrollbar to single widget but more like to a layout. My app has multiple widgets which are arranged using a layout. My question is how I can add a scollbar when the widgets in this layout exceeds than the sceen can display.

    Thanks

Similar Threads

  1. Bug or error with TabWidget
    By cyphorious in forum Qt
    Replies: 4
    Last Post: 2010-07-29, 10:28
  2. TouchInput in a QWidget
    By hamzeeco in forum Qt
    Replies: 8
    Last Post: 2010-04-09, 21:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×