Move QGridLayoutEngine to QtGui module
For MacOS 10.6 the exported symbols must be the same regardless of debug/release configuration, because for debug builds it will by default link to a release library. We therefore cannot let some exported symbols depend on if QT_DEBUG is defined or not. We therefore introduce QGRIDLAYOUTENGINE_DEBUG, which is independent of debug/release configuration. The whole dump() function concept should probably be revisited, but I don't want to clutter this commit too much with such unrelated things. Change-Id: I7086f31e2c36fe22ce9c9a3eda37ea25302459a9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
89277e1068
commit
3be88bf778
@ -3,7 +3,7 @@
|
|||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
@ -136,7 +136,7 @@ void QGridLayoutBox::normalize()
|
|||||||
Q_ASSERT((q_minimumDescent < 0.0) == (q_minimumAscent < 0.0));
|
Q_ASSERT((q_minimumDescent < 0.0) == (q_minimumAscent < 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGridLayoutBox::dump(int indent) const
|
void QGridLayoutBox::dump(int indent) const
|
||||||
{
|
{
|
||||||
qDebug("%*sBox (%g <= %g <= %g [%g/%g])", indent, "", q_minimumSize, q_preferredSize,
|
qDebug("%*sBox (%g <= %g <= %g [%g/%g])", indent, "", q_minimumSize, q_preferredSize,
|
||||||
@ -460,7 +460,7 @@ void QGridLayoutRowData::stealBox(int start, int end, int which, qreal *position
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGridLayoutRowData::dump(int indent) const
|
void QGridLayoutRowData::dump(int indent) const
|
||||||
{
|
{
|
||||||
qDebug("%*sData", indent, "");
|
qDebug("%*sData", indent, "");
|
||||||
@ -709,7 +709,7 @@ QSizeF QGridLayoutItem::effectiveMaxSize(const QSizeF &constraint) const
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGridLayoutItem::dump(int indent) const
|
void QGridLayoutItem::dump(int indent) const
|
||||||
{
|
{
|
||||||
qDebug("%*s (%d, %d) %d x %d", indent, "", firstRow(), firstColumn(), //###
|
qDebug("%*s (%d, %d) %d x %d", indent, "", firstRow(), firstColumn(), //###
|
||||||
@ -736,7 +736,7 @@ void QGridLayoutRowInfo::insertOrRemoveRows(int row, int delta)
|
|||||||
insertOrRemoveItems(boxes, row, delta);
|
insertOrRemoveItems(boxes, row, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGridLayoutRowInfo::dump(int indent) const
|
void QGridLayoutRowInfo::dump(int indent) const
|
||||||
{
|
{
|
||||||
qDebug("%*sInfo (count: %d)", indent, "", count);
|
qDebug("%*sInfo (count: %d)", indent, "", count);
|
||||||
@ -1155,7 +1155,7 @@ Qt::LayoutDirection QGridLayoutEngine::visualDirection() const
|
|||||||
return m_visualDirection;
|
return m_visualDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGridLayoutEngine::dump(int indent) const
|
void QGridLayoutEngine::dump(int indent) const
|
||||||
{
|
{
|
||||||
qDebug("%*sEngine", indent, "");
|
qDebug("%*sEngine", indent, "");
|
@ -3,7 +3,7 @@
|
|||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
@ -58,12 +58,14 @@
|
|||||||
#include "qlist.h"
|
#include "qlist.h"
|
||||||
#include "qmap.h"
|
#include "qmap.h"
|
||||||
#include "qpair.h"
|
#include "qpair.h"
|
||||||
#include "qvector.h"
|
#include <QtCore/qvector.h>
|
||||||
#include <QtCore/qsize.h>
|
#include <QtCore/qsize.h>
|
||||||
#include <QtCore/qrect.h>
|
#include <QtCore/qrect.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <QtGui/private/qlayoutpolicy_p.h>
|
#include "qlayoutpolicy_p.h"
|
||||||
#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
|
#include "qabstractlayoutstyleinfo_p.h"
|
||||||
|
|
||||||
|
// #define QGRIDLAYOUTENGINE_DEBUG
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -138,7 +140,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QGridLayoutBox
|
class Q_GUI_EXPORT QGridLayoutBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QGridLayoutBox()
|
inline QGridLayoutBox()
|
||||||
@ -149,7 +151,7 @@ public:
|
|||||||
void combine(const QGridLayoutBox &other);
|
void combine(const QGridLayoutBox &other);
|
||||||
void normalize();
|
void normalize();
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent = 0) const;
|
void dump(int indent = 0) const;
|
||||||
#endif
|
#endif
|
||||||
// This code could use the union-struct-array trick, but a compiler
|
// This code could use the union-struct-array trick, but a compiler
|
||||||
@ -239,7 +241,7 @@ public:
|
|||||||
QGridLayoutBox totalBox(int start, int end) const;
|
QGridLayoutBox totalBox(int start, int end) const;
|
||||||
void stealBox(int start, int end, int which, qreal *positions, qreal *sizes);
|
void stealBox(int start, int end, int which, qreal *positions, qreal *sizes);
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent = 0) const;
|
void dump(int indent = 0) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -258,7 +260,7 @@ public:
|
|||||||
|
|
||||||
void insertOrRemoveRows(int row, int delta);
|
void insertOrRemoveRows(int row, int delta);
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent = 0) const;
|
void dump(int indent = 0) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -270,7 +272,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class QGridLayoutItem
|
class Q_GUI_EXPORT QGridLayoutItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QGridLayoutItem(int row, int column, int rowSpan = 1, int columnSpan = 1,
|
QGridLayoutItem(int row, int column, int rowSpan = 1, int columnSpan = 1,
|
||||||
@ -321,7 +323,7 @@ public:
|
|||||||
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
|
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
|
||||||
QSizeF effectiveMaxSize(const QSizeF &constraint) const;
|
QSizeF effectiveMaxSize(const QSizeF &constraint) const;
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent = 0) const;
|
void dump(int indent = 0) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -333,7 +335,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QGridLayoutEngine
|
class Q_GUI_EXPORT QGridLayoutEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QGridLayoutEngine(Qt::Alignment defaultAlignment = Qt::Alignment(0));
|
QGridLayoutEngine(Qt::Alignment defaultAlignment = Qt::Alignment(0));
|
||||||
@ -397,7 +399,7 @@ public:
|
|||||||
void transpose();
|
void transpose();
|
||||||
void setVisualDirection(Qt::LayoutDirection direction);
|
void setVisualDirection(Qt::LayoutDirection direction);
|
||||||
Qt::LayoutDirection visualDirection() const;
|
Qt::LayoutDirection visualDirection() const;
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent = 0) const;
|
void dump(int indent = 0) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -4,11 +4,13 @@ HEADERS += \
|
|||||||
util/qdesktopservices.h \
|
util/qdesktopservices.h \
|
||||||
util/qhexstring_p.h \
|
util/qhexstring_p.h \
|
||||||
util/qvalidator.h \
|
util/qvalidator.h \
|
||||||
|
util/qgridlayoutengine_p.h \
|
||||||
util/qabstractlayoutstyleinfo_p.h \
|
util/qabstractlayoutstyleinfo_p.h \
|
||||||
util/qlayoutpolicy_p.h
|
util/qlayoutpolicy_p.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
util/qdesktopservices.cpp \
|
util/qdesktopservices.cpp \
|
||||||
util/qvalidator.cpp \
|
util/qvalidator.cpp \
|
||||||
|
util/qgridlayoutengine.cpp \
|
||||||
util/qabstractlayoutstyleinfo.cpp \
|
util/qabstractlayoutstyleinfo.cpp \
|
||||||
util/qlayoutpolicy.cpp
|
util/qlayoutpolicy.cpp
|
||||||
|
@ -23,7 +23,6 @@ HEADERS += graphicsview/qgraphicsgridlayout.h \
|
|||||||
graphicsview/qgraphicsview_p.h \
|
graphicsview/qgraphicsview_p.h \
|
||||||
graphicsview/qgraphicswidget.h \
|
graphicsview/qgraphicswidget.h \
|
||||||
graphicsview/qgraphicswidget_p.h \
|
graphicsview/qgraphicswidget_p.h \
|
||||||
graphicsview/qgridlayoutengine_p.h \
|
|
||||||
graphicsview/qgraphicslayoutstyleinfo_p.h \
|
graphicsview/qgraphicslayoutstyleinfo_p.h \
|
||||||
graphicsview/qgraphicsgridlayoutengine_p.h \
|
graphicsview/qgraphicsgridlayoutengine_p.h \
|
||||||
graphicsview/qgraph_p.h \
|
graphicsview/qgraph_p.h \
|
||||||
@ -49,7 +48,6 @@ SOURCES += graphicsview/qgraphicsgridlayout.cpp \
|
|||||||
graphicsview/qgraphicsview.cpp \
|
graphicsview/qgraphicsview.cpp \
|
||||||
graphicsview/qgraphicswidget.cpp \
|
graphicsview/qgraphicswidget.cpp \
|
||||||
graphicsview/qgraphicswidget_p.cpp \
|
graphicsview/qgraphicswidget_p.cpp \
|
||||||
graphicsview/qgridlayoutengine.cpp \
|
|
||||||
graphicsview/qgraphicslayoutstyleinfo.cpp \
|
graphicsview/qgraphicslayoutstyleinfo.cpp \
|
||||||
graphicsview/qgraphicsgridlayoutengine.cpp \
|
graphicsview/qgraphicsgridlayoutengine.cpp \
|
||||||
graphicsview/qsimplex_p.cpp \
|
graphicsview/qsimplex_p.cpp \
|
||||||
|
@ -106,7 +106,7 @@ public:
|
|||||||
mutable QGraphicsLayoutStyleInfo *m_styleInfo;
|
mutable QGraphicsLayoutStyleInfo *m_styleInfo;
|
||||||
QGraphicsGridLayoutEngine engine;
|
QGraphicsGridLayoutEngine engine;
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void dump(int indent) const;
|
void dump(int indent) const;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -631,7 +631,7 @@ void QGraphicsGridLayout::invalidate()
|
|||||||
QGraphicsLayout::invalidate();
|
QGraphicsLayout::invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
void QGraphicsGridLayoutPrivate::dump(int indent) const
|
void QGraphicsGridLayoutPrivate::dump(int indent) const
|
||||||
{
|
{
|
||||||
if (qt_graphicsLayoutDebug()) {
|
if (qt_graphicsLayoutDebug()) {
|
||||||
@ -656,7 +656,7 @@ void QGraphicsGridLayout::setGeometry(const QRectF &rect)
|
|||||||
qSwap(left, right);
|
qSwap(left, right);
|
||||||
effectiveRect.adjust(+left, +top, -right, -bottom);
|
effectiveRect.adjust(+left, +top, -right, -bottom);
|
||||||
d->engine.setGeometries(effectiveRect, d->styleInfo());
|
d->engine.setGeometries(effectiveRect, d->styleInfo());
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
if (qt_graphicsLayoutDebug()) {
|
if (qt_graphicsLayoutDebug()) {
|
||||||
static int counter = 0;
|
static int counter = 0;
|
||||||
qDebug("==== BEGIN DUMP OF QGraphicsGridLayout (%d)====", counter++);
|
qDebug("==== BEGIN DUMP OF QGraphicsGridLayout (%d)====", counter++);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#ifndef QGRAPHICSGRIDLAYOUTENGINE_P_H
|
#ifndef QGRAPHICSGRIDLAYOUTENGINE_P_H
|
||||||
#define QGRAPHICSGRIDLAYOUTENGINE_P_H
|
#define QGRAPHICSGRIDLAYOUTENGINE_P_H
|
||||||
|
|
||||||
#include "qgridlayoutengine_p.h"
|
#include <QtGui/private/qgridlayoutengine_p.h>
|
||||||
|
|
||||||
#include <QtWidgets/qsizepolicy.h>
|
#include <QtWidgets/qsizepolicy.h>
|
||||||
#include <QtWidgets/qstyle.h>
|
#include <QtWidgets/qstyle.h>
|
||||||
|
@ -511,7 +511,7 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
|
|||||||
if (visualDir == Qt::RightToLeft)
|
if (visualDir == Qt::RightToLeft)
|
||||||
qSwap(left, right);
|
qSwap(left, right);
|
||||||
effectiveRect.adjust(+left, +top, -right, -bottom);
|
effectiveRect.adjust(+left, +top, -right, -bottom);
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
if (qt_graphicsLayoutDebug()) {
|
if (qt_graphicsLayoutDebug()) {
|
||||||
static int counter = 0;
|
static int counter = 0;
|
||||||
qDebug() << counter++ << "QGraphicsLinearLayout::setGeometry - " << rect;
|
qDebug() << counter++ << "QGraphicsLinearLayout::setGeometry - " << rect;
|
||||||
@ -519,7 +519,7 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
d->engine.setGeometries(effectiveRect, d->styleInfo());
|
d->engine.setGeometries(effectiveRect, d->styleInfo());
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
if (qt_graphicsLayoutDebug()) {
|
if (qt_graphicsLayoutDebug()) {
|
||||||
qDebug() << "post dump";
|
qDebug() << "post dump";
|
||||||
dump(1);
|
dump(1);
|
||||||
@ -556,7 +556,7 @@ void QGraphicsLinearLayout::invalidate()
|
|||||||
*/
|
*/
|
||||||
void QGraphicsLinearLayout::dump(int indent) const
|
void QGraphicsLinearLayout::dump(int indent) const
|
||||||
{
|
{
|
||||||
#ifdef QT_DEBUG
|
#ifdef QGRIDLAYOUTENGINE_DEBUG
|
||||||
if (qt_graphicsLayoutDebug()) {
|
if (qt_graphicsLayoutDebug()) {
|
||||||
Q_D(const QGraphicsLinearLayout);
|
Q_D(const QGraphicsLinearLayout);
|
||||||
qDebug("%*s%s layout", indent, "",
|
qDebug("%*s%s layout", indent, "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user