summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-06 10:43:08 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-09 11:10:42 (GMT)
commit195f4b98fbf31a92e27be4533fc2ccae99372b82 (patch)
tree2bb163a7a74f985f52fb38e5c4f664818c85150b /src/gui/widgets
parent9e0c2d6f00cb1195bf7bc1eae34a6f8f9b43191f (diff)
downloadQt-195f4b98fbf31a92e27be4533fc2ccae99372b82.zip
Qt-195f4b98fbf31a92e27be4533fc2ccae99372b82.tar.gz
Qt-195f4b98fbf31a92e27be4533fc2ccae99372b82.tar.bz2
API review: Rename numPages() -> pageCount()
QPrintPreviewWidget wasn't following the Qt API naming convention of *Count()/set*Count(). Introduce proper function, and obsolete the old. Removed all usage of the old function in Qt. Reviewed-by: Andreas Aardal Hanssen
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qprintpreviewwidget.cpp12
-rw-r--r--src/gui/widgets/qprintpreviewwidget.h3
2 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp
index d92b1ea..0074c91 100644
--- a/src/gui/widgets/qprintpreviewwidget.cpp
+++ b/src/gui/widgets/qprintpreviewwidget.cpp
@@ -663,7 +663,9 @@ void QPrintPreviewWidget::setZoomFactor(qreal factor)
}
/*!
+ \obsolete
Returns the number of pages in the preview.
+ \sa pageCount()
*/
int QPrintPreviewWidget::numPages() const
{
@@ -672,6 +674,16 @@ int QPrintPreviewWidget::numPages() const
}
/*!
+ \since 4.6
+ Returns the number of pages in the preview.
+*/
+int QPrintPreviewWidget::pageCount() const
+{
+ Q_D(const QPrintPreviewWidget);
+ return d->pages.size();
+}
+
+/*!
Returns the currently viewed page in the preview.
*/
int QPrintPreviewWidget::currentPage() const
diff --git a/src/gui/widgets/qprintpreviewwidget.h b/src/gui/widgets/qprintpreviewwidget.h
index 2823873..08e596d 100644
--- a/src/gui/widgets/qprintpreviewwidget.h
+++ b/src/gui/widgets/qprintpreviewwidget.h
@@ -82,7 +82,8 @@ public:
ViewMode viewMode() const;
ZoomMode zoomMode() const;
int currentPage() const;
- int numPages() const;
+ QT_DEPRECATED int numPages() const;
+ int pageCount() const;
void setVisible(bool visible);
public Q_SLOTS: