Results 1 to 2 of 2

Thread: Ignoring scaling graphics view/scale

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Ignoring scaling graphics view/scale

    Hi guys,

    I am currently looking for a solution to set some graphicsitems' position fixed ignoring scaling. Yes I can setFixed size(set item's flag to ignore scaling), but while scaling the coordinates change and the item moves.
    I am thinking about reading coordinates from the scene/view and mapping them to widget coordinates and then after resizing I could read the stored coordinates and map them to new coordinates on the scene(so the items would not move).

    Do you think it's a good idea?
    Or maybe you have different ideas about seeting items ignoring coordinate system. I do not want some items to change their sizes and position, ignore the scaling. THe scene background has to be scaled, but some items shoud be the same during the run-time.


    Maverick
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Ignoring scaling graphics view/scale

    There's no support in Graphics View for fixating items to the viewport; you could try creating widgets as children of the viewport, and setting FullViewportUpdate to disable widget scrolling : http://doc.trolltech.com/4.3/qgraphi...pdateMode-enum

    Otherwise, you can subclass QGraphicsView, reimplement paintEvent() and the other event handlers, and do it all yourself... not recommended though..
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

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

    maverick_pol (8th August 2007)

Similar Threads

  1. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

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.