Results 1 to 4 of 4

Thread: Resolution independant UI with QGraphicsScene

  1. #1

    Question Resolution independant UI with QGraphicsScene

    I'm trying to create a resolution independent UI for my QGraphicsScene base application. The main window consists of a QGraphicsView that is full screen, with no window border. I'm doing this by using a local coordinates system where the long dimension of the screen is always one. For example, resolutions such as 640x480, 102x768, etc would have a graphics scene size of 1.0x0.75. Resolutions such as 1280x768 would have a scene size of 1.0x0.56. The problem is that it usually scales very badly. Text and image look very grainy. I would have though that keeping the same aspect ratio would ensure a good looking scaled up image. Is this correct?

    Is there a technique i can use to have a resolution independent coordinate system that looks good when scaled? I'm using a mixture of QWidgets, pixmaps, and painted items. I plan to use a QGLWidget as the view port for my graphics view, and enable anti aliasing. I haven't tried that yet though.

  2. #2
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resolution independant UI with QGraphicsScene

    Much depends on your intent and how the internal items scale. For example, if I display a picture of your head full screen, then move from a normal monitor to a wide screen monitor, your head will likely be stretched. For this reason, I always try to scale graphics so that the graphic maintains its aspect ration. Assume a 4x6 photo, which has an aspect ration of 2:3. If my monitor is 1024x768, the ratio is 4:3, a resolution of 1920x1200 is 8:5.

  3. #3

    Default Re: Resolution independant UI with QGraphicsScene

    Aspect ratio is not the problem. I set the scene rect at the same ratio of the screen. Also, I'm not expecting low resolution bitmaps to look good when scaled up.

  4. #4
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resolution independant UI with QGraphicsScene

    It is my understanding that all supported devices use square pixels. As long as you do not change the aspect ratio, then I would expect things to look fine. Most people use twips when they desire device independence.

Similar Threads

  1. Replies: 4
    Last Post: 9th November 2009, 21:12
  2. Replies: 1
    Last Post: 28th January 2009, 14:47
  3. Launching a PDF in platform independant way
    By JPNaude in forum Qt Programming
    Replies: 2
    Last Post: 30th September 2008, 19:04
  4. Independant window in an application
    By titoo in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2007, 11:07

Tags for this Thread

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.