Results 1 to 11 of 11

Thread: How to change the app resolution

  1. #1
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to change the app resolution

    Hi!

    I'm making a new GUI app and I want it to show up with a especific resolution, so when in main.cpp I say w.show() it runs in 550x300. I've tried w.resize() but it just shows a little part of the screen instead of change its resolution so if I put an element like this:

    Qt Code:
    1. QRect rec = QApplication::desktop()->screenGeometry();
    2. int h= rec.height()/8;
    3. int w= rec.width();
    4.  
    5. button->setMinimumSize(w,h); //this button will fit inside the screen with full width
    6. button->setMaximumSize(w,h);
    To copy to clipboard, switch view to plain text mode 

    with the resize I just see a part of the button and I should see it complety.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to change the app resolution

    So what is your question?

    How is setting a fixes size on a button related to resizing any window?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to change the app resolution

    No,

    My question is:

    if my ui size its 300,300 and I put w.show() it will show up as 300 300. If I put a w.showFullScreen() it will be 1920x1080 which is my actual computer screen. What I want is to set that screen at 550x300 when showing it and I know that w.resize isn't the answer.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to change the app resolution

    Hmm, resize should work. When you resize(550, 300) how large does the window appear?

    Cheers,
    _

  5. #5
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to change the app resolution

    [edited]

    w.show()
    result: 300x300 which is the ui size


    w.resize(550,300);
    w.show();
    result: 550 300 with just a little part shown of the buttons and things inside

    BUT when I change to the next page (its a wizard structure with wizardpages) then the next page became full screen on the width ... dunno if its because the buttons inside are like I said in the first post.
    Last edited by roseicollis; 20th January 2015 at 12:49.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to change the app resolution

    Quote Originally Posted by roseicollis View Post
    [edited]

    w.show()
    result: 300x300 which is the ui size


    w.resize(550,300);
    w.show();
    result: 550 300 with just a little part shown of the buttons and things inside
    So, do I understand this correctly: then it shows by itself in 300x300 all "things inside" fit, but when you make it larger it no longer does?

    Cheers,
    _

  7. #7
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,391
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to change the app resolution

    result: 550 300 with just a little part shown of the buttons and things inside
    Does the widget have a layout ?

  8. #8
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to change the app resolution

    Nop XD Sorry for my bad explanation. If I resize its like if I had the fullscreen with all the elements in their right place and size and I cut a square of 550, 330 more or less so I just see a part of a label, and a part of a button. And when I change to the next page, the app becames 1920x300 (the same high but the computer screen max width).

    yes stampede
    Last edited by roseicollis; 20th January 2015 at 15:05.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to change the app resolution

    Show us your widget layout definition, please. And maybe show us a screenshot of what the problem is about.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to change the app resolution

    Hi, I just found a way to do it:

    I jsut fix it with setFixedSize(), and then change the sizes.

    thank you for all

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to change the app resolution

    Quote Originally Posted by roseicollis View Post
    Hi, I just found a way to do it:

    I jsut fix it with setFixedSize(), and then change the sizes.

    thank you for all
    I don't know what this is supposed to accomplish but it's probably a very bad approach. I'm still suspecting you don't have a proper layout setup.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 26th November 2011, 11:09
  2. Application Resizing on Display resolution change
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2010, 12:12
  3. Resolution Spectrogram
    By edney in forum Qwt
    Replies: 3
    Last Post: 13th April 2010, 07:44
  4. Change The VGA Resolution On The Fly
    By guninia in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 11th November 2009, 06:22

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.