C++ (Qt)QHash <QString, int> theHash; theHash["First"] = 1;theHash["first"] = 2;
inline uint qHash(const MyString &key){ return ::qHash(key.toUpper()); }
Не имеет к Qt никакого отношения
class MyString : public QString{public: MyString() {} MyString(const MyString &other) : QString(other) {} MyString(const QString &other) : QString(other) {}};inline bool operator<(const MyString &s1, const MyString &s2){ return s1.toUpper() < s2.toUpper(); }inline bool operator==(const MyString &s1, const MyString &s2){ return !s1.compare(s2, Qt::CaseInsensitive); }inline uint qHash(const MyString &key){ return ::qHash(key.toUpper()); }typedef QList<MyString> MyList;typedef QSet<MyString> MySet;class MyStringList : public QStringList{public: MyStringList() {} MyStringList(const MyStringList &other) : QStringList(other) {} MyStringList(const MyList &other) { foreach (const MyString &str, other) append(str); }};template <class T>class MyHash : public QHash<MyString, T>{public: inline QStringList keys() const { return MyStringList(QHash<MyString, T>::keys()); }};template <class T>class MyMap : public QMap<MyString, T>{public: inline QStringList keys() const { return MyStringList(QMap<MyString, T>::keys()); }};