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. Want to know difference between the member functions of QStringList

Want to know difference between the member functions of QStringList

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 492 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.
  • P Offline
    P Offline
    Phadnis
    wrote on last edited by A Former User
    #1

    Hi,
    what is the difference between QStringList::QStringList(const QList<QString> &other) and QStringList &QStringList::operator=(const QList<QString> &other)
    With Thanks

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      First one builds the Qstringlist while creating QStringList object itself from the list QList values. It is like copy constructor. Here there no two QStringList Objects exist here.
      In the second case it uses operator overloading to copy contents of One StringList to Other StringList. Here there are two QStringList objects here. It is copying from one QStringList to Other QStringList object. It is object copy.

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

      1 Reply Last reply
      8
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        http://www.cplusplus.com/doc/tutorial/classes2/

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2

        • Login

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