tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -93,15 +93,23 @@
                         QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png")));
 }
 
+void QtCursorDatabase::clear()
+{
+    m_cursorNames.clear();
+    m_cursorIcons.clear();
+    m_valueToCursorShape.clear();
+    m_cursorShapeToValue.clear();
+}
+
 void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon)
 {
     if (m_cursorShapeToValue.contains(shape))
         return;
-    int value = m_cursorNames.count();
+    const int value = m_cursorNames.count();
     m_cursorNames.append(name);
-    m_cursorIcons[value] = icon;
-    m_valueToCursorShape[value] = shape;
-    m_cursorShapeToValue[shape] = value;
+    m_cursorIcons.insert(value, icon);
+    m_valueToCursorShape.insert(value, shape);
+    m_cursorShapeToValue.insert(shape, value);
 }
 
 QStringList QtCursorDatabase::cursorShapeNames() const