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. [SOLVED] objectName() == ""
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] objectName() == ""

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.6k Views 1 Watching
  • 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.
  • Z Offline
    Z Offline
    Zarkon
    wrote on last edited by
    #1

    It came up in another discussion, but I thought it best to make into a new item.

    Which widgets have no name? I know that I always give proper names to widgets on the form so where do these come from?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Widgets that are created from code by default have no name. Widgets that are created from .ui files by default do have a name (a name is autogenerated for every widget you add to the form).

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zarkon
        wrote on last edited by
        #3

        I thought that the names came only from the ui-file, not from the cpp code. It seems I was wrong about that.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          A .ui file is also compiled into cpp code, so that doesn't make sense. QObject has a method setObjectName. In pre-Qt 4 versions, the object name was even a constructor argument.

          1 Reply Last reply
          0
          • JeroentjehomeJ Offline
            JeroentjehomeJ Offline
            Jeroentjehome
            wrote on last edited by
            #5

            In the constructor code from the ui file the automatic code includes setting the ObjectName!

            Greetz, Jeroen

            1 Reply Last reply
            0

            • Login

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