QWinTaskbarButton not available since Qt 6.

This commit is contained in:
Roman Telezhynskyi 2023-02-28 10:13:18 +02:00
parent bf60cb02b1
commit 934781660a
3 changed files with 14 additions and 14 deletions

View File

@ -216,7 +216,7 @@
#include <QUuid>
#include <chrono>
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#include <QWinTaskbarButton>
#include <QWinTaskbarProgress>
#endif
@ -361,7 +361,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionAddBackgroundImage, &QAction::triggered, this, &MainWindow::ActionAddBackgroundImage);
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setText(tr("Create new pattern piece to start working."));
@ -1750,7 +1750,7 @@ void MainWindow::showEvent( QShowEvent *event )
return;
}
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarButton->setWindow(windowHandle());
#endif
@ -4095,7 +4095,7 @@ void MainWindow::Clear()
m_toolOptions->ClearPropertyBrowser();
m_toolOptions->itemClicked(nullptr);
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setVisible(true);
@ -4510,7 +4510,7 @@ void MainWindow::ShowProgress()
{
const int newValue = m_progressBar->value() + 1;
m_progressBar->setValue(newValue);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setValue(newValue);
#endif
QCoreApplication::processEvents();
@ -6059,7 +6059,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
m_progressBar->setValue(0);
const int elements = doc->ElementsToParse();
m_progressBar->setMaximum(elements);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(true);
m_taskbarProgress->setMaximum(elements);
#endif
@ -6067,7 +6067,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
FullParseFile();
m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(false);
#endif
m_statusLabel->setVisible(true);

View File

@ -128,13 +128,13 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
: VAbstractMainWindow(parent),
pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(),
valentinaNamespace))
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
,m_taskbarButton(new QWinTaskbarButton(this))
#endif
{
InitTempLayoutScene();
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarButton->setWindow(this->windowHandle());
m_taskbarProgress = m_taskbarButton->progress();
m_taskbarProgress->setMinimum(0);
@ -186,14 +186,14 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
QElapsedTimer timer;
timer.start();
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QTimer *progressTimer = nullptr;
#endif
QSharedPointer<DialogLayoutProgress> progress;
if (VApplication::IsGUIMode())
{
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
m_taskbarProgress->setVisible(true);
m_taskbarProgress->setValue(0);
m_taskbarProgress->setMaximum(lGenerator.GetNestingTime()*60);
@ -402,7 +402,7 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
progress->Finished();
}
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
if (VApplication::IsGUIMode())
{
progressTimer->stop();

View File

@ -47,7 +47,7 @@ struct PosterData;
class QGraphicsRectItem;
class VMeasurements;
#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
class QWinTaskbarButton;
class QWinTaskbarProgress;
#endif
@ -119,7 +119,7 @@ protected:
QSharedPointer<DialogSaveLayout> m_dialogSaveLayout{};
#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QWinTaskbarButton *m_taskbarButton;
QWinTaskbarProgress *m_taskbarProgress{nullptr};
#endif