window size of PictureDialog get calculated
This commit is contained in:
parent
880a309716
commit
a2bd3db109
1 changed files with 10 additions and 3 deletions
|
@ -61,6 +61,7 @@ PictureDialog::~PictureDialog()
|
||||||
void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath, bool readOk)
|
void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath, bool readOk)
|
||||||
{
|
{
|
||||||
// Showing error if reading error
|
// Showing error if reading error
|
||||||
|
QImage snapmaticPicture;
|
||||||
picPath = picturePath;
|
picPath = picturePath;
|
||||||
smpic = picture;
|
smpic = picture;
|
||||||
if (!readOk)
|
if (!readOk)
|
||||||
|
@ -71,7 +72,8 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString pictu
|
||||||
|
|
||||||
if (picture->isPicOk())
|
if (picture->isPicOk())
|
||||||
{
|
{
|
||||||
ui->labPicture->setPixmap(QPixmap::fromImage(picture->getPicture(), Qt::AutoColor));
|
snapmaticPicture = picture->getPicture();
|
||||||
|
ui->labPicture->setPixmap(QPixmap::fromImage(snapmaticPicture, Qt::AutoColor));
|
||||||
ui->cmdExport->setEnabled(true);
|
ui->cmdExport->setEnabled(true);
|
||||||
}
|
}
|
||||||
if (picture->isJsonOk())
|
if (picture->isJsonOk())
|
||||||
|
@ -115,8 +117,13 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString pictu
|
||||||
QMessageBox::warning(this,tr("Snapmatic Picture Viewer"),tr("Failed at %1").arg(picture->getLastStep()));
|
QMessageBox::warning(this,tr("Snapmatic Picture Viewer"),tr("Failed at %1").arg(picture->getLastStep()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setMinimumSize(this->geometry().size());
|
int jsn_h = ui->jsonFrame->height();
|
||||||
this->setMaximumSize(this->geometry().size());
|
int spc_h = layout()->spacing();
|
||||||
|
int pix_h = snapmaticPicture.height();
|
||||||
|
int frm_h = jsn_h+spc_h+pix_h;
|
||||||
|
|
||||||
|
this->setMinimumSize(960, frm_h);
|
||||||
|
this->setMaximumSize(960, frm_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PictureDialog::on_playerNameUpdated()
|
void PictureDialog::on_playerNameUpdated()
|
||||||
|
|
Loading…
Reference in a new issue