Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create QList of 2 demension?
Forum Updated to NodeBB v4.3 + New Features

How to create QList of 2 demension?

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 9 Posters 6.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Taz742T Taz742

    @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.

    BjornWB Offline
    BjornWB Offline
    BjornW
    wrote on last edited by
    #21

    @Taz742 I was compering to the alternative using a struct. Also set and list are different, he didn't mention anything about unique values.

    1 Reply Last reply
    0
    • aha_1980A aha_1980

      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.

      sonichyS Offline
      sonichyS Offline
      sonichy
      wrote on last edited by sonichy
      #22

      @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

      https://github.com/sonichy

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved