Results 1 to 7 of 7

Thread: Problem in size of window.

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Problem in size of window.

    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.

  2. #2
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem in size of window.

    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.

  3. #3
    Join Date
    Jan 2011
    Location
    Sri Lanaka
    Posts
    64
    Thanks
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Problem in size of window.

    How about adding your buttons to a layout,then it will auto resize..

  4. #4
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Problem in size of window.

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

  5. #5
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Problem in size of window.

    Quote Originally Posted by Niamita
    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

    Quote Originally Posted by Niamita View Post
    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?

  6. #6
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Problem in size of window.

    i paint them on a frame, and they are in hexagon shape and join to each other.

  7. #7
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Problem in size of window.

    Looks like from your description of the app, you should be using QGraphicsScene and QGraphcisView, not QFrame to paint. Review your requirements.

Similar Threads

  1. Get window size prior to showing window?
    By mortoray in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2011, 16:52
  2. Main Window size problem
    By frenk_castle in forum Newbie
    Replies: 2
    Last Post: 20th December 2009, 10:49
  3. Replies: 4
    Last Post: 20th November 2009, 12:25
  4. Window Size
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2009, 13:02
  5. update window size
    By eric in forum Newbie
    Replies: 3
    Last Post: 14th January 2008, 10:21

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.