Results 1 to 3 of 3

Thread: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]

  1. #1
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]

    Hi everyone,
    Hope everything is going well.
    I'm beginner, after build&Run following warning occurs:
    'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]
    May anyone help me to resolve it?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]

    [ChangeLog][QtCore][QString] QString::null is now deprecated. When
    used to construct a QString, use QString() instead. When used to
    compare to a QString, replace with QString::isNull().
    search your code for both cases and correct as states in the above quote.
    (By the way, when they say use QString() instead, its meant instead of QString(QString::null); )
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    CodeFreak (4th January 2018)

  4. #3
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]

    I didn't pay attention.
    It simply solved by replacing QString::null with QString() .

Similar Threads

  1. Replies: 3
    Last Post: 27th December 2013, 19:04
  2. Replies: 3
    Last Post: 27th July 2012, 10:30
  3. Replies: 2
    Last Post: 11th August 2011, 16:42
  4. Replies: 4
    Last Post: 1st February 2010, 15:21
  5. Replies: 4
    Last Post: 31st January 2008, 21:44

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.