PDA

View Full Version : Problem in size of window.



Niamita
10th June 2011, 07:33
Hi all
I am facing a big problem i am developing a application in which i draw buttons through paint on the fixed cordinate according to the desktop screen size, now the problem is that if screen size decreased then my all drawing should adjust according to the screen but it is not happening, what should i have to do for achieving the same either i should make a formula for height and width and then set drawing cordinates on the basis of screen size of device or is there any other way to do this.

Can with the help of spacer it can do so that according to the screen of corresponding device the painted button should adjust.

I draw the shape on frame and then this frame is set over the MainWindow.

I have to develop same application for tablet as well as for mobile.
Please help me.

dpatel
10th June 2011, 07:59
You can create layout and widgets to it. Qt provides various layouts (QVBoxLayout,QHBoxLayout etc.) to use. Search 'Layout Management" in Qt Assistant and you will get all the information that you need.

deepal_de
10th June 2011, 08:02
How about adding your buttons to a layout,then it will auto resize..

Niamita
10th June 2011, 08:28
They are not button they are painted shape so how i can add them in a layout.

Santosh Reddy
10th June 2011, 08:34
I am facing a big problem i am developing a application in which i draw buttons through paint on the fixed cordinate according to the desktop screen size, now the problem is that if screen size decreased then my all drawing should adjust according to the screen but it is not happening,
If you are fixing the coordinates, then they will remain their as long you don't change them, if you want then coordinates to be updated as per the window size and shape automatically, you should be using one the layout managers (QHBoxLayout / QGridLayout etc). As indicated in earlier posts read about Layout Management


They are not button they are painted shape so how i can add them in a layout.

How did you paint them? did you use QWidget?

Niamita
10th June 2011, 10:50
i paint them on a frame, and they are in hexagon shape and join to each other.

Santosh Reddy
10th June 2011, 12:40
Looks like from your description of the app, you should be using QGraphicsScene and QGraphcisView, not QFrame to paint. Review your requirements.