0

I want to use two GUI windows when I start my appliction. For this, I have implimented Qt Designer Form Class (named it AnotherWindow) and implimented the following inside my MainWindow constructor:

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

    anotherWindow = new AnotherWindow(); // will destroy it in corresponding destructor
    anotherWindow->setWindowTitle("anotherWindow");
    anotherWindow->show();
}

The code works correctly and when I run the application, two windows are created (mainWindow followed by anotherWindow). However, these windows overlap each other when I run the application. Is it possible to display these windows adjacent to each other instead of overlapping? I do not want to drag the overlapped windows adjecent to each other everytime I run my application. I have already looked this question How to show another window from mainwindow in QT, which wasn't helpful.

Rishu Singh
  • 49
  • 1
  • 11

0 Answers0