diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-08-17 10:06:55 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-08-17 10:06:55 (GMT) |
commit | f2f5efc551648c01a384dbc36cec0d966ccbebbb (patch) | |
tree | 2295de9ad8f4a1124244a34f7c17306d65e19487 /src | |
parent | a00fe5c3890ba3b80ff37657d988fb52502f6f78 (diff) | |
download | Qt-f2f5efc551648c01a384dbc36cec0d966ccbebbb.zip Qt-f2f5efc551648c01a384dbc36cec0d966ccbebbb.tar.gz Qt-f2f5efc551648c01a384dbc36cec0d966ccbebbb.tar.bz2 |
Clean up public API: move dumpGraph() to private API.
Hopefully we won't need it more...
Diffstat (limited to 'src')
-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 |
4 files changed, 23 insertions, 22 deletions
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; }; + |