Results 1 to 12 of 12

Thread: QGraphicsScene size

Hybrid View

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

    Default Re: QGraphicsScene size

    Quote Originally Posted by invictus View Post
    What is the reason for this behaviour?
    Backward compatibility with earlier Qt versions.

  2. #2
    Join Date
    Feb 2007
    Posts
    61
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene size

    I was wondering...is there any other widget than QGraphicsView I can use for 2D graphics? And can I render SVG/Vector graphics on this (if such a widget exists)? I think perhaps GraphicsView is too complicated for my use when all I want is to do some custom drawings on a given portion of the application window.

    My book doesnt cover graphicsview either, while it has a short chapter on 2D using QPainter...

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene size

    I was wondering...is there any other widget than QGraphicsView I can use for 2D graphics? And can I render SVG/Vector graphics on this (if such a widget exists)? I think perhaps GraphicsView is too complicated for my use when all I want is to do some custom drawings on a given portion of the application window.
    You can render a svg on virtually any paint device by using QSvgRenderer.
    This includes widgets and pixmaps. You could use, for example a QWidget, or a QLabel if you wish.


    My book doesnt cover graphicsview either, while it has a short chapter on 2D using QPainter...
    Because the Graphics View Framework is relatively new.
    Try this: http://doc.trolltech.com/4.3/graphicsview.html\

    Regards

  4. #4
    Join Date
    Feb 2007
    Posts
    61
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene size

    If I can do that, why would I use graphicsview to begin with? Sorry if my questions are too stupid to be answered

    To be honest, what I am trying to do is to create a small puzzle game using SVG images for scalability.

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene size

    If I can do that, why would I use graphicsview to begin with?
    The disadvantage, as I see it, when using widgets is that you will have to provide your own item interaction implementation( move puzzle pieces around, etc ).

    With a QGraphicsView/scene these things are built-in.
    Basically, all you have to do is concern on the drawing stuff.

    Regards

Similar Threads

  1. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  2. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  3. How can I make size of QGraphicsScene smaller?
    By troorl_ua in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2007, 07:56
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.