Skip to content

Commit

Permalink
Fix the initial position of the window
Browse files Browse the repository at this point in the history
  • Loading branch information
CineEncoder committed Jul 23, 2023
1 parent dd7b1f6 commit e8b4053
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <QFile>
#include <QSizePolicy>
#include <QTranslator>
#include <QScreen>
#include <iostream>
#include <iomanip>
#include <cmath>
Expand Down Expand Up @@ -803,9 +804,9 @@ void MainWindow::setParameters() // Set parameters
stn.endGroup();

} else {
const QSize delta = QApplication::desktop()->size() - WINDOW_SIZE;
const QPointF topLeft(float(delta.width())/2, float(delta.height())/2);
const QRect rect(topLeft.toPoint(), WINDOW_SIZE);
const QRect scr_rect = QApplication::primaryScreen()->availableGeometry();
const QPoint topLeft = scr_rect.translated(100,100).topLeft();
const QRect rect(topLeft, WINDOW_SIZE);
setGeometry(rect);

ui->treeWidget->setColumnWidth(0, 230);
Expand Down

0 comments on commit e8b4053

Please sign in to comment.