How to create QList of 2 demension?
-
@BjornW
Also if you using std::set<std::pair<T, T> > or std::multiset or std::priority_queue<> you dont need seperate sort function.
He is sorted by the first drawer. -
Sorry, my example was not fully correct:
struct Bookmark { QString title; QString url; } void test() { QList<Bookmark> bookmarks; Bookmark mark; mark.title = "Hello"; mark.url = "World"; bookmarks.append(mark); }
So yes, all QList function work here.
@aha_1980
Thank you for your resolution, I have finished history record of QWebView with 3 members!
https://github.com/sonichy/Qt_HTYBrowser// define struct History { QString stime; QString title; QString surl; }; // append QList<History> historys; History history; history.stime = strlist.at(0); history.title = strlist.at(1); history.surl = strlist.at(2); historys.append(history); // use historys.at(i).stime historys.at(i).surl historys.at(i).title