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. QWidget *parent = nullptr ?
Forum Update on Monday, May 27th 2025

QWidget *parent = nullptr ?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 3.6k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Should we be doing it this way? QWidget *parent = nullptr ? Or keep using '0' ?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      o/ vote for nullptr
      http://stackoverflow.com/questions/13816385/what-are-the-advantages-of-using-nullptr

      ? 1 Reply Last reply
      2
      • mrjjM mrjj

        o/ vote for nullptr
        http://stackoverflow.com/questions/13816385/what-are-the-advantages-of-using-nullptr

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @mrjj That's good enough for me!! Been wondering about that one for a while.

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

          I say Q_NULLPTR so that it becomes nullptr if the copiler supports it, otherwise it reverts to the good old NULL (i.e. 0)

          "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