Results 1 to 11 of 11

Thread: Wacky QScrollBar behaviour: setSliderPosition vs sliderPosition

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2013
    Location
    Warsaw, Poland
    Posts
    10
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Wacky QScrollBar behaviour: setSliderPosition vs sliderPosition

    Hi all. I'm new to Qt, just setup ver. 5.0.0. Good to be here.

    I'm coding a small app, like a Ms Notepad with tabs for multiple documents. I have a single QPlainTextEdit and QTabBar to change contents of the text edit.

    With each open document, to remember where the viewport was set, I save three parameters of its scrollbar: minimum, maximum, and position (tried both sliderPosition and value). When user goes back to the document, I set these values again - min, max, and then value. Problem is, the scrollbar sets itself to more or less offset values, immediately after the setters are called, so my ingenious method of preserving each document's viewport doesn't work. Could you please help me understand why the scrollbar behaves this way, and perhaps help me fix it? Thanks.

    P.S. My app is really simple, so I attached the whole thing, should anyone be so kind as to have a look; hope it's alright.
    Attached Files Attached Files
    Last edited by 0null0; 3rd February 2013 at 14:22.

Similar Threads

  1. Steps on QScrollBar
    By Cucus in forum Qt Tools
    Replies: 1
    Last Post: 20th June 2011, 23:27
  2. Events on QScrollBar
    By xiongxiongchuan in forum Qt Programming
    Replies: 7
    Last Post: 16th June 2010, 10:32
  3. QScrollbar color
    By ntp in forum Qt Programming
    Replies: 0
    Last Post: 28th August 2008, 17:59
  4. qscrollbar styling
    By 20khz in forum Qt Programming
    Replies: 0
    Last Post: 5th May 2008, 14:17
  5. QScrollbar stylesheet
    By GuS in forum Qt Programming
    Replies: 34
    Last Post: 4th December 2007, 16:12

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.