OSDN Git Service

AnchorVertex, AnchorData, QGraphicsAnchorLayout and QGraphicsAnchorLayoutPrivate...
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 26 May 2019 22:26:59 +0000 (22:26 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 26 May 2019 22:27:37 +0000 (22:27 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
cmake/KatieConfigVersion.cmake
src/gui/animation/qabstractanimation.cpp
src/gui/animation/qabstractanimation.h
src/gui/animation/qsequentialanimationgroup.cpp
src/gui/graphicsview/qgraph_p.h
src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
src/gui/graphicsview/qgraphicsanchorlayout_p.h

index b548533..2129ce4 100644 (file)
@@ -3,6 +3,6 @@ set(KATIE_VERSION_MAJOR "@KATIE_MAJOR@")
 set(KATIE_VERSION_MINOR "@KATIE_MINOR@")
 set(KATIE_VERSION_PATCH "@KATIE_MICRO@")
 set(KATIE_VERSION "@KATIE_MAJOR@.@KATIE_MINOR@.@KATIE_MICRO@")
-# purely for convenience bug reports and the like
+# purely for convenience, bug reports and the like
 set(KATIE_VERSION_HEX "@KATIE_HEX@")
 set(KATIE_VERSION_GIT "@KATIE_GIT@")
index 3cb9cde..1c08f3f 100644 (file)
@@ -892,7 +892,7 @@ void QAbstractAnimation::start(DeletionPolicy policy)
     Q_D(QAbstractAnimation);
     if (d->state == Running)
         return;
-    d->deleteWhenStopped = policy;
+    d->deleteWhenStopped = bool(policy);
     d->setState(Running);
 }
 
index da61d7c..8d52658 100644 (file)
@@ -81,7 +81,7 @@ public:
 
     enum DeletionPolicy {
         KeepWhenStopped = 0,
-        DeleteWhenStopped
+        DeleteWhenStopped = 1
     };
 
     QAbstractAnimation(QObject *parent = Q_NULLPTR);
index fc59f0e..3305028 100644 (file)
@@ -567,8 +567,7 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim
     // duration of the previous animations up to the current animation
     currentTime = 0;
     for (int i = 0; i < currentAnimationIndex; ++i) {
-        const int current = animationActualTotalDuration(i);
-        currentTime += current;
+        currentTime += animationActualTotalDuration(i);
     }
 
     if (currentIndex != -1) {
index 8506107..4a10f1e 100644 (file)
@@ -54,7 +54,6 @@
 //
 
 #include <QtCore/QHash>
-#include <QtCore/QQueue>
 #include <QtCore/QString>
 #include <QtCore/QDebug>
 
index 1cfcf97..64656c0 100644 (file)
@@ -43,6 +43,7 @@
 #include <QtGui/qapplication.h>
 #include <QtCore/qlinkedlist.h>
 #include <QtCore/qstack.h>
+#include <QtCore/qqueue.h>
 
 #ifdef QT_DEBUG
 #include <QtCore/qfile.h>
index 28a7498..8f2d8d7 100644 (file)
 
 #include <QGraphicsWidget>
 #include <qobject_p.h>
-
 #include "qgraphicslayout_p.h"
 #include "qgraphicsanchorlayout.h"
 #include "qgraph_p.h"
 #include "qsimplex_p.h"
+
 #ifndef QT_NO_GRAPHICSVIEW
+
 QT_BEGIN_NAMESPACE
 
 /*
@@ -95,7 +96,7 @@ struct AnchorVertex {
 
     QGraphicsLayoutItem *m_item;
     Qt::AnchorPoint m_edge;
-    uint m_type : 1;
+    Type m_type;
 
     // Current distance from this vertex to the layout edge (Left or Top)
     // Value is calculated from the current anchors sizes.
@@ -127,8 +128,8 @@ struct AnchorData : public QSimplexVariable {
           sizeAtMinimum(0), sizeAtPreferred(0),
           sizeAtMaximum(0), item(0), graphicsAnchor(0),
           type(Normal), isLayoutAnchor(false),
-          isCenterAnchor(false), orientation(0),
-          dependency(Independent) {}
+          isCenterAnchor(false), dependency(Independent),
+          orientation(0) {}
     virtual ~AnchorData();
 
     virtual void updateChildrenSizes() {}
@@ -171,11 +172,11 @@ struct AnchorData : public QSimplexVariable {
     QGraphicsLayoutItem *item;
     QGraphicsAnchor *graphicsAnchor;
 
-    uint type : 2;            // either Normal, Sequential or Parallel
-    uint isLayoutAnchor : 1;  // if this anchor is an internal layout anchor
-    uint isCenterAnchor : 1;
-    uint orientation : 1;
-    uint dependency : 2;      // either Independent, Master or Slave
+    Type type;            // either Normal, Sequential or Parallel
+    bool isLayoutAnchor;  // if this anchor is an internal layout anchor
+    bool isCenterAnchor;
+    Dependency dependency;      // either Independent, Master or Slave
+    uint orientation;
 };
 
 #ifdef QT_DEBUG
@@ -351,12 +352,10 @@ public:
     QSizePolicy::Policy sizePolicy;
     qreal preferredSize;
 
-    uint hasSize : 1;         // if false, get size from style.
+    bool hasSize;         // if false, get size from style.
 };
 
 
-
-
 /*!
   \internal
 
@@ -403,9 +402,9 @@ public:
 
     static Qt::AnchorPoint pickEdge(Qt::AnchorPoint edge, Orientation orientation)
     {
-        if (orientation == Vertical && int(edge) <= 2)
+        if (orientation == QGraphicsAnchorLayoutPrivate::Vertical && int(edge) <= 2)
             return (Qt::AnchorPoint)(edge + 3);
-        else if (orientation == Horizontal && int(edge) >= 3) {
+        else if (orientation == QGraphicsAnchorLayoutPrivate::Horizontal && int(edge) >= 3) {
             return (Qt::AnchorPoint)(edge - 3);
         }
         return edge;
@@ -579,8 +578,8 @@ public:
     bool lastCalculationUsedSimplex[2];
 #endif
 
-    uint calculateGraphCacheDirty : 1;
-    mutable uint styleInfoDirty : 1;
+    bool calculateGraphCacheDirty;
+    mutable bool styleInfoDirty;
     mutable QLayoutStyleInfo cachedStyleInfo;
 
     friend class QGraphicsAnchorPrivate;