summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-07-13 16:22:48 +0200
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-07-13 16:22:48 +0200
commitdf03a1c5b0b6d155385f2df67fabd6e974aaa1ad (patch)
tree36f6853ef256793594df5fcf7c70655f85d6ac04
parentab9fbf33d583b2567ac5d24077c5bba23c5a6567 (diff)
Add QT_NAMESPACE macros in the source files.
-rw-r--r--src/experimental/qgraphicsgridview.cpp4
-rw-r--r--src/experimental/qgraphicspathview.cpp4
-rw-r--r--src/experimental/qgraphicsscrollarea_p.h4
-rw-r--r--src/experimental/qkineticlistcontroller_p.h4
-rw-r--r--src/qgraphicsheader.cpp6
-rw-r--r--src/qgraphicslistview.cpp26
-rw-r--r--src/qgraphicslistview.h5
-rw-r--r--src/qgraphicsscrollbar.cpp4
-rw-r--r--src/qgraphicstableview.cpp31
-rw-r--r--src/qgraphicstableview.h1
-rw-r--r--src/qgraphicstableview_p.h2
-rw-r--r--src/qgraphicstreeview.cpp20
-rw-r--r--src/qgraphicstreeview.h1
-rw-r--r--src/qlistcontroller.cpp4
-rw-r--r--src/qlistdefaultmodel.cpp4
-rw-r--r--src/qlistfromtreeadaptor.cpp4
-rw-r--r--src/qlistmodeladaptor.cpp4
-rw-r--r--src/qlistmodelinterface.cpp4
-rw-r--r--src/qlistselectionmanager.cpp4
-rw-r--r--src/qlistwidgetng.cpp5
-rw-r--r--src/qlistwidgetng_p.h4
-rw-r--r--src/qprinterlistview.cpp10
-rw-r--r--src/qprintertableview.cpp4
-rw-r--r--src/qtablecontroller.cpp4
-rw-r--r--src/qtabledefaultmodel.cpp4
-rw-r--r--src/qtablemodeladaptor.cpp4
-rw-r--r--src/qtablemodelinterface.cpp4
-rw-r--r--src/qtableselectionmanager.cpp4
-rw-r--r--src/qtablewidgetng.cpp4
-rw-r--r--src/qtreecontroller.cpp4
-rw-r--r--src/qtreedefaultmodel.cpp4
-rw-r--r--src/qtreemodeladaptor.cpp4
-rw-r--r--src/qtreeselectionmanager.cpp4
-rw-r--r--src/qtreewidgetng.cpp4
34 files changed, 186 insertions, 17 deletions
diff --git a/src/experimental/qgraphicsgridview.cpp b/src/experimental/qgraphicsgridview.cpp
index e792e75..c95813e 100644
--- a/src/experimental/qgraphicsgridview.cpp
+++ b/src/experimental/qgraphicsgridview.cpp
@@ -36,6 +36,8 @@
//#include <qtimeline.h>
#include <qpalette.h>
+QT_BEGIN_NAMESPACE
+
class QtGraphicsGridViewPrivate : public QtGraphicsListViewPrivate
{
Q_DECLARE_PUBLIC(QtGraphicsGridView)
@@ -432,4 +434,6 @@ void QtGraphicsGridView::initStyleOption(QStyleOptionViewItemV4 *option, int ind
option->state &= ~QStyle::State_Selected;
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicsgridview.cpp"
diff --git a/src/experimental/qgraphicspathview.cpp b/src/experimental/qgraphicspathview.cpp
index 469206a..ed1876c 100644
--- a/src/experimental/qgraphicspathview.cpp
+++ b/src/experimental/qgraphicspathview.cpp
@@ -34,6 +34,8 @@
//#include <qtimeline.h>
#include <qapplication.h>
+QT_BEGIN_NAMESPACE
+
class QtGraphicsPathViewPrivate : public QtGraphicsListViewPrivate
{
Q_DECLARE_PUBLIC(QtGraphicsPathView)
@@ -200,4 +202,6 @@ void QtGraphicsPathView::setSelectionManager(QtListSelectionManager *selectionMa
QObject::connect(current, SIGNAL(currentChanged(int,int)), this, SLOT(_q_currentChanged(int,int)));
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicspathview.cpp"
diff --git a/src/experimental/qgraphicsscrollarea_p.h b/src/experimental/qgraphicsscrollarea_p.h
index b575770..b17fffc 100644
--- a/src/experimental/qgraphicsscrollarea_p.h
+++ b/src/experimental/qgraphicsscrollarea_p.h
@@ -35,6 +35,8 @@
// We mean it.
//
+QT_BEGIN_NAMESPACE
+
class QGraphicsWidget;
class QtGraphicsScrollAreaPrivate
@@ -77,4 +79,6 @@ public:
bool verticalOvershoot;
};
+QT_END_NAMESPACE
+
#endif // QGRAPHICSSCROLLAREA_P_H
diff --git a/src/experimental/qkineticlistcontroller_p.h b/src/experimental/qkineticlistcontroller_p.h
index 296ca15..30c773b 100644
--- a/src/experimental/qkineticlistcontroller_p.h
+++ b/src/experimental/qkineticlistcontroller_p.h
@@ -40,6 +40,8 @@
#include <qpoint.h>
+QT_BEGIN_NAMESPACE
+
class QtKineticListController;
class QtKineticListControllerPrivate : public QtListControllerPrivate
@@ -74,4 +76,6 @@ public:
bool centerOnItem;
};
+QT_END_NAMESPACE
+
#endif // QKINETICLISTCONTROLLER_P_H
diff --git a/src/qgraphicsheader.cpp b/src/qgraphicsheader.cpp
index a0137a4..75bb858 100644
--- a/src/qgraphicsheader.cpp
+++ b/src/qgraphicsheader.cpp
@@ -34,6 +34,8 @@
#include <qgraphicssceneevent.h>
+QT_BEGIN_NAMESPACE
+
// QtGraphicsHeaderPrivate
/*!
@@ -1542,7 +1544,7 @@ void QtGraphicsHeader::paintEmptySection(QPainter *painter, QStyleOptionHeader *
void QtGraphicsHeader::paintDragIndicator(QPainter *painter, QStyleOptionHeader *option, int logicalIndex) const
{
const qreal opacity = painter->opacity();
- painter->setOpacity(0.75);
+ painter->setOpacity(0.75); // ### property ?
paintSection(painter, option, logicalIndex);
painter->setOpacity(opacity);
}
@@ -1576,4 +1578,6 @@ void QtGraphicsHeader::copySections(const QtGraphicsHeader &other)
d->sectionSelectedSpans = other.d_ptr->sectionSelectedSpans;
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicsheader.cpp"
diff --git a/src/qgraphicslistview.cpp b/src/qgraphicslistview.cpp
index 431aa94..85dd752 100644
--- a/src/qgraphicslistview.cpp
+++ b/src/qgraphicslistview.cpp
@@ -38,6 +38,7 @@
#include <qdebug.h>
#include <limits.h>
+QT_BEGIN_NAMESPACE
/*!
\class QtGraphicsListViewItem
@@ -874,7 +875,7 @@ int QtGraphicsListView::maximumFirstIndex() const
break;
}
}
- // the last item may be partially visible and
+ // the last item may be partially visible or
// there may have been no items in the model
if (index < last || index == -1)
++index;
@@ -1181,20 +1182,22 @@ void QtGraphicsListView::copyStyleOptionState(const QStyleOptionGraphicsItem *so
/*!
*/
+/*
bool QtGraphicsListView::layoutsBlocked() const
{
Q_D(const QtGraphicsListView);
return d->layoutsBlocked;
}
-
+*/
/*!
*/
+/*
void QtGraphicsListView::setLayoutsBlocked(bool block)
{
Q_D(QtGraphicsListView);
d->layoutsBlocked = block;
}
-
+*/
/*!
\reimp
*/
@@ -1213,6 +1216,21 @@ bool QtGraphicsListView::event(QEvent *event)
}
/*!
+ \reimp
+ */
+QVariant QtGraphicsListView::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ Q_D(QtGraphicsListView);
+ if (change == QGraphicsItem::ItemChildRemovedChange) {
+ QGraphicsItem *item = qvariant_cast<QGraphicsItem*>(value);
+ int index = d->items.indexOf(static_cast<QtGraphicsListViewItem*>(item));
+ if (index != -1)
+ d->items.removeAt(index);
+ }
+ return QGraphicsWidget::itemChange(change, value);
+}
+
+/*!
Returns the item creator for this view.
*/
QtGraphicsListViewItemCreatorBase *QtGraphicsListView::itemCreator() const
@@ -1264,4 +1282,6 @@ void QtGraphicsListView::itemGeometryChanged(QtGraphicsListViewItem *item)
}
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicslistview.cpp"
diff --git a/src/qgraphicslistview.h b/src/qgraphicslistview.h
index 2dc2f27..0c14fb7 100644
--- a/src/qgraphicslistview.h
+++ b/src/qgraphicslistview.h
@@ -127,8 +127,8 @@ public:
QtGraphicsListViewItem *itemForIndex(int index) const;
- bool layoutsBlocked() const; // ### FIXME: should not be needed
- void setLayoutsBlocked(bool block);
+ //bool layoutsBlocked() const; // ### FIXME: should not be needed
+ //void setLayoutsBlocked(bool block);
public Q_SLOTS:
void setFirstIndex(int index);
@@ -151,6 +151,7 @@ protected:
virtual void setSelectionManager(QtListSelectionManager *selectionManager);
virtual bool event(QEvent *event);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
QtGraphicsListViewPrivate *d_ptr;
diff --git a/src/qgraphicsscrollbar.cpp b/src/qgraphicsscrollbar.cpp
index 82bb9f3..45c8e7b 100644
--- a/src/qgraphicsscrollbar.cpp
+++ b/src/qgraphicsscrollbar.cpp
@@ -33,6 +33,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
// QtGraphicsScrollBarPrivate
QtGraphicsScrollBarPrivate::QtGraphicsScrollBarPrivate()
@@ -450,4 +452,6 @@ void QtGraphicsScrollBar::initStyleOption(QStyleOptionSlider *option) const
option->state |= QStyle::State_Active;
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicsscrollbar.cpp"
diff --git a/src/qgraphicstableview.cpp b/src/qgraphicstableview.cpp
index d8c4a7d..a52faeb 100644
--- a/src/qgraphicstableview.cpp
+++ b/src/qgraphicstableview.cpp
@@ -39,6 +39,8 @@
#include <qgraphicssceneevent.h>
+QT_BEGIN_NAMESPACE
+
// QtGraphicsTableViewItem
QtGraphicsTableViewItem::QtGraphicsTableViewItem(int row, int column, QtGraphicsTableView *view)
@@ -339,7 +341,7 @@ void QtGraphicsTableViewPrivate::checkItems(int firstRow, int firstColumn, int r
Q_UNUSED(firstColumn);
Q_UNUSED(rowCount);
Q_UNUSED(columnCount);
- QHash<int, QtGraphicsTableViewItem*>::iterator it = items.begin();
+ QHash<qint64, QtGraphicsTableViewItem*>::iterator it = items.begin();
while (it != items.end()) {
creator->recycle(it.value());
++it;
@@ -1044,7 +1046,7 @@ void QtGraphicsTableView::doLayout()
const int row = verticalMapping.value(verticalSection, verticalSection);
for (int horizontalSection = oldFirstHorizontalSection; horizontalSection <= oldLastHorizontalSection; ++horizontalSection) {
const int column = horizontalMapping.value(horizontalSection, horizontalSection);
- const int index = (row * columnCount) + column;
+ const qint64 index = (row * columnCount) + column;
if (QtGraphicsTableViewItem *item = d->items.take(index))
unused.push(item);
}
@@ -1054,7 +1056,7 @@ void QtGraphicsTableView::doLayout()
int column = horizontalMapping.value(horizontalSection, horizontalSection);
for (int verticalSection = firstVerticalSection; verticalSection <= lastVerticalSection; ++verticalSection) {
const int row = verticalMapping.value(verticalSection, verticalSection);
- const int index = (row * columnCount) + column;
+ const qint64 index = (row * columnCount) + column;
if (QtGraphicsTableViewItem *item = d->items.take(index))
unused.push(item);
}
@@ -1064,7 +1066,7 @@ void QtGraphicsTableView::doLayout()
const int row = verticalMapping.value(verticalSection, verticalSection);
for (int horizontalSection = oldFirstHorizontalSection; horizontalSection <= oldLastHorizontalSection; ++horizontalSection) {
const int column = horizontalMapping.value(horizontalSection, horizontalSection);
- const int index = (row * columnCount) + column;
+ const qint64 index = (row * columnCount) + column;
if (QtGraphicsTableViewItem *item = d->items.take(index))
unused.push(item);
}
@@ -1074,7 +1076,7 @@ void QtGraphicsTableView::doLayout()
int column = horizontalMapping.value(horizontalSection, horizontalSection);
for (int verticalSection = firstVerticalSection; verticalSection <= lastVerticalSection; ++verticalSection) {
const int row = verticalMapping.value(verticalSection, verticalSection);
- const int index = (row * columnCount) + column;
+ const qint64 index = (row * columnCount) + column;
if (QtGraphicsTableViewItem *item = d->items.take(index))
unused.push(item);
}
@@ -1089,7 +1091,7 @@ void QtGraphicsTableView::doLayout()
for (int horizontalSection = firstHorizontalSection; horizontalSection <= lastHorizontalSection; ++horizontalSection) {
const int column = horizontalMapping.value(horizontalSection, horizontalSection);
const qreal width = columnWidth(column);
- const int index = (row * columnCount) + column;
+ const qint64 index = (row * columnCount) + column;
QtGraphicsTableViewItem *item = d->items.value(index);
if (!item) {
if (unused.isEmpty())
@@ -1364,4 +1366,21 @@ bool QtGraphicsTableView::event(QEvent *event)
return QObject::event(event);
}
+/*!
+ \reimp
+ */
+QVariant QtGraphicsTableView::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ Q_D(QtGraphicsTableView);
+ if (change == QGraphicsItem::ItemChildRemovedChange) {
+ QGraphicsItem *item = qvariant_cast<QGraphicsItem*>(value);
+ qint64 key = d->items.key(static_cast<QtGraphicsTableViewItem*>(item), -1);
+ if (key != -1)
+ d->items.remove(key);
+ }
+ return QGraphicsWidget::itemChange(change, value);
+}
+
+QT_END_NAMESPACE
+
#include "moc_qgraphicstableview.cpp"
diff --git a/src/qgraphicstableview.h b/src/qgraphicstableview.h
index 3f64a48..9b5ca48 100644
--- a/src/qgraphicstableview.h
+++ b/src/qgraphicstableview.h
@@ -203,6 +203,7 @@ Q_SIGNALS:
protected:
QtGraphicsTableView(QtGraphicsTableViewPrivate&, QGraphicsWidget *parent = 0, Qt::WindowFlags wFlags = 0);
virtual bool event(QEvent *event);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void setModel(QtTableModelInterface *model);
void setSelectionManager(QtTableSelectionManager *selectionManager);
diff --git a/src/qgraphicstableview_p.h b/src/qgraphicstableview_p.h
index 63a45bd..48fd02a 100644
--- a/src/qgraphicstableview_p.h
+++ b/src/qgraphicstableview_p.h
@@ -118,7 +118,7 @@ public:
// view items
QtTableSelectionRange visibleSections;
- QHash<int, QtGraphicsTableViewItem*> items;
+ QHash<qint64, QtGraphicsTableViewItem*> items;
QtGraphicsTableViewItemCreatorBase *creator;
QtGraphicsTableView *q_ptr;
diff --git a/src/qgraphicstreeview.cpp b/src/qgraphicstreeview.cpp
index 838eefc..10b992d 100644
--- a/src/qgraphicstreeview.cpp
+++ b/src/qgraphicstreeview.cpp
@@ -36,6 +36,8 @@
#include <qgraphicssceneevent.h>
+QT_BEGIN_NAMESPACE
+
// QtGraphicsTreeViewItem
/*!
@@ -1036,6 +1038,7 @@ void QtGraphicsTreeView::previousItem(QtTreeModelIterator &it) const
}
/*!
+ \reimp
*/
bool QtGraphicsTreeView::event(QEvent *event)
{
@@ -1050,6 +1053,21 @@ bool QtGraphicsTreeView::event(QEvent *event)
}
/*!
+ \reimp
+ */
+QVariant QtGraphicsTreeView::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ Q_D(QtGraphicsTreeView);
+ if (change == QGraphicsItem::ItemChildRemovedChange) {
+ QGraphicsItem *item = qvariant_cast<QGraphicsItem*>(value);
+ QtTreeModelBase::iterator_base key = d->items.key(static_cast<QtGraphicsTreeViewItem*>(item));
+ if (key.isValid())
+ d->items.remove(key);
+ }
+ return QGraphicsWidget::itemChange(change, value);
+}
+
+/*!
*/
QtGraphicsTreeViewItemCreatorBase *QtGraphicsTreeView::itemCreator() const
{
@@ -1415,4 +1433,6 @@ QRectF QtGraphicsTreeView::disclosureRect(const QRectF &rect) const
return d->disclosureRect(rect);
}
+QT_END_NAMESPACE
+
#include "moc_qgraphicstreeview.cpp"
diff --git a/src/qgraphicstreeview.h b/src/qgraphicstreeview.h
index 9d5259b..ea12062 100644
--- a/src/qgraphicstreeview.h
+++ b/src/qgraphicstreeview.h
@@ -173,6 +173,7 @@ Q_SIGNALS:
protected:
QtGraphicsTreeView(QtGraphicsTreeViewPrivate &, QGraphicsWidget *parent = 0, Qt::WindowFlags wFlags = 0);
virtual bool event(QEvent *event);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void setModel(QtTreeModelBase *model);
void setSelectionManager(QtTreeSelectionManager *selections);
diff --git a/src/qlistcontroller.cpp b/src/qlistcontroller.cpp
index 5779c7f..c6101eb 100644
--- a/src/qlistcontroller.cpp
+++ b/src/qlistcontroller.cpp
@@ -32,6 +32,8 @@
#include <qgraphicssceneevent.h>
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
// QtListControllerPrivate
/*!
@@ -620,4 +622,6 @@ bool QtListController::processEvent(QEvent *event, const QTransform &transform)
return false;
}
+QT_END_NAMESPACE
+
#include "moc_qlistcontroller.cpp"
diff --git a/src/qlistdefaultmodel.cpp b/src/qlistdefaultmodel.cpp
index 5dc4888..73e18e5 100644
--- a/src/qlistdefaultmodel.cpp
+++ b/src/qlistdefaultmodel.cpp
@@ -23,6 +23,8 @@
#include "qlistdefaultmodel.h"
+QT_BEGIN_NAMESPACE
+
struct QtListDefaultItemPrivate
{
inline QtListDefaultItemPrivate() : model(0), index(-1) {}
@@ -355,4 +357,6 @@ void QtListDefaultModel::itemDeleted(QtListDefaultItem *item)
}
}
+QT_END_NAMESPACE
+
#include "moc_qlistdefaultmodel.cpp"
diff --git a/src/qlistfromtreeadaptor.cpp b/src/qlistfromtreeadaptor.cpp
index e08ba8b..0759852 100644
--- a/src/qlistfromtreeadaptor.cpp
+++ b/src/qlistfromtreeadaptor.cpp
@@ -25,6 +25,8 @@
#include "qlistfromtreeadaptor_p.h"
#include "qtreemodelbase.h"
+QT_BEGIN_NAMESPACE
+
/*!
\internal
*/
@@ -317,4 +319,6 @@ bool QtListFromTreeAdaptor::setData(int index, const QHash<int,QVariant> &values
return true;
}
+QT_END_NAMESPACE
+
#include "moc_qlistfromtreeadaptor.cpp"
diff --git a/src/qlistmodeladaptor.cpp b/src/qlistmodeladaptor.cpp
index 5eeb63b..213c770 100644
--- a/src/qlistmodeladaptor.cpp
+++ b/src/qlistmodeladaptor.cpp
@@ -26,6 +26,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtListModelAdaptorPrivate::QtListModelAdaptorPrivate()
: q_ptr(0), model(0), column(0)
{
@@ -229,4 +231,6 @@ bool QtListModelAdaptor::setData(int index, const QHash<int,QVariant> &values)
return true;
}
+QT_END_NAMESPACE
+
#include "moc_qlistmodeladaptor.cpp"
diff --git a/src/qlistmodelinterface.cpp b/src/qlistmodelinterface.cpp
index c5b120a..ff1abcd 100644
--- a/src/qlistmodelinterface.cpp
+++ b/src/qlistmodelinterface.cpp
@@ -24,6 +24,8 @@
#include "qlistmodelinterface.h"
#include "qdataroles_p.h"
+QT_BEGIN_NAMESPACE
+
/*!
\class QtListModelInterface
\brief provides the abstract interface for list models.
@@ -126,3 +128,5 @@ QHash<int,QString> QtListModelInterface::roles() const
This signal is emitted when the data for \a roles in \a count number of
items were changed in the model beginning with \a index.
*/
+
+QT_END_NAMESPACE
diff --git a/src/qlistselectionmanager.cpp b/src/qlistselectionmanager.cpp
index 9763796..c54e309 100644
--- a/src/qlistselectionmanager.cpp
+++ b/src/qlistselectionmanager.cpp
@@ -27,6 +27,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
// selection change data
QtListSelectionChangeData::QtListSelectionChangeData()
@@ -599,4 +601,6 @@ void QtListSelectionManager::endAnchoredSelection()
}
}
+QT_END_NAMESPACE
+
#include "moc_qlistselectionmanager.cpp"
diff --git a/src/qlistwidgetng.cpp b/src/qlistwidgetng.cpp
index c44904c..08b0381 100644
--- a/src/qlistwidgetng.cpp
+++ b/src/qlistwidgetng.cpp
@@ -30,8 +30,11 @@
#include "qgraphicslistview.h"
#include "qgraphicsscrollbar.h"
+#include <qgraphicsgridlayout.h>
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtListWidgetNGPrivate::QtListWidgetNGPrivate()
: controller(0), scrollbar(0), q_ptr(0)
{
@@ -308,4 +311,6 @@ void QtListWidgetNG::resizeEvent(QResizeEvent *event)
QGraphicsView::resizeEvent(event);
}
+QT_END_NAMESPACE
+
#include "moc_qlistwidgetng.cpp"
diff --git a/src/qlistwidgetng_p.h b/src/qlistwidgetng_p.h
index 490a606..0151c45 100644
--- a/src/qlistwidgetng_p.h
+++ b/src/qlistwidgetng_p.h
@@ -35,13 +35,13 @@
// We mean it.
//
+QT_BEGIN_NAMESPACE
+
class QtListDefaultModel;
class QtListSelectionManager;
class QtListController;
class QtGraphicsScrollBar;
-QT_BEGIN_NAMESPACE
-
class QtListWidgetNGPrivate
{
Q_DECLARE_PUBLIC(QtListWidgetNG)
diff --git a/src/qprinterlistview.cpp b/src/qprinterlistview.cpp
index 3e5bb33..689d9fb 100644
--- a/src/qprinterlistview.cpp
+++ b/src/qprinterlistview.cpp
@@ -36,6 +36,8 @@
#include <qabstracttextdocumentlayout.h>
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtPrinterListViewPrivate::QtPrinterListViewPrivate(QPrinter *p)
: q_ptr(0),
ownsPrinter(p == 0),
@@ -310,6 +312,8 @@ bool QtPrinterListView::print()
// cache the space we have for actual list items.
const qreal contentSize = vertical ? constraint.height() - headerSize - footerSize : constraint.width();
+ view.resize(constraint - QSizeF(0, headerSize + footerSize));
+
// a constraint is -1 in the direction we allow items to grow in.
if (vertical) {
constraint.setHeight(-1);
@@ -324,9 +328,9 @@ bool QtPrinterListView::print()
for (int index = 0; index < max; ++index) {
view.initStyleOption(&widgetOptions, index);
- QSizeF itemSize = listViewItem->sizeHint(index, &widgetOptions, Qt::PreferredSize, constraint);
+ //QSizeF itemSize = listViewItem->sizeHint(index, &widgetOptions, Qt::PreferredSize, constraint);
listViewItem->setIndex(index);
- QRectF geometry(QPointF(), itemSize);
+ QRectF geometry = view.itemGeometry(index);
if (vertical)
geometry.setWidth(constraint.width() / scaleX);
else
@@ -371,4 +375,6 @@ void QtPrinterListView::printModel(QPrinter *printer, QtListModelInterface *mode
printerView.print();
}
+QT_END_NAMESPACE
+
#endif
diff --git a/src/qprintertableview.cpp b/src/qprintertableview.cpp
index abe1049..aa3fefb 100644
--- a/src/qprintertableview.cpp
+++ b/src/qprintertableview.cpp
@@ -36,6 +36,8 @@
#include <qabstracttextdocumentlayout.h>
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
// #define DEBUG_TABLES
QtPrinterTableViewPrivate::QtPrinterTableViewPrivate(QPrinter *p)
@@ -357,4 +359,6 @@ bool QtPrinterTableView::print()
return true;
}
+QT_END_NAMESPACE
+
#endif
diff --git a/src/qtablecontroller.cpp b/src/qtablecontroller.cpp
index 79807c3..d3e1c4e 100644
--- a/src/qtablecontroller.cpp
+++ b/src/qtablecontroller.cpp
@@ -39,6 +39,8 @@
#include <qgraphicssceneevent.h>
+QT_BEGIN_NAMESPACE
+
// QTableHeaderDataProvider
class QTableHeaderDataProvider : public QtGraphicsHeaderDataProvider
@@ -909,4 +911,6 @@ bool QtTableController::processEvent(QEvent *event, const QTransform &transform)
return false;
}
+QT_END_NAMESPACE
+
#include "moc_qtablecontroller.cpp"
diff --git a/src/qtabledefaultmodel.cpp b/src/qtabledefaultmodel.cpp
index 36f0969..0361671 100644
--- a/src/qtabledefaultmodel.cpp
+++ b/src/qtabledefaultmodel.cpp
@@ -23,6 +23,8 @@
#include "qtabledefaultmodel.h"
+QT_BEGIN_NAMESPACE
+
struct QtTableDefaultItemPrivate
{
inline QtTableDefaultItemPrivate() : model(0), index(-1) {}
@@ -538,4 +540,6 @@ void QtTableDefaultModel::itemDeleted(QtTableDefaultItem *item)
}
}
+QT_END_NAMESPACE
+
#include "moc_qtabledefaultmodel.cpp"
diff --git a/src/qtablemodeladaptor.cpp b/src/qtablemodeladaptor.cpp
index 3d98205..574b85c 100644
--- a/src/qtablemodeladaptor.cpp
+++ b/src/qtablemodeladaptor.cpp
@@ -26,6 +26,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtTableModelAdaptorPrivate::QtTableModelAdaptorPrivate()
: q_ptr(0), model(0)
{
@@ -233,4 +235,6 @@ bool QtTableModelAdaptor::setData(int row, int column, const QHash<int,QVariant>
return true;
}
+QT_END_NAMESPACE
+
#include "moc_qtablemodeladaptor.cpp"
diff --git a/src/qtablemodelinterface.cpp b/src/qtablemodelinterface.cpp
index d27c0a0..bce124b 100644
--- a/src/qtablemodelinterface.cpp
+++ b/src/qtablemodelinterface.cpp
@@ -24,6 +24,8 @@
#include "qtablemodelinterface.h"
#include "qdataroles_p.h"
+QT_BEGIN_NAMESPACE
+
/*!
\class QtTableModelInterface
\brief api docs go here
@@ -65,3 +67,5 @@ QHash<int,QString> QtTableModelInterface::roles() const
{
return QtDataRoles::roles();
}
+
+QT_END_NAMESPACE
diff --git a/src/qtableselectionmanager.cpp b/src/qtableselectionmanager.cpp
index 151af2b..df24fb8 100644
--- a/src/qtableselectionmanager.cpp
+++ b/src/qtableselectionmanager.cpp
@@ -26,6 +26,8 @@
#include <qdebug.h>
#include <limits.h>
+QT_BEGIN_NAMESPACE
+
class QtTableSelectionRangePrivate
{
public:
@@ -919,4 +921,6 @@ void QtTableSelectionManager::clearSelections()
}
}
+QT_END_NAMESPACE
+
#include "moc_qtableselectionmanager.cpp"
diff --git a/src/qtablewidgetng.cpp b/src/qtablewidgetng.cpp
index d60c25a..ffe9d26 100644
--- a/src/qtablewidgetng.cpp
+++ b/src/qtablewidgetng.cpp
@@ -33,6 +33,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtTableWidgetNGPrivate::QtTableWidgetNGPrivate()
: controller(0),
verticalScrollbar(0),
@@ -298,4 +300,6 @@ void QtTableWidgetNG::resizeEvent(QResizeEvent *event)
d->updateElementsLayout(r.size());
}
+QT_END_NAMESPACE
+
#include "moc_qtablewidgetng.cpp"
diff --git a/src/qtreecontroller.cpp b/src/qtreecontroller.cpp
index a783c52..8a91c22 100644
--- a/src/qtreecontroller.cpp
+++ b/src/qtreecontroller.cpp
@@ -33,6 +33,8 @@
#include <qtransform.h>
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
// QTreeHeaderDataProvider
class QTreeHeaderDataProvider : public QtGraphicsHeaderDataProvider
@@ -708,4 +710,6 @@ bool QtTreeController::processEvent(QEvent *event, const QTransform &transform)
return false;
}
+QT_END_NAMESPACE
+
#include "moc_qtreecontroller.cpp"
diff --git a/src/qtreedefaultmodel.cpp b/src/qtreedefaultmodel.cpp
index 2c2d5f3..a2578c6 100644
--- a/src/qtreedefaultmodel.cpp
+++ b/src/qtreedefaultmodel.cpp
@@ -23,6 +23,8 @@
#include "qtreedefaultmodel.h"
+QT_BEGIN_NAMESPACE
+
// QtTreeDefaultItemPrivate
struct QtTreeDefaultItemPrivate
@@ -510,4 +512,6 @@ void QtTreeDefaultModel::itemChanged(QtTreeDefaultItem *item, const QList<int> &
emit itemsChanged(it, 1, roles);
}
+QT_END_NAMESPACE
+
#include "moc_qtreedefaultmodel.cpp"
diff --git a/src/qtreemodeladaptor.cpp b/src/qtreemodeladaptor.cpp
index a0d11a5..4b94e05 100644
--- a/src/qtreemodeladaptor.cpp
+++ b/src/qtreemodeladaptor.cpp
@@ -26,6 +26,8 @@
#include <qdebug.h>
+QT_BEGIN_NAMESPACE
+
QtTreeModelAdaptorPrivate::QtTreeModelAdaptorPrivate()
: q_ptr(0), model(0)
{
@@ -252,4 +254,6 @@ int QtTreeModelAdaptor::columnCount(QPersistentModelIndex t) const
return d->model ? d->model->columnCount(t.parent()) : 1;
}
+QT_END_NAMESPACE
+
#include "moc_qtreemodeladaptor.cpp"
diff --git a/src/qtreeselectionmanager.cpp b/src/qtreeselectionmanager.cpp
index 10436d7..f3223d2 100644
--- a/src/qtreeselectionmanager.cpp
+++ b/src/qtreeselectionmanager.cpp
@@ -24,6 +24,8 @@
#include "qtreeselectionmanager.h"
#include "qtreeselectionmanager_p.h"
+QT_BEGIN_NAMESPACE
+
QtTreeSelectionManagerPrivate::QtTreeSelectionManagerPrivate()
: q_ptr(0), model(0), mode(QtTreeSelectionManager::Select)
{
@@ -173,4 +175,6 @@ void QtTreeSelectionManager::clearSelections()
emit selectionsChanged(changed);
}
+QT_END_NAMESPACE
+
#include "moc_qtreeselectionmanager.cpp"
diff --git a/src/qtreewidgetng.cpp b/src/qtreewidgetng.cpp
index a4f8442..e44e4d5 100644
--- a/src/qtreewidgetng.cpp
+++ b/src/qtreewidgetng.cpp
@@ -30,6 +30,8 @@
#include "qgraphicsheader.h"
#include "qgraphicsscrollbar.h"
+QT_BEGIN_NAMESPACE
+
/*!
\internal
*/
@@ -379,4 +381,6 @@ void QtTreeWidgetNG::timerEvent(QTimerEvent *event)
QGraphicsView::timerEvent(event);
}
+QT_END_NAMESPACE
+
#include "moc_qtreewidgetng.cpp"