Results 1 to 2 of 2

Thread: Kind of constructor

  1. #1
    Join Date
    Mar 2015
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Kind of constructor

    Hi everyone,
    I write code of my application and I'd like to know What kind of constructor is called in situation:
    Qt Code:
    1. QDate date(ui->dateTo->date());
    To copy to clipboard, switch view to plain text mode 
    Move constructor or copy constructor?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Kind of constructor

    If date() returns a copy and a move constructor is available for QDate then it should be a move constructor. If date() returns a const reference then a copy constructor will be used. It is left as an exercise to the reader to check which is the case
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. What kind of project for QTest?
    By feraudyh in forum Newbie
    Replies: 2
    Last Post: 12th May 2014, 13:58
  2. Hi all. I give up (not really, but yes, kind of)
    By tachoknight in forum Newbie
    Replies: 1
    Last Post: 4th December 2010, 02:57
  3. Can anybody explain me this 'kind of casting'¿?
    By tonnot in forum General Programming
    Replies: 6
    Last Post: 28th November 2010, 19:39
  4. diffrend kind of lists of GUI
    By tomixer in forum Qt Programming
    Replies: 7
    Last Post: 12th September 2010, 22:44
  5. How to code this kind of UI?
    By stephenteh in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 23rd September 2009, 11:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.