homescreenapp/hsdomainmodel/src/hspagevisual.cpp
changeset 86 e4f038c420f7
parent 69 87476091b3f5
--- a/homescreenapp/hsdomainmodel/src/hspagevisual.cpp	Wed Aug 18 10:33:57 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hspagevisual.cpp	Mon Sep 13 13:03:23 2010 +0300
@@ -17,7 +17,8 @@
 
 #include "hspagevisual.h"
 #include "hspagetoucharea.h"
-
+#include "hsscene.h"
+#include "hspage.h"
 
 
 /*!
@@ -51,6 +52,17 @@
 {
 }
 
+int HsPageVisual::pageIndex() const
+{
+    QList<HsPage *> pages = HsScene::instance()->pages();
+    for (int i = 0; i < pages.count(); ++i) {
+        if (pages.at(i)->visual() == this) {
+            return i;
+        }
+    }
+    return -1;
+}
+
 void HsPageVisual::setGeometry(const QRectF &rect)
 {
     if (mTouchArea) {