diff options
-rw-r--r-- | examples/graphicsview/anchorlayout/main.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.cpp | 18 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.h | 4 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 17 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 6 |
5 files changed, 23 insertions, 24 deletions
diff --git a/examples/graphicsview/anchorlayout/main.cpp b/examples/graphicsview/anchorlayout/main.cpp index 5e383fa..ecb2675 100644 --- a/examples/graphicsview/anchorlayout/main.cpp +++ b/examples/graphicsview/anchorlayout/main.cpp @@ -126,8 +126,6 @@ int main(int argc, char **argv) return 0; #endif - l->dumpGraph(); - scene->addItem(w); scene->setBackgroundBrush(Qt::darkGreen); QGraphicsView *view = new QGraphicsView(scene); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 9084c2c..b3dac18 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -350,21 +350,3 @@ QSizeF QGraphicsAnchorLayout::sizeHint(Qt::SizeHint which, const QSizeF &constra return engineSizeHint + QSizeF(left + right, top + bottom); } - -//////// DEBUG ///////// -#include <QFile> -void QGraphicsAnchorLayout::dumpGraph() -{ - Q_D(QGraphicsAnchorLayout); - - QFile file(QString::fromAscii("anchorlayout.dot")); - if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) - qWarning("Could not write to %s", file.fileName().toLocal8Bit().constData()); - - QString str = QString::fromAscii("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}"); - QString dotContents = d->graph[0].serializeToDot(); - dotContents += d->graph[1].serializeToDot(); - file.write(str.arg(dotContents).toLocal8Bit()); - - file.close(); -} diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h index 8010b31..f0ffcbd 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout.h @@ -117,10 +117,6 @@ public: void invalidate(); QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - ///////// DEBUG ///////// - void dumpGraph(); -protected: - private: Q_DISABLE_COPY(QGraphicsAnchorLayout) Q_DECLARE_PRIVATE(QGraphicsAnchorLayout) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index b1ce6d1..88b4ff3 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1879,3 +1879,20 @@ void QGraphicsAnchorLayoutPrivate::solvePreferred(QList<QSimplexConstraint *> co qDeleteAll(preferredConstraints); qDeleteAll(preferredVariables); } + +#ifdef QT_DEBUG +#include <QFile> +void QGraphicsAnchorLayoutPrivate::dumpGraph() +{ + QFile file(QString::fromAscii("anchorlayout.dot")); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) + qWarning("Could not write to %s", file.fileName().toLocal8Bit().constData()); + + QString str = QString::fromAscii("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}"); + QString dotContents = graph[0].serializeToDot(); + dotContents += graph[1].serializeToDot(); + file.write(str.arg(dotContents).toLocal8Bit()); + + file.close(); +} +#endif diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index 7b210cd..add4dd3 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -390,6 +390,11 @@ public: GraphPath path); void solvePreferred(QList<QSimplexConstraint *> constraints); +#ifdef QT_DEBUG + void dumpGraph(); +#endif + + qreal spacings[NOrientations]; // Size hints from simplex engine qreal sizeHints[2][3]; @@ -420,3 +425,4 @@ public: uint calculateGraphCacheDirty : 1; }; + |