Hello everybody!

How to correctly set up geometry of two daughter windows (inherited from QDialog class) below main window (inherited from QMainWindow).
The problem is that I cannot place all 3 windows exactly close to each other one by one.
What I have is overlapping or some distance between borders of windows, etc.


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

QRect screenGeometry = QApplication::desktop()->screenGeometry();
int MainWinWidth = 240;
int MainWinHeight = 120;
this->setWindowTitle("Main Window");
this->setFixedSize(MainWinWidth, MainWinHeight);
this->move(screenGeometry.width() - this->width(), screenGeometry.top());
this->show();

QRect MainWinRect = this->geometry();
int VerWinHeight = 300;
fVerSec = new VerticalSection(this);
fVerSec->setWindowTitle(tr("Vertical Section"));
fVerSec->resize(this->width(), VerWinHeight);
fVerSec->move(this->geometry().left(), this->geometry().top() + this->height() - 1);
fVerSec->show();

flist_vsf = new list_vsf(this);
flist_vsf->setWindowTitle(tr("Scans"));
flist_vsf->resize(this->width(), screenGeometry.height() - fVerSec->geometry().top() - fVerSec->height());
flist_vsf->move(this->geometry().left(), fVerSec->geometry().top() + fVerSec->geometry().height());
flist_vsf->show();
}