mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
qt 5.15 compatibility (#4027)
This commit is contained in:
parent
0f0e0193c1
commit
7fa1936d0f
27 changed files with 101 additions and 39 deletions
|
|
@ -10,7 +10,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
DlgEditAvatar::DlgEditAvatar(QWidget *parent) : QDialog(parent)
|
||||
DlgEditAvatar::DlgEditAvatar(QWidget *parent) : QDialog(parent), image()
|
||||
{
|
||||
imageLabel = new QLabel(tr("No image chosen."));
|
||||
imageLabel->setFixedSize(400, 200);
|
||||
|
|
@ -55,7 +55,6 @@ void DlgEditAvatar::actBrowse()
|
|||
return;
|
||||
}
|
||||
|
||||
QImage image;
|
||||
QImageReader imgReader;
|
||||
imgReader.setDecideFormatFromContent(true);
|
||||
imgReader.setFileName(fileName);
|
||||
|
|
@ -69,13 +68,9 @@ void DlgEditAvatar::actBrowse()
|
|||
|
||||
QByteArray DlgEditAvatar::getImage()
|
||||
{
|
||||
const QPixmap *pix = imageLabel->pixmap();
|
||||
if (!pix || pix->isNull())
|
||||
return QByteArray();
|
||||
|
||||
QImage image = pix->toImage();
|
||||
if (image.isNull())
|
||||
if (image.isNull()) {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue