Hello!
I've wrote simple program that have main window and dialog window which can by open by clicking a button. Code of that dialog window looks like this:
#include <QGridLayout>
#include <QPushButton>
#include <QIcon>
#include "pomiary.h"
{
setupUI();
}
void Pomiary::setupUI()
{
setModal(true);
setGeometry
(QRect(50,
0,
100,
150));
setWindowIcon
(QIcon(":/images/icon.png"));
setLayout(PomiaryLayout);
button
->setIcon
(QIcon(":/images/icon2.png"));
button
->setIconSize
(QSize(48,
48));
button->setFixedSize(60, 60);
PomiaryLayout->addWidget(button,0,0,Qt::AlignHCenter);
}
#include <QGridLayout>
#include <QPushButton>
#include <QIcon>
#include "pomiary.h"
Pomiary::Pomiary(QWidget *parent)
: QDialog(parent)
{
setupUI();
}
void Pomiary::setupUI()
{
setModal(true);
setGeometry(QRect(50,0,100,150));
setWindowIcon(QIcon(":/images/icon.png"));
QGridLayout* PomiaryLayout = new QGridLayout;
setLayout(PomiaryLayout);
QPushButton *button = new QPushButton();
button->setIcon(QIcon(":/images/icon2.png"));
button->setIconSize(QSize(48, 48));
button->setFixedSize(60, 60);
PomiaryLayout->addWidget(button,0,0,Qt::AlignHCenter);
}
To copy to clipboard, switch view to plain text mode
and when I open my application i don't have title bar on dialog window so I can't close it. I've tried to use setWindowFlags() but with no result. Only If I delete 'setGeometry()' window has title bar but is very small, and I want specific size. What I'm doing wrong?
thanks in advance
best regards
Tomasz
Bookmarks