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. QList no matching constructor error
Forum Updated to NodeBB v4.3 + New Features

QList no matching constructor error

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 2.1k Views
  • 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.
  • B Offline
    B Offline
    Bharth
    wrote on 31 Jan 2019, 12:22 last edited by
    #1

    Hi ,,,
    its showing no matching constructor for initialization of qList
    please help me to slove this
    this is the line i added

    QList<XperienceAccount*> memberList = new QList<XperienceAccount>(contactlist)

    thanks in adavnce

    J 1 Reply Last reply 31 Jan 2019, 12:44
    0
    • B Bharth
      31 Jan 2019, 12:22

      Hi ,,,
      its showing no matching constructor for initialization of qList
      please help me to slove this
      this is the line i added

      QList<XperienceAccount*> memberList = new QList<XperienceAccount>(contactlist)

      thanks in adavnce

      J Offline
      J Offline
      JonB
      wrote on 31 Jan 2019, 12:44 last edited by JonB
      #2

      @Bharth
      I don't do C++, but the lhs is a list of pointers XperienceAccount* while the rhs is a list of XperienceAccount. One or other needs changing (depending on what you've got in contactlist) so that they match either pointer or non-pointer.

      1 Reply Last reply
      3
      • D Offline
        D Offline
        dheerendra
        Qt Champions 2022
        wrote on 31 Jan 2019, 12:52 last edited by
        #3

        In addition to what @JonB said you can look at the following snippet

        QList<QPushButton*> list1;
        for(int i=0;i<10;i++){
             list1.append(new QPushButton);
        }
        
        QList<QPushButton*> *list = new QList<QPushButton*>(list1);
        

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        3

        1/3

        31 Jan 2019, 12:22

        • Login

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