Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qapplication size

Qapplication size

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    satyanarayana143
    wrote on last edited by
    #1

    hi freiends,

    i am using QT mainwindow in maximized position i am trying get geometry i am x and y position in negative

    my screen size is width 1920 and 1080 but mt application in maximized position i am getting xpos -8 and ypos -8 width 1920 and height 1017 can i now why it is getting.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Do you have multiple monitors ?

      doing

      showFullScreen();
      qDebug() << geometry();
      

      shows 0,0 and 1920x1080 as expected

      1 Reply Last reply
      1
      • S Offline
        S Offline
        satyanarayana143
        wrote on last edited by
        #3

        i fullscreen i am getting correct but in maximized i want postion.

        mrjjM 1 Reply Last reply
        0
        • S satyanarayana143

          i fullscreen i am getting correct but in maximized i want postion.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @satyanarayana143
          Do you have a frameless window or something like that?

          showMaximized();
          qDebug() << geometry();

          i get the expected values.

          You can try frameGeometry and see if values are more as you expect.
          geometry returns the size minus the decorations. ( captions, borders)

          1 Reply Last reply
          3
          • S Offline
            S Offline
            satyanarayana143
            wrote on last edited by
            #5

            not frameless window

            mrjjM jsulmJ 2 Replies Last reply
            0
            • S satyanarayana143

              not frameless window

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @satyanarayana143
              well i get perfectly normal values.
              Can you show what you do ? (code)

              1 Reply Last reply
              0
              • S satyanarayana143

                not frameless window

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #7

                @satyanarayana143 Where exactly do you call geometry()? If in constructor of your main window then you should do it after the constructor was executed and the main window is actually being shown.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                3
                • J Offline
                  J Offline
                  johnnyfox87
                  wrote on last edited by
                  #8

                  I've got the same problem using two Dell monitors with Qt 5.11.2 and MSVC2017

                  MainWindow::MainWindow(QWidget *parent) :
                      QMainWindow(parent),
                      ui(new Ui::MainWindow)
                  {
                      ui->setupUi(this);
                  }
                  
                  MainWindow::~MainWindow()
                  {
                      delete ui;
                  }
                  
                  void MainWindow::on_pushButton_clicked()
                  {
                      qDebug() << "Pos: " << this->pos();
                  }
                  
                  

                  Output when maximized:

                  Pos:  QPoint(-8,-8)
                  
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved