Results 1 to 3 of 3

Thread: How to make a resolution independent Ui

  1. #1
    Join Date
    Dec 2012
    Posts
    45
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default How to make a resolution independent Ui

    Is there any other way to make my Ui resolution independent. Right now i am using my own function to do so

    QDesktopWidget *mydesk = new QDesktopWidget() ;
    double width = mydesk->width();
    double hight = mydesk->height();
    X_resolution = width/1600;
    Y_resolution = hight/900;
    and i am multiplying the controlls by this factor

    ui->SRP_labelY_8->setGeometry(static_cast<int>(ui->SRP_labelY_8->pos().x()*X_resolution), static_cast<int>(ui->SRP_labelY_8->pos().y()*Y_resolution), static_cast<int>(ui->SRP_labelY_8->size().width()*X_resolution), static_cast<int>(ui->SRP_labelY_8->size().height()*Y_resolution));
    Is there some other way to do so ??

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make a resolution independent Ui

    Is the layout manager does not solve your problem ?

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

    Default Re: How to make a resolution independent Ui

    For resolution independent UI one would usually use QtQuick.
    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. DLL independent development?
    By Sia in forum Qt Programming
    Replies: 4
    Last Post: 5th December 2011, 11:57
  2. QRegExp independent subexpressions
    By Nik8768 in forum Newbie
    Replies: 9
    Last Post: 18th April 2010, 23:28
  3. Platform independent GUI
    By bnilsson in forum Qt Programming
    Replies: 39
    Last Post: 28th November 2009, 11:00
  4. Replies: 3
    Last Post: 16th June 2009, 08:04
  5. Replies: 1
    Last Post: 27th March 2008, 15:10

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.