Optimize usage of defglobal.h.
This commit is contained in:
parent
dc625ceaa4
commit
254d32ff7f
|
@ -29,13 +29,15 @@
|
|||
#ifndef VPCARROUSEL_H
|
||||
#define VPCARROUSEL_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QComboBox>
|
||||
#include <QScrollArea>
|
||||
#include <QUuid>
|
||||
#include <QWidget>
|
||||
|
||||
#include "../layout/layoutdef.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
@ -54,6 +56,7 @@ struct VPCarrouselSheet
|
|||
class VPCarrousel : public QWidget
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VPCarrousel(const VPLayoutPtr &layout, QWidget *parent = nullptr);
|
||||
~VPCarrousel() override = default;
|
||||
|
|
|
@ -28,16 +28,21 @@
|
|||
#ifndef VPCARROUSELPIECE_H
|
||||
#define VPCARROUSELPIECE_H
|
||||
|
||||
#include <QMouseEvent>
|
||||
#include <QListWidgetItem>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "../layout/layoutdef.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VPCarrouselPiece : public QListWidgetItem
|
||||
{
|
||||
public:
|
||||
enum { Type = UserType + 1};
|
||||
enum
|
||||
{
|
||||
Type = UserType + 1
|
||||
};
|
||||
|
||||
explicit VPCarrouselPiece(const VPPiecePtr &piece, QListWidget *parent);
|
||||
~VPCarrouselPiece() override = default;
|
||||
|
@ -60,7 +65,6 @@ public:
|
|||
*/
|
||||
auto CreatePieceIcon(const QSize &size, bool isDragIcon = false) const -> QIcon;
|
||||
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(VPCarrouselPiece) // NOLINT
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
#include <QUuid>
|
||||
|
||||
#include "../layout/layoutdef.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VPMimeDataPiece : public QMimeData
|
||||
{
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include <QWidget>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "../vlayout/dialogs/vabstractlayoutdialog.h"
|
||||
#include "../vlayout/vlayoutdef.h"
|
||||
#include "../vmisc/defglobal.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include <QPainter>
|
||||
|
||||
#include "../layout/layoutdef.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VPLayout;
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <QPainter>
|
||||
#include <QUuid>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include "../layout/layoutdef.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
|
|
|
@ -28,12 +28,14 @@
|
|||
#ifndef VPCOMMANDLINE_H
|
||||
#define VPCOMMANDLINE_H
|
||||
|
||||
#include <memory>
|
||||
#include <QCoreApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <ciso646>
|
||||
#include <memory>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VPCommandLine;
|
||||
using VPCommandLinePtr = std::shared_ptr<VPCommandLine>;
|
||||
|
@ -41,6 +43,7 @@ using VPCommandLinePtr = std::shared_ptr<VPCommandLine>;
|
|||
class VPCommandLine : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
~VPCommandLine() override = default;
|
||||
|
||||
|
@ -57,12 +60,14 @@ public:
|
|||
auto IsNoScalingEnabled() const -> bool;
|
||||
|
||||
Q_NORETURN void ShowHelp(int exitCode = 0);
|
||||
|
||||
protected:
|
||||
VPCommandLine();
|
||||
|
||||
/** @brief create the single instance of the class inside vpapplication */
|
||||
static auto Instance() -> VPCommandLinePtr;
|
||||
static void ProcessInstance(VPCommandLinePtr &instance, const QStringList &arguments);
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(VPCommandLine) // NOLINT
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include "../vmisc/literals.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vwidgets/vmaingraphicsscene.h"
|
||||
#include "layout/vplayout.h"
|
||||
#include "layout/vpsheet.h"
|
||||
#include "qobject.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#ifndef VPTILEFACTORY_H
|
||||
#define VPTILEFACTORY_H
|
||||
|
||||
#include <QtMath>
|
||||
#include <QObject>
|
||||
#include <QtMath>
|
||||
|
||||
#include "layout/vplayout.h"
|
||||
#include "../ifc/ifcdef.h"
|
||||
#include "layout/layoutdef.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
@ -51,6 +53,7 @@ public:
|
|||
~DialogTapePreferences() override;
|
||||
signals:
|
||||
void UpdateProperties();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
@ -59,6 +62,7 @@ private slots:
|
|||
void Apply();
|
||||
void Ok();
|
||||
void PageChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(DialogTapePreferences) // NOLINT
|
||||
|
|
|
@ -29,13 +29,15 @@
|
|||
#ifndef VFORMULAPROPERTYEDITOR_H
|
||||
#define VFORMULAPROPERTYEDITOR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QToolButton>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
|
||||
#include "../vpatterndb/vformula.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VFormulaPropertyEditor : public QWidget
|
||||
{
|
||||
|
@ -75,5 +77,4 @@ private:
|
|||
QLabel *m_TextLabel{nullptr};
|
||||
};
|
||||
|
||||
|
||||
#endif // VFORMULAPROPERTYEDITOR_H
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -29,11 +29,13 @@
|
|||
#ifndef DIALOGDATETIMEFORMATS_H
|
||||
#define DIALOGDATETIMEFORMATS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDate>
|
||||
#include <QDialog>
|
||||
#include <QTime>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include <QElapsedTimer>
|
||||
#include <QTimer>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include <QMap>
|
||||
#include <QPointer>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VPattern;
|
||||
class VContainer;
|
||||
|
@ -49,11 +51,13 @@ namespace Ui
|
|||
class DialogPatternProperties : public QDialog
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent = nullptr);
|
||||
~DialogPatternProperties() override;
|
||||
signals:
|
||||
void UpddatePieces();
|
||||
|
||||
protected:
|
||||
auto eventFilter(QObject *object, QEvent *event) -> bool override;
|
||||
private slots:
|
||||
|
@ -65,6 +69,7 @@ private slots:
|
|||
void ShowImage();
|
||||
void BrowseLabelPath();
|
||||
void LabelPathChanged(const QString &text);
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(DialogPatternProperties) // NOLINT
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
@ -53,12 +55,14 @@ public:
|
|||
~DialogPreferences() override;
|
||||
signals:
|
||||
void UpdateProperties();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void changeEvent(QEvent *event) override;
|
||||
private slots:
|
||||
void PageChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(DialogPreferences) // NOLINT
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QWidget>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VAbstractPattern;
|
||||
class VContainer;
|
||||
|
|
|
@ -29,9 +29,11 @@
|
|||
#ifndef VWIDGETGROUPS_H
|
||||
#define VWIDGETGROUPS_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "../vmisc/typedef.h"
|
||||
#include <QWidget>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class QTableWidgetItem;
|
||||
class VAbstractPattern;
|
||||
|
|
|
@ -28,11 +28,14 @@
|
|||
#include <QUrl>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class FvAvailableUpdate final : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit FvAvailableUpdate(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class QGraphicsScene;
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
#include "qmuparserdef.h"
|
||||
#include "qmutranslation.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
/** @file
|
||||
@brief This file defines the error class used by the parser.
|
||||
|
|
|
@ -14,11 +14,15 @@
|
|||
#define DXFREADER_H
|
||||
|
||||
#include "drw_textcodec.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class dxfReader {
|
||||
class dxfReader
|
||||
{
|
||||
public:
|
||||
enum TYPE {
|
||||
enum TYPE
|
||||
{
|
||||
STRING,
|
||||
INT32,
|
||||
INT64,
|
||||
|
@ -27,6 +31,7 @@ public:
|
|||
INVALID
|
||||
};
|
||||
TYPE type;
|
||||
|
||||
public:
|
||||
explicit dxfReader(std::istream *stream)
|
||||
: type(INVALID),
|
||||
|
@ -37,7 +42,8 @@ public:
|
|||
int64(),
|
||||
skip(),
|
||||
decoder()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~dxfReader() = default;
|
||||
auto readRec(int *codeData) -> bool;
|
||||
|
@ -74,17 +80,21 @@ protected:
|
|||
signed int intData; // 32 bits integer
|
||||
unsigned long long int int64; // 64 bits integer
|
||||
bool skip; // set to true for ascii dxf, false for binary
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(dxfReader) // NOLINT
|
||||
DRW_TextCodec decoder;
|
||||
bool m_bIgnoreComments{false};
|
||||
};
|
||||
|
||||
class dxfReaderBinary : public dxfReader {
|
||||
class dxfReaderBinary : public dxfReader
|
||||
{
|
||||
public:
|
||||
explicit dxfReaderBinary(std::istream *stream)
|
||||
: dxfReader(stream)
|
||||
{skip = false; }
|
||||
{
|
||||
skip = false;
|
||||
}
|
||||
|
||||
virtual ~dxfReaderBinary() = default;
|
||||
virtual auto readCode(int *code) -> bool override;
|
||||
|
@ -98,11 +108,14 @@ public:
|
|||
virtual auto readBool() -> bool override;
|
||||
};
|
||||
|
||||
class dxfReaderAscii final : public dxfReader {
|
||||
class dxfReaderAscii final : public dxfReader
|
||||
{
|
||||
public:
|
||||
explicit dxfReaderAscii(std::istream *stream)
|
||||
: dxfReader(stream)
|
||||
{skip = true; }
|
||||
{
|
||||
skip = true;
|
||||
}
|
||||
|
||||
virtual ~dxfReaderAscii() = default;
|
||||
virtual auto readCode(int *code) -> bool override;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#ifndef VHPGLENGINE_H
|
||||
#define VHPGLENGINE_H
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#include <QPoint>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -32,14 +32,17 @@
|
|||
#include <QComboBox>
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
enum class Unit : qint8;
|
||||
|
||||
class VAbstractLayoutDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
enum class PaperSizeTemplate : qint8 {
|
||||
enum class PaperSizeTemplate : qint8
|
||||
{
|
||||
A0 = 0,
|
||||
A1,
|
||||
A2,
|
||||
|
@ -73,7 +76,6 @@ protected:
|
|||
|
||||
static auto RoundTemplateSize(qreal width, qreal height, Unit unit) -> QSizeF;
|
||||
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VAbstractLayoutDialog) // NOLINT
|
||||
};
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -41,7 +41,10 @@
|
|||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QLockFile>
|
||||
|
@ -54,14 +57,12 @@
|
|||
* On older Qt lock assumed always taken and compile-time warning is shown.
|
||||
*
|
||||
*/
|
||||
template <typename Guarded>
|
||||
class VLockGuard
|
||||
template <typename Guarded> class VLockGuard
|
||||
{
|
||||
public:
|
||||
explicit VLockGuard(const QString &lockName, int stale = 0, int timeout = 0);
|
||||
|
||||
template <typename Alloc>
|
||||
VLockGuard(const QString& lockName, Alloc a, int stale = 0, int timeout=0);
|
||||
template <typename Alloc> VLockGuard(const QString &lockName, Alloc a, int stale = 0, int timeout = 0);
|
||||
|
||||
template <typename Alloc, typename Delete>
|
||||
VLockGuard(const QString &lockName, Alloc a, Delete d, int stale = 0, int timeout = 0);
|
||||
|
@ -87,7 +88,10 @@ private:
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename Guarded>
|
||||
VLockGuard<Guarded>::VLockGuard(const QString &lockName, int stale, int timeout)
|
||||
: holder(nullptr), lockError(0), lockFile(), lock(nullptr)
|
||||
: holder(nullptr),
|
||||
lockError(0),
|
||||
lockFile(),
|
||||
lock(nullptr)
|
||||
{
|
||||
if (TryLock(lockName, stale, timeout))
|
||||
{
|
||||
|
@ -98,9 +102,13 @@ VLockGuard<Guarded>::VLockGuard(const QString &lockName, int stale, int timeout)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// using allocator lambdas seems logically better than supplying pointer, because we will take ownership of allocated
|
||||
// object
|
||||
template <typename Guarded> template <typename Alloc>
|
||||
template <typename Guarded>
|
||||
template <typename Alloc>
|
||||
VLockGuard<Guarded>::VLockGuard(const QString &lockName, Alloc a, int stale, int timeout)
|
||||
: holder(nullptr), lockError(0), lockFile(), lock(nullptr)
|
||||
: holder(nullptr),
|
||||
lockError(0),
|
||||
lockFile(),
|
||||
lock(nullptr)
|
||||
{
|
||||
if (TryLock(lockName, stale, timeout))
|
||||
{
|
||||
|
@ -109,9 +117,13 @@ VLockGuard<Guarded>::VLockGuard(const QString& lockName, Alloc a, int stale, int
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename Guarded> template <typename Alloc, typename Delete>
|
||||
template <typename Guarded>
|
||||
template <typename Alloc, typename Delete>
|
||||
VLockGuard<Guarded>::VLockGuard(const QString &lockName, Alloc a, Delete d, int stale, int timeout)
|
||||
: holder(nullptr), lockError(0), lockFile(), lock(nullptr)
|
||||
: holder(nullptr),
|
||||
lockError(0),
|
||||
lockFile(),
|
||||
lock(nullptr)
|
||||
{
|
||||
if (TryLock(lockName, stale, timeout))
|
||||
{
|
||||
|
@ -138,8 +150,7 @@ template <typename Guarded> inline auto VLockGuard<Guarded>::IsLocked() const ->
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template<typename Guarded>
|
||||
inline void VLockGuard<Guarded>::Unlock()
|
||||
template <typename Guarded> inline void VLockGuard<Guarded>::Unlock()
|
||||
{
|
||||
if (IsLocked())
|
||||
{
|
||||
|
|
|
@ -40,14 +40,14 @@
|
|||
#include <QString>
|
||||
#include <QTextStream>
|
||||
#include <QVector>
|
||||
#include <QtDebug>
|
||||
#include <Qt>
|
||||
#include <QtDebug>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
#include "../vmisc/vmath.h"
|
||||
#include "../vmisc/defglobal.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
#include "../vmisc/backport/text.h"
|
||||
|
@ -71,20 +71,23 @@ QT_WARNING_DISABLE_CLANG("-Wsign-conversion")
|
|||
QT_WARNING_DISABLE_INTEL(68)
|
||||
QT_WARNING_DISABLE_INTEL(2022)
|
||||
|
||||
return QPaintEngine::PaintEngineFeatures(
|
||||
QPaintEngine::AllFeatures
|
||||
& ~QPaintEngine::PatternBrush
|
||||
& ~QPaintEngine::PerspectiveTransform
|
||||
& ~QPaintEngine::ConicalGradientFill
|
||||
& ~QPaintEngine::PorterDuff);
|
||||
return QPaintEngine::PaintEngineFeatures(QPaintEngine::AllFeatures & ~QPaintEngine::PatternBrush &
|
||||
~QPaintEngine::PerspectiveTransform & ~QPaintEngine::ConicalGradientFill &
|
||||
~QPaintEngine::PorterDuff);
|
||||
|
||||
QT_WARNING_POP
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VObjEngine::VObjEngine()
|
||||
:QPaintEngine(svgEngineFeatures()), stream(), globalPointsCount(0), outputDevice(), planeCount(0),
|
||||
size(), resolution(96), matrix()
|
||||
: QPaintEngine(svgEngineFeatures()),
|
||||
stream(),
|
||||
globalPointsCount(0),
|
||||
outputDevice(),
|
||||
planeCount(0),
|
||||
size(),
|
||||
resolution(96),
|
||||
matrix()
|
||||
{
|
||||
for (int i = 0; i < MAX_POINTS; i++)
|
||||
{
|
||||
|
@ -155,7 +158,6 @@ void VObjEngine::updateState(const QPaintEngineState &state)
|
|||
// always stream full gstate, which is not required, but...
|
||||
flags |= QPaintEngine::AllDirty;
|
||||
|
||||
|
||||
if (flags & QPaintEngine::DirtyTransform)
|
||||
{
|
||||
matrix = state.transform(); // Save new matrix for moving paths
|
||||
|
@ -269,7 +271,8 @@ void VObjEngine::drawPoints(const QPointF *points, int pointCount)
|
|||
qreal x = ((points[i].x() - 0) / qFloor(size.width() / 2.0)) - 1.0;
|
||||
qreal y = (((points[i].y() - 0) / qFloor(size.width() / 2.0)) - 1.0) * -1;
|
||||
|
||||
*stream << "v" << " " << QString::number(x, 'f', 6 ) << " " << QString::number(y, 'f', 6 ) << " "
|
||||
*stream << "v"
|
||||
<< " " << QString::number(x, 'f', 6) << " " << QString::number(y, 'f', 6) << " "
|
||||
<< "0.000000" << Qt::endl;
|
||||
++globalPointsCount;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VOBJENGINE_H
|
||||
#define VOBJENGINE_H
|
||||
|
||||
|
||||
#include <QPaintEngine>
|
||||
#include <QPolygonF>
|
||||
#include <QRectF>
|
||||
|
@ -38,7 +37,9 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "delaunay.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class QTextStream;
|
||||
|
||||
|
|
|
@ -29,14 +29,15 @@
|
|||
#ifndef VOBJPAINTDEVICE_H
|
||||
#define VOBJPAINTDEVICE_H
|
||||
|
||||
|
||||
#include <QPaintDevice>
|
||||
#include <QSharedPointer>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class QIODevice;
|
||||
class VObjEngine;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#ifndef VPROPERTYFACTORYMANAGER_H
|
||||
#define VPROPERTYFACTORYMANAGER_H
|
||||
|
||||
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
@ -29,7 +28,9 @@
|
|||
|
||||
#include "vpropertyexplorer_global.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace VPE
|
||||
{
|
||||
|
@ -41,6 +42,7 @@ class VPropertyFactoryManagerPrivate;
|
|||
class VPROPERTYEXPLORERSHARED_EXPORT VPropertyFactoryManager : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit VPropertyFactoryManager(QObject *parent = nullptr);
|
||||
|
@ -90,10 +92,11 @@ protected:
|
|||
|
||||
//! The default manager
|
||||
static VPropertyFactoryManager *DefaultManager;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VPropertyFactoryManager) // NOLINT
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace VPE
|
||||
|
||||
#endif // VPROPERTYFACTORYMANAGER_H
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#ifndef VPROPERTYTREEVIEW_H
|
||||
#define VPROPERTYTREEVIEW_H
|
||||
|
||||
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
@ -30,7 +29,9 @@
|
|||
|
||||
#include "vpropertyexplorer_global.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace VPE
|
||||
{
|
||||
|
@ -42,6 +43,7 @@ class VPropertyTreeViewPrivate;
|
|||
class VPROPERTYEXPLORERSHARED_EXPORT VPropertyTreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
//! Default constructor
|
||||
explicit VPropertyTreeView(QWidget *parent = nullptr);
|
||||
|
@ -56,7 +58,6 @@ public:
|
|||
//! Sets the height for each row. Set this to 0 in order to let the standard delegate decide
|
||||
void setRowHeight(int height = 0, bool add_to_standard = false);
|
||||
|
||||
|
||||
protected:
|
||||
//! This method is called by the constructors to initialize the view
|
||||
virtual void init();
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
#include <QDialog>
|
||||
#include <QMap>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
#include <QTableWidgetItem>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VMeasurement;
|
||||
struct FormulaData;
|
||||
class VContainer;
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class DialogUndo;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VISTOOLARC_H
|
||||
#define VISTOOLARC_H
|
||||
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
|
@ -37,12 +36,15 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "../vmisc/def.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
#include "vispath.h"
|
||||
|
||||
class VisToolArc final : public VisPath
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VisToolArc(const VContainer *data, QGraphicsItem *parent = nullptr);
|
||||
~VisToolArc() override = default;
|
||||
|
@ -56,7 +58,10 @@ public:
|
|||
void SetF2(const QString &expression);
|
||||
|
||||
auto type() const -> int override { return Type; }
|
||||
enum {Type = UserType + static_cast<int>(Vis::ToolArc)};
|
||||
enum
|
||||
{
|
||||
Type = UserType + static_cast<int>(Vis::ToolArc)
|
||||
};
|
||||
|
||||
auto StickyEnd(qreal angle) const -> qreal;
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef VISTOOLARCWITHLENGTH_H
|
||||
#define VISTOOLARCWITHLENGTH_H
|
||||
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
|
@ -38,11 +37,14 @@
|
|||
|
||||
#include "../vmisc/def.h"
|
||||
#include "vispath.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VisToolArcWithLength final : public VisPath
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VisToolArcWithLength(const VContainer *data, QGraphicsItem *parent = nullptr);
|
||||
~VisToolArcWithLength() override = default;
|
||||
|
@ -56,9 +58,13 @@ public:
|
|||
void SetLength(const QString &expression);
|
||||
|
||||
auto type() const -> int override { return Type; }
|
||||
enum {Type = UserType + static_cast<int>(Vis::ToolArcWithLength)};
|
||||
enum
|
||||
{
|
||||
Type = UserType + static_cast<int>(Vis::ToolArcWithLength)
|
||||
};
|
||||
|
||||
static auto CorrectAngle(qreal angle) -> qreal;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VisToolArcWithLength) // NOLINT
|
||||
VScaledEllipse *m_arcCenter{nullptr};
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include <QIcon>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class FancyTab final : public QObject
|
||||
{
|
||||
|
@ -41,6 +43,7 @@ class FancyTab final : public QObject
|
|||
Q_OBJECT // NOLINT
|
||||
|
||||
Q_PROPERTY(double fader READ fader WRITE setFader)
|
||||
|
||||
public:
|
||||
explicit FancyTab(QWidget *tabbar);
|
||||
|
||||
|
|
|
@ -31,14 +31,15 @@
|
|||
#define FANCYTABWIDGET_H
|
||||
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include "fancytab.h"
|
||||
|
||||
class QPainter;
|
||||
|
||||
#include "fancytab.h"
|
||||
|
||||
class FancyTabBar : public QWidget
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
@ -101,7 +102,13 @@ private slots:
|
|||
private:
|
||||
Q_DISABLE_COPY_MOVE(FancyTabBar) // NOLINT
|
||||
|
||||
enum Corner { OutsideBeginning, OutsideEnd, InsideBeginning, InsideEnd };
|
||||
enum Corner
|
||||
{
|
||||
OutsideBeginning,
|
||||
OutsideEnd,
|
||||
InsideBeginning,
|
||||
InsideEnd
|
||||
};
|
||||
|
||||
static const int m_rounding;
|
||||
|
||||
|
|
|
@ -45,24 +45,25 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QColorDialog>
|
||||
#include <QtCore/QMap>
|
||||
#include <QLayout>
|
||||
#include <QStyle>
|
||||
#include <QLabel>
|
||||
#include <QToolTip>
|
||||
#include <QPixmap>
|
||||
#include <QFocusEvent>
|
||||
#include <QPaintEvent>
|
||||
#include <QGridLayout>
|
||||
#include <QHideEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QShowEvent>
|
||||
#include <QLabel>
|
||||
#include <QLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QPushButton>
|
||||
#include <QShowEvent>
|
||||
#include <QStyle>
|
||||
#include <QToolTip>
|
||||
#include <QtCore/QMap>
|
||||
#include <cmath>
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include "qtcolorpicker.h"
|
||||
|
||||
/*! \class QtColorPicker
|
||||
|
@ -167,8 +168,7 @@ class ColorPickerItem : public QFrame
|
|||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString(),
|
||||
QWidget *parent = 0);
|
||||
ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString(), QWidget *parent = 0);
|
||||
~ColorPickerItem();
|
||||
|
||||
auto color() const -> QColor;
|
||||
|
@ -203,8 +203,7 @@ class ColorPickerPopup : public QFrame
|
|||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
ColorPickerPopup(int width, bool withColorDialog,
|
||||
QWidget *parent = nullptr);
|
||||
ColorPickerPopup(int width, bool withColorDialog, QWidget *parent = nullptr);
|
||||
~ColorPickerPopup();
|
||||
|
||||
void insertColor(const QColor &col, const QString &text, vsizetype index);
|
||||
|
@ -287,8 +286,7 @@ QtColorPicker::QtColorPicker(QWidget *parent, int columns, bool enableColorDialo
|
|||
|
||||
// Create color grid popup and connect to it.
|
||||
popup = new ColorPickerPopup(columns, withColorDialog, this);
|
||||
connect(popup, SIGNAL(selected(const QColor &)),
|
||||
SLOT(setCurrentColor(const QColor &)));
|
||||
connect(popup, SIGNAL(selected(const QColor &)), SLOT(setCurrentColor(const QColor &)));
|
||||
connect(popup, SIGNAL(hid()), SLOT(popupClosed()));
|
||||
|
||||
// Connect this push button's pressed() signal.
|
||||
|
@ -347,7 +345,8 @@ void QtColorPicker::buttonPressed(bool toggled)
|
|||
*/
|
||||
void QtColorPicker::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
if (dirty) {
|
||||
if (dirty)
|
||||
{
|
||||
int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||
QPixmap pix(iconSize, iconSize);
|
||||
pix.fill(palette().button().color());
|
||||
|
@ -442,7 +441,6 @@ auto QtColorPicker::CustomColors() const -> QVector<QColor>
|
|||
return customColor;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Makes \a color current. If \a color is not already in the color grid, it
|
||||
is inserted with the text "Custom".
|
||||
|
@ -483,7 +481,8 @@ void QtColorPicker::setCurrentColor(const QColor &color)
|
|||
void QtColorPicker::insertColor(const QColor &color, const QString &text, int index)
|
||||
{
|
||||
popup->insertColor(color, text, index);
|
||||
if (!firstInserted) {
|
||||
if (!firstInserted)
|
||||
{
|
||||
col = color;
|
||||
setText(text);
|
||||
firstInserted = true;
|
||||
|
@ -582,7 +581,6 @@ ColorPickerPopup::ColorPickerPopup(int width, bool withColorDialog, QWidget *par
|
|||
regenerateGrid();
|
||||
}
|
||||
|
||||
|
||||
/*! \internal
|
||||
|
||||
Destructs the popup widget.
|
||||
|
@ -602,8 +600,8 @@ ColorPickerPopup::~ColorPickerPopup()
|
|||
*/
|
||||
auto ColorPickerPopup::find(const QColor &col) const -> ColorPickerItem *
|
||||
{
|
||||
auto item = std::find_if(items.begin(), items.end(),
|
||||
[col](ColorPickerItem *item){return item && item->color() == col;});
|
||||
auto item =
|
||||
std::find_if(items.begin(), items.end(), [col](ColorPickerItem *item) { return item && item->color() == col; });
|
||||
|
||||
if (item != items.end())
|
||||
{
|
||||
|
@ -779,7 +777,8 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
|
|||
}
|
||||
else if (curRow > 0)
|
||||
{
|
||||
--curRow; curCol = grid->columnCount() - 1;
|
||||
--curRow;
|
||||
curCol = grid->columnCount() - 1;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_Right:
|
||||
|
@ -789,7 +788,8 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
|
|||
}
|
||||
else if (curRow < grid->rowCount() - 1)
|
||||
{
|
||||
++curRow; curCol = 0;
|
||||
++curRow;
|
||||
curCol = 0;
|
||||
}
|
||||
break;
|
||||
case Qt::Key_Up:
|
||||
|
@ -797,7 +797,8 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
|
|||
{
|
||||
--curRow;
|
||||
}
|
||||
else curCol = 0;
|
||||
else
|
||||
curCol = 0;
|
||||
break;
|
||||
case Qt::Key_Down:
|
||||
if (curRow < grid->rowCount() - 1)
|
||||
|
@ -807,7 +808,8 @@ void ColorPickerPopup::keyPressEvent(QKeyEvent *e)
|
|||
{
|
||||
++curRow;
|
||||
}
|
||||
else for (int i = 1; i < grid->columnCount(); ++i)
|
||||
else
|
||||
for (int i = 1; i < grid->columnCount(); ++i)
|
||||
{
|
||||
if (!widgetAt[curRow + 1][i])
|
||||
{
|
||||
|
@ -964,7 +966,8 @@ void ColorPickerPopup::regenerateGrid()
|
|||
// When the number of columns grows, the number of rows will
|
||||
// fall. There's no way to shrink a grid, so we create a new
|
||||
// one.
|
||||
if (grid) delete grid;
|
||||
if (grid)
|
||||
delete grid;
|
||||
grid = new QGridLayout(this);
|
||||
grid->setContentsMargins(1, 1, 1, 1);
|
||||
grid->setSpacing(0);
|
||||
|
@ -1014,9 +1017,11 @@ void ColorPickerPopup::getColorFromDialog()
|
|||
Constructs a ColorPickerItem whose color is set to \a color, and
|
||||
whose name is set to \a text.
|
||||
*/
|
||||
ColorPickerItem::ColorPickerItem(const QColor &color, const QString &text,
|
||||
QWidget *parent)
|
||||
: QFrame(parent), c(color), t(text), sel(false)
|
||||
ColorPickerItem::ColorPickerItem(const QColor &color, const QString &text, QWidget *parent)
|
||||
: QFrame(parent),
|
||||
c(color),
|
||||
t(text),
|
||||
sel(false)
|
||||
{
|
||||
setToolTip(t);
|
||||
setFixedWidth(24);
|
||||
|
@ -1176,10 +1181,7 @@ void ColorPickerButton::mouseReleaseEvent(QMouseEvent *e)
|
|||
*/
|
||||
void ColorPickerButton::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
if (e->key() == Qt::Key_Up
|
||||
|| e->key() == Qt::Key_Down
|
||||
|| e->key() == Qt::Key_Left
|
||||
|| e->key() == Qt::Key_Right)
|
||||
if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down || e->key() == Qt::Key_Left || e->key() == Qt::Key_Right)
|
||||
{
|
||||
QCoreApplication::sendEvent(parent(), e);
|
||||
}
|
||||
|
@ -1199,10 +1201,7 @@ void ColorPickerButton::keyPressEvent(QKeyEvent *e)
|
|||
*/
|
||||
void ColorPickerButton::keyReleaseEvent(QKeyEvent *e)
|
||||
{
|
||||
if (e->key() == Qt::Key_Up
|
||||
|| e->key() == Qt::Key_Down
|
||||
|| e->key() == Qt::Key_Left
|
||||
|| e->key() == Qt::Key_Right)
|
||||
if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down || e->key() == Qt::Key_Left || e->key() == Qt::Key_Right)
|
||||
{
|
||||
QCoreApplication::sendEvent(parent(), e);
|
||||
}
|
||||
|
@ -1216,7 +1215,6 @@ void ColorPickerButton::keyReleaseEvent(QKeyEvent *e)
|
|||
{
|
||||
QFrame::keyReleaseEvent(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1266,7 +1264,6 @@ void ColorPickerButton::paintEvent(QPaintEvent *e)
|
|||
}
|
||||
|
||||
p.end();
|
||||
|
||||
}
|
||||
|
||||
#include "qtcolorpicker.moc"
|
||||
|
|
|
@ -46,15 +46,17 @@
|
|||
|
||||
#ifndef QTCOLORPICKER_H
|
||||
#define QTCOLORPICKER_H
|
||||
#include <QColor>
|
||||
#include <QPushButton>
|
||||
#include <QtCore/QString>
|
||||
#include <QColor>
|
||||
|
||||
#include <QFocusEvent>
|
||||
#include <QLabel>
|
||||
#include <QtCore/QEvent>
|
||||
#include <QFocusEvent>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class ColorPickerPopup;
|
||||
class ColorPickerItem;
|
||||
|
@ -66,8 +68,7 @@ class QtColorPicker : public QPushButton
|
|||
Q_PROPERTY(bool colorDialog READ colorDialogEnabled WRITE setColorDialogEnabled)
|
||||
|
||||
public:
|
||||
QtColorPicker(QWidget *parent = 0,
|
||||
int columns = -1, bool enableColorDialog = true);
|
||||
QtColorPicker(QWidget *parent = 0, int columns = -1, bool enableColorDialog = true);
|
||||
|
||||
~QtColorPicker();
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include <QFrame>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VElidedLabel : public QFrame
|
||||
{
|
||||
|
@ -38,6 +40,7 @@ class VElidedLabel : public QFrame
|
|||
Q_PROPERTY(QString text READ text WRITE setText)
|
||||
Q_PROPERTY(bool IsElided READ IsElided)
|
||||
Q_PROPERTY(bool showElided READ ShowElided WRITE SetShowElided)
|
||||
|
||||
public:
|
||||
explicit VElidedLabel(QWidget *parent = nullptr);
|
||||
explicit VElidedLabel(const QString &text, QWidget *parent = nullptr);
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <QtDebug>
|
||||
#include <chrono>
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
|
||||
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
|
||||
// DO NOT WORK WITH GCC 4.8
|
||||
#else
|
||||
|
@ -60,13 +62,14 @@ public:
|
|||
private:
|
||||
Q_DISABLE_COPY_MOVE(MultiSelectCompleter) // NOLINT
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// MultiSelectCompleter
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MultiSelectCompleter::MultiSelectCompleter(QObject *parent)
|
||||
: QCompleter(parent)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto MultiSelectCompleter::pathFromIndex(const QModelIndex &index) const -> QString
|
||||
|
@ -102,13 +105,15 @@ auto MultiSelectCompleter::splitPath(const QString &path) const -> QStringList
|
|||
VLineEdit::VLineEdit(QWidget *parent)
|
||||
: QLineEdit(parent),
|
||||
m_selectOnMousePress(false)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VLineEdit::VLineEdit(const QString &contents, QWidget *parent)
|
||||
: QLineEdit(contents, parent),
|
||||
m_selectOnMousePress(false)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLineEdit::focusInEvent(QFocusEvent *e)
|
||||
|
|
|
@ -31,13 +31,16 @@
|
|||
|
||||
#include <QLineEdit>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class QStringListModel;
|
||||
|
||||
class VLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VLineEdit(QWidget *parent = nullptr);
|
||||
explicit VLineEdit(const QString &contents, QWidget *parent = nullptr);
|
||||
|
@ -46,6 +49,7 @@ protected:
|
|||
virtual void focusInEvent(QFocusEvent *e) override;
|
||||
virtual void focusOutEvent(QFocusEvent *e) override;
|
||||
virtual void mousePressEvent(QMouseEvent *e) override;
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(VLineEdit) // NOLINT
|
||||
|
@ -60,6 +64,7 @@ private:
|
|||
class VCompleterLineEdit : public VLineEdit
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VCompleterLineEdit(QWidget *parent = nullptr);
|
||||
|
||||
|
|
|
@ -29,18 +29,19 @@
|
|||
#ifndef VMAINGRAPHICSVIEW_H
|
||||
#define VMAINGRAPHICSVIEW_H
|
||||
|
||||
|
||||
#include <QGraphicsView>
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
#include <QPointF>
|
||||
#include <QPointer>
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
#include <QPointer>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* This class adds ability to zoom QGraphicsView using mouse wheel. The point under cursor
|
||||
|
@ -75,6 +76,7 @@ class QPinchGesture;
|
|||
class GraphicsViewZoom : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit GraphicsViewZoom(QGraphicsView *view);
|
||||
void gentle_zoom(double factor);
|
||||
|
@ -87,6 +89,7 @@ public slots:
|
|||
void VerticalScrollingTime(qreal x);
|
||||
void HorizontalScrollingTime(qreal x);
|
||||
void animFinished();
|
||||
|
||||
protected:
|
||||
virtual auto eventFilter(QObject *object, QEvent *event) -> bool override;
|
||||
|
||||
|
@ -120,6 +123,7 @@ private:
|
|||
class VMainGraphicsView : public QGraphicsView
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit VMainGraphicsView(QWidget *parent = nullptr);
|
||||
void setShowToolOptions(bool value);
|
||||
|
@ -161,6 +165,7 @@ public slots:
|
|||
void ZoomOriginal();
|
||||
void ZoomFitBest();
|
||||
void ResetScrollingAnimation();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
@ -169,6 +174,7 @@ protected:
|
|||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(VMainGraphicsView) // NOLINT
|
||||
GraphicsViewZoom *zoom;
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
\brief Class showing a widget as popup window.
|
||||
|
|
|
@ -30,11 +30,14 @@
|
|||
#define TST_TAPECOMMANDLINE_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_TapeCommandLine : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_TapeCommandLine(QObject *parent = nullptr);
|
||||
|
||||
|
@ -46,7 +49,6 @@ private slots:
|
|||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_TapeCommandLine) // NOLINT
|
||||
|
||||
};
|
||||
|
||||
#endif // TST_TAPECOMMANDLINE_H
|
||||
|
|
|
@ -30,11 +30,14 @@
|
|||
#define TST_VALENTINACOMMANDLINE_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_ValentinaCommandLine : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_ValentinaCommandLine(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#define TST_ABSTRACTREGEXP_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
|
@ -40,6 +42,7 @@ class VTranslateVars;
|
|||
class TST_AbstractRegExp : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
TST_AbstractRegExp(const QString &locale, QObject *parent = nullptr);
|
||||
virtual ~TST_AbstractRegExp();
|
||||
|
|
|
@ -28,17 +28,20 @@
|
|||
#ifndef TST_ABSTRACTTRANSLATION_H
|
||||
#define TST_ABSTRACTTRANSLATION_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <QSharedPointer>
|
||||
#include <QDomDocument>
|
||||
#include <QFile>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <ciso646>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_AbstractTranslation : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_AbstractTranslation(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -29,11 +29,13 @@
|
|||
#ifndef TST_MEASUREMENTREGEXP_H
|
||||
#define TST_MEASUREMENTREGEXP_H
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include "tst_abstractregexp.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
#include "tst_abstractregexp.h"
|
||||
|
||||
class QTranslator;
|
||||
class VTranslateVars;
|
||||
|
||||
|
@ -41,7 +43,8 @@ class TST_MeasurementRegExp : public TST_AbstractRegExp
|
|||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public : TST_MeasurementRegExp(const QString &systemCode, const QString &locale, QObject *parent = nullptr);
|
||||
public:
|
||||
TST_MeasurementRegExp(const QString &systemCode, const QString &locale, QObject *parent = nullptr);
|
||||
virtual ~TST_MeasurementRegExp();
|
||||
|
||||
static const QStringList pmSystems;
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_Misc : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_Misc(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -32,11 +32,14 @@
|
|||
#include <QLocale>
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_QmuTokenParser : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_QmuTokenParser(QObject *parent = nullptr);
|
||||
private slots:
|
||||
|
@ -45,6 +48,7 @@ private slots:
|
|||
void TokenFromUser_data();
|
||||
void TokenFromUser();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(TST_QmuTokenParser) // NOLINT
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VCommandLine : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VCommandLine(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VCubicBezierPath : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VCubicBezierPath(QObject *parent = nullptr);
|
||||
|
||||
|
@ -49,7 +52,6 @@ private slots:
|
|||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_VCubicBezierPath) // NOLINT
|
||||
|
||||
};
|
||||
|
||||
#endif // TST_VCUBICBEZIERPATH_H
|
||||
|
|
|
@ -30,17 +30,21 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VDomDocument : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VDomDocument(QObject *parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void TestCompareDomElements_data();
|
||||
void TestCompareDomElements();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_VDomDocument) // NOLINT
|
||||
};
|
||||
|
|
|
@ -30,11 +30,14 @@
|
|||
#define TST_VELLIPTICALARC_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VEllipticalArc : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VEllipticalArc(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -30,11 +30,14 @@
|
|||
#define TST_VDETAIL_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VPiece : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VPiece(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -32,16 +32,20 @@
|
|||
#include <QtCore/QObject>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VPointF : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VPointF(QObject *parent = nullptr);
|
||||
private slots:
|
||||
void TestFlip_data();
|
||||
void TestFlip();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_VPointF) // NOLINT
|
||||
};
|
||||
|
|
|
@ -30,13 +30,16 @@
|
|||
#define TST_VSPLINE_H
|
||||
|
||||
#include "../vtest/abstracttest.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VSpline;
|
||||
|
||||
class TST_VSpline : public AbstractTest
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VSpline(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VSplinePath : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VSplinePath(QObject *parent = nullptr);
|
||||
private slots:
|
||||
|
@ -43,6 +46,7 @@ private slots:
|
|||
void TestRotation();
|
||||
void TestFlip_data();
|
||||
void TestFlip();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_VSplinePath) // NOLINT
|
||||
};
|
||||
|
|
|
@ -31,16 +31,20 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class TST_VToolUnionDetails : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VToolUnionDetails(QObject *parent = nullptr);
|
||||
private slots:
|
||||
void TestUnitingMainPaths_data();
|
||||
void TestUnitingMainPaths();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY_MOVE(TST_VToolUnionDetails) // NOLINT
|
||||
};
|
||||
|
|
|
@ -29,17 +29,20 @@
|
|||
#ifndef TST_VTRANSLATEVARS_H
|
||||
#define TST_VTRANSLATEVARS_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QLocale>
|
||||
#include <QObject>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "../vmisc/defglobal.h"
|
||||
#endif
|
||||
|
||||
class VTranslateVars;
|
||||
|
||||
class TST_VTranslateVars : public QObject
|
||||
{
|
||||
Q_OBJECT // NOLINT
|
||||
|
||||
public:
|
||||
explicit TST_VTranslateVars(QObject *parent = nullptr);
|
||||
private slots:
|
||||
|
@ -49,6 +52,7 @@ private slots:
|
|||
void TestFormulaToUser_data();
|
||||
void TestFormulaToUser();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
// cppcheck-suppress unknownMacro
|
||||
Q_DISABLE_COPY_MOVE(TST_VTranslateVars) // NOLINT
|
||||
|
|
Loading…
Reference in New Issue
Block a user