Results 1 to 2 of 2

Thread: displayin' many images on a scence

  1. #1
    Join Date
    Mar 2008
    Location
    Morocco
    Posts
    47
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default displayin' many images on a scence

    Hi..
    I would like to know if there is way to display many images in a same graphicsScene..
    as a grid that contains images ..each one besides the other :


    *****************
    * pic1 * pic3 *
    *****************
    * pic2 * pic4 *
    *****************
    I guess it could be done via rect .. but how can I define n rect one beides the other as grid ?!!

    NB> I need that to zoom on a map ..I will display first only 4x4 images .. then depending on the zoom (in or out) I may display or hide other images...

    if someone has an idea !!
    thanks
    Last edited by peace_comp; 30th April 2008 at 21:21.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: displayin' many images on a scence

    why do you need GraphicsScene for such functionality ??
    You can very well do it with layouts and labels. Except for zoom part, it will little more effort i guess.

    Without graphicsscene -
    You can display images in a QLabel objects, and arrange the labels using QGridLayout. For zooming in and out, u can change the size of Qlabel and adjust the grid layout accordingly.


    With graphicsscene-
    u need to manipulate the positions urself, because u gonna be placing items in the scene.
    For this a a simple calculation can help-
    nth_item->setPos((n/no_of_columns)*height , (n-1)*width);

    am not sure if this will work, but i hope u got the idea. In this scene case, zooming will zoom into the scene, it wont arrange the images for u.


    Depending on the functionality u want to achieve, u can choose either of the solution

    Also u can refer puzzles examples in Qt demo, it may help u

  3. The following user says thank you to aamer4yu for this useful post:

    peace_comp (1st May 2008)

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.