Results 1 to 6 of 6

Thread: QScrollArea scrolling down not up

Hybrid View

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

    Default Re: QScrollArea scrolling down not up

    Wait a minute. QTextBrowser is already scrollable. What's the point placing it inside a QScrollArea?
    J-P Nurmi

  2. #2
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea scrolling down not up

    I have lots of other custom widgets and a tab widget in the scroll area. The text widget is inside of the tab widget. The example that I gave you is just a minimized version of what I do to duplicate the problem.

    I just substituted the following code in MainWidget.cpp to use a QLabel instead of QTextBrowser and I still see the problem:

    Qt Code:
    1. QLabel* label = new QLabel(this);
    2. scrollArea_->setWidget(label);
    3. label->setText("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea scrolling down not up

    Turns out the culprit was the fact that I had:
    Qt Code:
    1. setStyleSheet("background-color: rgb(240,240, 240)");
    To copy to clipboard, switch view to plain text mode 

    in the mainDialog.cpp

    This propagated to widgets that cannot be styled this way. In order to style the scrollbar, it looks like I am going to have to style each part of the scrollbar.
    stylesheet description for scrollbar

    I was hoping that I could set the color of my entire application in one call but it looks like I am going to have to be a little more detailed than that.

Similar Threads

  1. ScrollBar inside QTreeWidget is Blurring on Scrolling
    By santosh.kumar in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2008, 14:33
  2. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18
  3. QScrollArea and resizing
    By rarefluid in forum Qt Programming
    Replies: 8
    Last Post: 22nd July 2007, 14:18
  4. Scrolling bar problem in QScrollArea
    By YuriyRusinov in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2007, 21:22
  5. Replies: 2
    Last Post: 8th October 2006, 20:14

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.