diff --git a/libs/graphic/graphic.cpp b/libs/graphic/graphic.cpp index a849158..73da82c 100644 --- a/libs/graphic/graphic.cpp +++ b/libs/graphic/graphic.cpp @@ -251,7 +251,7 @@ void Graphic::timerEvent(QTimerEvent * e) { if (e->timerId() == timer_record) { QPixmap im(canvas->size()); canvas->render(&im); - record_imgs << im.toImage(); + record_imgs << im.toImage().convertToFormat(QImage::Format_Indexed8); } } @@ -1934,6 +1934,7 @@ void Graphic::on_graphic_buttonRecord_clicked(bool checked) { if (record_imgs.isEmpty()) return; QString f = QFileDialog::getSaveFileName(this, tr("Save GIF"), ppath, "GIF(*.gif)"); if (!f.isEmpty()) { + qApp->setOverrideCursor(Qt::BusyCursor); GifWriter gif_writer; int frame_delay = 10; if (GifBegin(&gif_writer, f.toUtf8(), static_cast(record_imgs.first().width()), @@ -1941,7 +1942,7 @@ void Graphic::on_graphic_buttonRecord_clicked(bool checked) { static_cast(frame_delay))) { for (const QImage & im : record_imgs) { if (!GifWriteFrame(&gif_writer, - im.convertToFormat(QImage::Format_Indexed8).convertToFormat(QImage::Format_RGBA8888).constBits(), + im.convertToFormat(QImage::Format_RGBA8888).constBits(), static_cast(im.width()), static_cast(im.height()), static_cast(frame_delay))) { @@ -1951,6 +1952,7 @@ void Graphic::on_graphic_buttonRecord_clicked(bool checked) { } GifEnd(&gif_writer); } + qApp->restoreOverrideCursor(); } record_imgs.clear(); }