0

geom does not work right. When you define a new position for the window, part of it is off screen. How to solve this problem?

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QRect test(0,0,300,240);
    setGeometry(test);
}

MainWindow::~MainWindow()
{
    delete ui;
}
Protomen
  • 9,471
  • 9
  • 57
  • 124

1 Answers1

0

Solved:

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QRect test(0,0,300,240);
    setGeometry(test);
    move(0,0);//Fix
}
Protomen
  • 9,471
  • 9
  • 57
  • 124