Resolved issue #414. Add features from Qt Windows Extras.
--HG-- branch : develop
This commit is contained in:
parent
14d5cf25ad
commit
f26087350d
|
@ -41,6 +41,7 @@
|
||||||
- [#392] Improve feature: Show progress bar while opening pattern file.
|
- [#392] Improve feature: Show progress bar while opening pattern file.
|
||||||
- [#732] Tape app. Improve Database dialog.
|
- [#732] Tape app. Improve Database dialog.
|
||||||
- [#804] New feature. Import measurements from CSV file in Tape app.
|
- [#804] New feature. Import measurements from CSV file in Tape app.
|
||||||
|
- [#414] Add features from Qt Windows Extras.
|
||||||
|
|
||||||
# Version 0.5.1
|
# Version 0.5.1
|
||||||
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
||||||
|
|
|
@ -88,6 +88,11 @@
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
#include <QWinTaskbarButton>
|
||||||
|
#include <QWinTaskbarProgress>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QDrag>
|
#include <QDrag>
|
||||||
|
@ -176,6 +181,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
InitToolButtons();
|
InitToolButtons();
|
||||||
|
|
||||||
m_progressBar->setVisible(false);
|
m_progressBar->setVisible(false);
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setVisible(false);
|
||||||
|
#endif
|
||||||
m_statusLabel->setText(tr("Create new pattern piece to start working."));
|
m_statusLabel->setText(tr("Create new pattern piece to start working."));
|
||||||
statusBar()->addPermanentWidget(m_statusLabel, 1);
|
statusBar()->addPermanentWidget(m_statusLabel, 1);
|
||||||
statusBar()->addPermanentWidget(m_progressBar, 1);
|
statusBar()->addPermanentWidget(m_progressBar, 1);
|
||||||
|
@ -1456,6 +1464,10 @@ void MainWindow::showEvent( QShowEvent *event )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarButton->setWindow(windowHandle());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (isInitialized)
|
if (isInitialized)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -2982,6 +2994,9 @@ void MainWindow::Clear()
|
||||||
toolOptions->ClearPropertyBrowser();
|
toolOptions->ClearPropertyBrowser();
|
||||||
toolOptions->itemClicked(nullptr);
|
toolOptions->itemClicked(nullptr);
|
||||||
m_progressBar->setVisible(false);
|
m_progressBar->setVisible(false);
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setVisible(false);
|
||||||
|
#endif
|
||||||
m_statusLabel->setVisible(true);
|
m_statusLabel->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3457,7 +3472,11 @@ void MainWindow::ShowProgress()
|
||||||
{
|
{
|
||||||
if (m_progressBar->isVisible() && m_progressBar->value() + 1 <= m_progressBar->maximum())
|
if (m_progressBar->isVisible() && m_progressBar->value() + 1 <= m_progressBar->maximum())
|
||||||
{
|
{
|
||||||
m_progressBar->setValue(m_progressBar->value() + 1);
|
const int newValue = m_progressBar->value() + 1;
|
||||||
|
m_progressBar->setValue(newValue);
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setValue(newValue);
|
||||||
|
#endif
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4558,9 +4577,19 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
|
||||||
|
|
||||||
m_progressBar->setVisible(true);
|
m_progressBar->setVisible(true);
|
||||||
m_statusLabel->setVisible(false);
|
m_statusLabel->setVisible(false);
|
||||||
m_progressBar->setMaximum(doc->ElementsToParse());
|
const int elements = doc->ElementsToParse();
|
||||||
|
m_progressBar->setMaximum(elements);
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setVisible(true);
|
||||||
|
m_taskbarProgress->setMaximum(elements);
|
||||||
|
#endif
|
||||||
|
|
||||||
FullParseFile();
|
FullParseFile();
|
||||||
|
|
||||||
m_progressBar->setVisible(false);
|
m_progressBar->setVisible(false);
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setVisible(false);
|
||||||
|
#endif
|
||||||
m_statusLabel->setVisible(true);
|
m_statusLabel->setVisible(true);
|
||||||
|
|
||||||
if (guiEnabled)
|
if (guiEnabled)
|
||||||
|
|
|
@ -58,6 +58,11 @@
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
#include <QPrinterInfo>
|
#include <QPrinterInfo>
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
#include <QWinTaskbarButton>
|
||||||
|
#include <QWinTaskbarProgress>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
# define PDFTOPS "pdftops.exe"
|
# define PDFTOPS "pdftops.exe"
|
||||||
#else
|
#else
|
||||||
|
@ -134,12 +139,22 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
||||||
margins(),
|
margins(),
|
||||||
paperSize(),
|
paperSize(),
|
||||||
m_dialogSaveLayout(),
|
m_dialogSaveLayout(),
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||||
|
m_taskbarProgress(nullptr),
|
||||||
|
#endif
|
||||||
isTiled(false),
|
isTiled(false),
|
||||||
isAutoCrop(false),
|
isAutoCrop(false),
|
||||||
isUnitePages(false),
|
isUnitePages(false),
|
||||||
layoutPrinterName()
|
layoutPrinterName()
|
||||||
{
|
{
|
||||||
InitTempLayoutScene();
|
InitTempLayoutScene();
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarButton->setWindow(this->windowHandle());
|
||||||
|
m_taskbarProgress = m_taskbarButton->progress();
|
||||||
|
m_taskbarProgress->setMinimum(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -182,6 +197,12 @@ bool MainWindowsNoGUI::LayoutSettings(VLayoutGenerator& lGenerator)
|
||||||
DialogLayoutProgress progress(listDetails.count(), this);
|
DialogLayoutProgress progress(listDetails.count(), this);
|
||||||
if (VApplication::IsGUIMode())
|
if (VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
m_taskbarProgress->setVisible(true);
|
||||||
|
m_taskbarProgress->setValue(0);
|
||||||
|
m_taskbarProgress->setMaximum(listDetails.count());
|
||||||
|
connect(&lGenerator, &VLayoutGenerator::Arranged, m_taskbarProgress, &QWinTaskbarProgress::setValue);
|
||||||
|
#endif
|
||||||
connect(&lGenerator, &VLayoutGenerator::Start, &progress, &DialogLayoutProgress::Start);
|
connect(&lGenerator, &VLayoutGenerator::Start, &progress, &DialogLayoutProgress::Start);
|
||||||
connect(&lGenerator, &VLayoutGenerator::Arranged, &progress, &DialogLayoutProgress::Arranged);
|
connect(&lGenerator, &VLayoutGenerator::Arranged, &progress, &DialogLayoutProgress::Arranged);
|
||||||
connect(&lGenerator, &VLayoutGenerator::Error, &progress, &DialogLayoutProgress::Error);
|
connect(&lGenerator, &VLayoutGenerator::Error, &progress, &DialogLayoutProgress::Error);
|
||||||
|
@ -194,6 +215,13 @@ bool MainWindowsNoGUI::LayoutSettings(VLayoutGenerator& lGenerator)
|
||||||
}
|
}
|
||||||
lGenerator.Generate();
|
lGenerator.Generate();
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
if (VApplication::IsGUIMode())
|
||||||
|
{
|
||||||
|
m_taskbarProgress->setVisible(false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (lGenerator.State())
|
switch (lGenerator.State())
|
||||||
{
|
{
|
||||||
case LayoutErrors::NoError:
|
case LayoutErrors::NoError:
|
||||||
|
|
|
@ -42,6 +42,11 @@ class QGraphicsScene;
|
||||||
struct PosterData;
|
struct PosterData;
|
||||||
class QGraphicsRectItem;
|
class QGraphicsRectItem;
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
class QWinTaskbarButton;
|
||||||
|
class QWinTaskbarProgress;
|
||||||
|
#endif
|
||||||
|
|
||||||
class MainWindowsNoGUI : public VAbstractMainWindow
|
class MainWindowsNoGUI : public VAbstractMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -92,6 +97,11 @@ protected:
|
||||||
|
|
||||||
QSharedPointer<DialogSaveLayout> m_dialogSaveLayout;
|
QSharedPointer<DialogSaveLayout> m_dialogSaveLayout;
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
QWinTaskbarButton *m_taskbarButton;
|
||||||
|
QWinTaskbarProgress *m_taskbarProgress;
|
||||||
|
#endif
|
||||||
|
|
||||||
static QVector<VLayoutPiece> PrepareDetailsForLayout(const QHash<quint32, VPiece> &details);
|
static QVector<VLayoutPiece> PrepareDetailsForLayout(const QHash<quint32, VPiece> &details);
|
||||||
|
|
||||||
void ExportData(const QVector<VLayoutPiece> &listDetails);
|
void ExportData(const QVector<VLayoutPiece> &listDetails);
|
||||||
|
|
|
@ -13,6 +13,11 @@ include(../../../common.pri)
|
||||||
# library in installer.
|
# library in installer.
|
||||||
QT += core gui widgets xml svg printsupport xmlpatterns concurrent
|
QT += core gui widgets xml svg printsupport xmlpatterns concurrent
|
||||||
|
|
||||||
|
# Use winextras only for Windows 7+
|
||||||
|
win32:greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 6) {
|
||||||
|
QT += winextras
|
||||||
|
}
|
||||||
|
|
||||||
# We want create executable file
|
# We want create executable file
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
|
@ -304,6 +309,11 @@ win32:*g++* {
|
||||||
$$[QT_INSTALL_BINS]/libstdc++-6.dll \
|
$$[QT_INSTALL_BINS]/libstdc++-6.dll \
|
||||||
$$[QT_INSTALL_BINS]/libwinpthread-1.dll
|
$$[QT_INSTALL_BINS]/libwinpthread-1.dll
|
||||||
|
|
||||||
|
# For support Windows 7+
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 6) {
|
||||||
|
package.files += $$[QT_INSTALL_BINS]/Qt5WinExtras.dll
|
||||||
|
}
|
||||||
|
|
||||||
package.CONFIG = no_check_exist
|
package.CONFIG = no_check_exist
|
||||||
INSTALLS += package
|
INSTALLS += package
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user