November 23, 2011

raghavendraLN raghavendraLN
Lab Rat
11 posts

Changing resolution at run time by qt app

 

Hi, Hay anybody can tell me how to use QScreen with an example.By which i wanted to change resolution of qt app at run time.
Thanks in advance

7 replies

November 23, 2011

raghavendraLN raghavendraLN
Lab Rat
11 posts

Hi, I wanted to switch from LCD (320X240) to VGA after clicking a button in my qt app.The target is IMX-31.I tried with
system(“echo U:800×600p-60 > /sys/class/graphics/fb0/mode”);
after clicking vga button.
If i cat my fb i am getting 800×600,but screen is not appearing properly on vga.
Can anybody help me..?

November 23, 2011

Andre Andre
Area 51 Engineer
6031 posts

moderator note:
I merged your two topics, as they are on the same issue. Please stick to a single topic for an issue.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

November 23, 2011

qtd1d1 qtd1d1
Lab Rat
71 posts

Did you try the fbset command?

  1. fbset -g 320 240 320 240 32 -fb /dev/fb0

Try this.. but propably you will need to set the timings with the -t parameter.

November 24, 2011

raghavendraLN raghavendraLN
Lab Rat
11 posts

Hi,

fbset -g didn’t work out.And i tried with -t option also.But it also didn,t work ou.Any other way..?

November 24, 2011

qtd1d1 qtd1d1
Lab Rat
71 posts

Search in google for the pdf of the VESA display standard document. It contains everything you need for display timings. I don’t know how much you know about timings (I’m not an expert) but it’s complicated. In my project it took me 3 days to set the video output to 1440×900 with the correct timings. If theres something wrong with the timings it won’t work…

If it still doesn’t work you have to check which framebuffer your application is using.
A simple way to do this is (your application should run during the check):

  1. cat /dev/fb0

try this from fb0 to fb2.
You will recognize the right framebuffer when u see wired symbols on the commandline.

When you know which framebuffer is used, you have to modify your fbset command

  1. fbset -g ... -t ... -fb /dev/fbX

X is the value for the valid framebuffer.

November 24, 2011

qtd1d1 qtd1d1
Lab Rat
71 posts

To calculate the timings there’s actually a tool called universal modeline calculator. It calculates you the timings you need for fbset from a X11 modeline specification.

I found it for you:

Modeline “320×240” 15.75 320 336 384 400 240 244 246 262

Download the UMC here [umc.sourceforge.net]
Install it and use it to calculate your fbset timings using the Modeline “320×240” …

With the correct framebuffer it should work

July 26, 2012

atluft atluft
Lab Rat
5 posts

Did anyone figure this out?

How at runtime can an embedded QT app change the QWS screen resolution?

If QT app is running (say as a QWS server) and the display resolution is changed from 1080p to 720p (by fbset or by switching displays or by user choice) then how should a QT application respond to paint itself correctly?

Today, after resolution changes it appears that QT continues to paint the original resolution (and I am not sure why it would change since nobody told it that the framebuffer has changed). The issue of how QT app knows resolution changed aside. What are the mechanics of writing to the framebuffer using the new and correct resolution values returned by the ioctl FBIOGET_VSCREENINFO?

Restarting the entire application works. How about something more subtle?

 
  ‹‹ QLineEdit: selectAll() selects text but does not show any visible selection (Embedded Linux)      Any hints to, how write code for non touchscreen phones. ››

You must log in to post a reply. Not a member yet? Register here!