tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
    91                         QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-whatsthis.png")));
    91                         QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-whatsthis.png")));
    92     appendCursor(Qt::BusyCursor, QApplication::translate("QtCursorDatabase", "Busy", 0,
    92     appendCursor(Qt::BusyCursor, QApplication::translate("QtCursorDatabase", "Busy", 0,
    93                         QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png")));
    93                         QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png")));
    94 }
    94 }
    95 
    95 
       
    96 void QtCursorDatabase::clear()
       
    97 {
       
    98     m_cursorNames.clear();
       
    99     m_cursorIcons.clear();
       
   100     m_valueToCursorShape.clear();
       
   101     m_cursorShapeToValue.clear();
       
   102 }
       
   103 
    96 void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon)
   104 void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon)
    97 {
   105 {
    98     if (m_cursorShapeToValue.contains(shape))
   106     if (m_cursorShapeToValue.contains(shape))
    99         return;
   107         return;
   100     int value = m_cursorNames.count();
   108     const int value = m_cursorNames.count();
   101     m_cursorNames.append(name);
   109     m_cursorNames.append(name);
   102     m_cursorIcons[value] = icon;
   110     m_cursorIcons.insert(value, icon);
   103     m_valueToCursorShape[value] = shape;
   111     m_valueToCursorShape.insert(value, shape);
   104     m_cursorShapeToValue[shape] = value;
   112     m_cursorShapeToValue.insert(shape, value);
   105 }
   113 }
   106 
   114 
   107 QStringList QtCursorDatabase::cursorShapeNames() const
   115 QStringList QtCursorDatabase::cursorShapeNames() const
   108 {
   116 {
   109     return m_cursorNames;
   117     return m_cursorNames;