May 6, 2012

Cayan Cayan
Lab Rat
32 posts

Does Qt has any unordered containers?


I would like to know if Qt supports any unordered containers, since I could not find anything about it on the documentation I came here to confirm it.

In case it doesn’t have would the could below be a workaround for my class?

  1. inline bool operator<(const MyClass& class1)
  2. {
  3.      return false;
  4. }

Since c1 < c2 and c2 < c1, Qt will assume they are equal, according to the documentation.

1 reply

May 6, 2012

MuldeR MuldeR
Hobby Entomologist
818 posts

I’m not exactly sure what you mean, but QSet and QHash are “unordered” containers.

(They don’t retain a specific order of the elements. Instead they provide fast hash-based lookup)


My OpenSource software at:

Qt v4.8.6 MSVC 2013, static/shared:

Go visit the coop:

  ‹‹ I’m having a problem with a loop not sure whats going on... please help.      How test QTableView edition with QTest ? ››

You must log in to post a reply. Not a member yet? Register here!