Results 1 to 10 of 10

Thread: Elements out of Range!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Elements out of Range!!

    You have some strange problem. Resizing the canvas makes the canvas bigger. Which part of it is visible has nothing to do with the canvas itself, only with the canvasview size and its world matrix. What exactly do you want to achieve and why?

  2. #2
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Elements out of Range!!

    Quote Originally Posted by wysota
    You have some strange problem. Resizing the canvas makes the canvas bigger. Which part of it is visible has nothing to do with the canvas itself, only with the canvasview size and its world matrix. What exactly do you want to achieve and why?

    Hi...

    Thats my problem.. resizing it is making it bigger than the size i need... I just need 400 X 400 to be seen in the window and the actual canvas to be 1000 X 1000...

    Using canvasview's resizeContents() method, i culdnt get the soln... The problem with it is that it does not reduce the canvas size... if the view's size is greater than the canvas size then the scrollbars are added...

    Now when i keep view bigger and canvas smaller then the elements are just created on the canvas's size and thus not all are created... the moment i increase it, it goes out of the window...

    thats the problem..

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Elements out of Range!!

    Qt Code:
    1. QCanvas *c;
    2. QCanvasView *cv;
    3. //...
    4.  
    5. c->resize(1000,1000);
    6. cv->setFixedSize(400,400);
    To copy to clipboard, switch view to plain text mode 

    This will display a bit less than 400x400 (because of the scrollbars).

  4. The following user says thank you to wysota for this useful post:

    Kapil (3rd April 2006)

  5. #4
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Elements out of Range!!

    Hi wysota..

    Thanks a lot for your help..

    Its working out now...

    Kapil

Similar Threads

  1. QWTdial inverted range
    By jmsbc in forum Qwt
    Replies: 1
    Last Post: 12th January 2009, 21:21
  2. accessing table elements in Qt
    By awanish_jmi in forum Newbie
    Replies: 5
    Last Post: 28th July 2008, 12:51
  3. Replies: 3
    Last Post: 12th June 2008, 11:59
  4. Replies: 2
    Last Post: 20th September 2007, 19:37
  5. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48

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.