[SOLVED] QHash string error
General and Desktop
2
Posts
1
Posters
2.2k
Views
1
Watching
-
i am trying to use QHash as strings instead of arrays as variables. for example, with arrays i need to use ...
@userselect[100]; @
but with QHash i can use i think...
@userselect[stringName] @
below is the code and the error i am getting. i am trying to use a string in the qhash but it is not working.mainwindow.h
@#include <QHash>
private:
QHash<QString,QString> users;
@mainwindow.cpp
@QString userselect;
userselect = "name";
QStringList userselect;
users[userselect] = "test";
@error: no match for 'operator[]' in '((MainWindow*)this)->MainWindow::users[userSelect]'