Results 1 to 2 of 2

Thread: problems using scroll(...)

  1. #1
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default problems using scroll(...)

    Hello,

    i have a class derived from QGraphicsView and in this class i want to implement a scroll function on a key press, let's say X.
    If I bind this->scroll(10, 0) to the key and run the program my scene will be moved by 10 pixels to the right but from the left nothing comes to fill it up. The scene is large enough but everything i got it the background of my window.
    Even if i call this->update() or this->repaint() after this->scroll(10,0) nothing changes. Why can that be? How can I ensure that the scrolling works properly?

    If I activate the scrollbars of the widget scrolling with them works just fine. What is done different when using scrollbars?

    Best regards,
    Simon

  2. #2
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problems using scroll(...)

    Problem solved:
    You just have to use the QScrollBars of the widget. With the setValue(..) function you can do the scrolling as expected.

Similar Threads

  1. QWebFrame scroll down to the max.
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2009, 22:55
  2. vertical scroll bar in Qt box.
    By rajveer in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2008, 07:41
  3. QTextBrowser, how to scroll ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 22nd December 2006, 07:57
  4. Scroll bar with two sliders?
    By Morea in forum Newbie
    Replies: 3
    Last Post: 9th May 2006, 06:51
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

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.