diff --git a/sbin/build_deb.sh b/sbin/build_deb.sh index ca426b3..13731f9 100644 --- a/sbin/build_deb.sh +++ b/sbin/build_deb.sh @@ -66,4 +66,4 @@ Description: Lightweight slideshow for photo frames Simple, lightweight slideshow designed for low power devices. EOF -dpkg-deb --build "$STAGE_DIR" "$DIST_DIR/${PACKAGE_NAME}_${VERSION}_${ARCH}.deb" +dpkg-deb --build -Zgzip "$STAGE_DIR" "$DIST_DIR/${PACKAGE_NAME}_${VERSION}_${ARCH}.deb" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 582f888..c2be6bd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,6 +18,7 @@ #include #include #include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -170,11 +171,11 @@ void MainWindow::updateImage() return; QLabel *label = this->findChild("image"); - const QPixmap* oldImage = label->pixmap(); - if (oldImage != NULL && transitionSeconds > 0) + QPixmap oldImage = label->pixmap(Qt::ReturnByValue); + if (!oldImage.isNull() && transitionSeconds > 0) { QPalette palette; - palette.setBrush(QPalette::Background, *oldImage); + palette.setBrush(QPalette::Window, oldImage); this->setPalette(palette); } @@ -213,7 +214,7 @@ void MainWindow::updateImage() label->setPixmap(background); - if (oldImage != NULL && transitionSeconds > 0) + if (!oldImage.isNull() && transitionSeconds > 0) { auto effect = new QGraphicsOpacityEffect(label); effect->setOpacity(0.0); @@ -273,9 +274,9 @@ QPixmap MainWindow::getBlurredBackground(const QPixmap& originalSize, const QPix QPixmap MainWindow::getRotatedPixmap(const QPixmap& p) { - QMatrix matrix; - matrix.rotate(currentImage.rotation); - return p.transformed(matrix); + QTransform transform; + transform.rotate(currentImage.rotation); + return p.transformed(transform); } QPixmap MainWindow::getScaledPixmap(const QPixmap& p) @@ -325,12 +326,12 @@ void MainWindow::drawBackground(const QPixmap& originalSize, const QPixmap& scal QPixmap background = blur(originalSize.scaledToHeight(height())); QRect rect((background.width() - width())/2, 0, width(), height()); background = background.copy(rect); - palette.setBrush(QPalette::Background, background); + palette.setBrush(QPalette::Window, background); } else { QPixmap background = blur(originalSize.scaledToHeight(height())); QRect rect((background.width() - width())/2, 0, width(), height()); background = background.copy(rect); - palette.setBrush(QPalette::Background, background); + palette.setBrush(QPalette::Window, background); } this->setPalette(palette); }