Results 1 to 1 of 1

Thread: vertical scrollbar subtraction from the screen width

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default vertical scrollbar subtraction from the screen width


    Dear Friends

    I have a Qwidget and a QScrollBar is holding that widget using setWidget(widget) function.

    When my screen is half some portion of the widget is getting out of scope so a scrollbar is coming. When the screen is full the widget can very well accommodated in the screen so I don’t want a scrollbar to come but its still coming for a very small variation. I came to know its because of the vertical scrollbars height itself. So when I set the geometry I am doing like this below

    Qt Code:
    1. PageWidget::PageWidget(QScrollArea *parent)
    2. {
    3. desk = new QDesktopWidget;
    4. page_width = desk->width();
    5. page_height = desk->height();
    6. setGeometry(0,0,page_width-pageforgraph->verticalScrollBar()->height(),hgth);
    7. }
    8. //////////////////////////////////////////////////////////////////////////////////
    To copy to clipboard, switch view to plain text mode 
    Now because of this code I can when my screen is full no scrollbar is coming. But just after the vertical scrollbar 1 very small portion of left…..I am subtracting only the height but some extra amount has been subtracted I think. Can anyone tell me how can I resolve this. I want only the exact amount of height of the scrollbar to be subtracted .
    Please see the attachment picture. Look at the extreme right vertical scrollbar and some portion left after that. Any help would be appreciated. Thanks sujan
    Last edited by high_flyer; 16th February 2011 at 10:07. Reason: code tags

Similar Threads

  1. Replies: 2
    Last Post: 11th June 2010, 07:23
  2. Resize a vertical an horizontal scrollbar.
    By IRON_MAN in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2010, 15:45
  3. Replies: 1
    Last Post: 9th February 2010, 15:04
  4. QToolBox width fixed to maximum content width
    By ghorwin in forum Qt Programming
    Replies: 0
    Last Post: 10th July 2009, 09:58
  5. vertical scrollbar width
    By drkbkr in forum Qt Programming
    Replies: 25
    Last Post: 31st May 2008, 07:09

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.