Results 1 to 1 of 1

Thread: resizing based om the system screen resolutions

  1. #1
    Join Date
    Sep 2024
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question resizing based om the system screen resolutions

    HI ALL,
    Iam newbie to this Qt5 ,HERE i want to resize my gui based on system resolutions. and my application screen is like 768x1024 size for 1920 x 1080 system resolution. iam using the resize as

    Qt Code:
    1. QScreen *screen = QGuiApplication::primaryScreen();
    2. if (screen) {
    3. QRect screenGeometry = screen->geometry();
    4. int screenWidth = screenGeometry.width();
    5. int screenHeight = screenGeometry.height();
    6. this->resize(screenWidth, screenHeight);
    7. }
    To copy to clipboard, switch view to plain text mode 
    Screen Size: 800 x 600
    Window Size: 800 x 600

    Screen Size: 1920 x 1080
    Window Size: 1920 x 1080

    Screen Size: 1680 x 1050
    Window Size: 1680 x 1050

    if i use
    Qt Code:
    1. const int defaultWidth = 768;
    2. const int defaultHeight = 1024;
    3. this->resize(defaultWidth,defaultHeight);
    To copy to clipboard, switch view to plain text mode 

    Screen Size: 1920 x 1080
    Window Size: 768 x 1024

    Screen Size: 800 x 600
    Window Size: 800 x 600 its fit to the screen but i need it in 450x600 resolutions according to the 768x1024 gui screen size .
    Last edited by d_stranz; 19th September 2024 at 18:08. Reason: missing [code] tags

Similar Threads

  1. Replies: 2
    Last Post: 23rd July 2019, 19:14
  2. Replies: 4
    Last Post: 27th August 2013, 14:49
  3. Resizing screen dimensions using backbuffer in QT?
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2007, 23:13
  4. QTimer based Splash Screen
    By bpetty in forum Newbie
    Replies: 6
    Last Post: 15th December 2006, 00:51
  5. Dialog sizes and different screen resolutions.
    By hvengel in forum Qt Tools
    Replies: 3
    Last Post: 2nd April 2006, 10:05

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.