Results 1 to 3 of 3

Thread: Problem scalng the Screen size

  1. #1
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem scalng the Screen size

    Hi,

    I have an issue with scaling screen height and width to display my app on the desktop in full screen mode. I am using QDesktopWidget to scale the screen height and width and set these values to the mainwindow. But while displaying, my app starts somewhere randomly on the screen and half of the part goes beyond the screen. Do I have to use any extra parameters. My code is
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication a(argc, argv);
    4. MainWindow w;
    5. QDesktopWidget *desktop = QApplication::desktop();
    6. int screenWidth = desktop->width();
    7. int screenHeight = desktop->height();
    8. w.setFixedSize(screenWidth,screenHeight);
    9. w.show();
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    Any suggestions would be helpful.

    Thank You,

    Baluk

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem scalng the Screen size

    Try w.move(0,0);
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    baluk (23rd November 2010)

  4. #3
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem scalng the Screen size

    Yes it works fine now. Thanks high_flyer.

Similar Threads

  1. Image - screen size
    By ahmdsd_ostora in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2010, 15:29
  2. Replies: 8
    Last Post: 20th June 2010, 19:15
  3. how to get screen pixel size?
    By kodiak in forum Qt Programming
    Replies: 6
    Last Post: 26th August 2008, 18:59
  4. screen size
    By eric in forum Qt Programming
    Replies: 2
    Last Post: 28th December 2007, 14:54
  5. how to get the screen size in qt2
    By pencilren in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2007, 03:47

Tags for this Thread

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.