Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT Design Studio - Generation of objectName
Qt 6.12 LTS is out! See what's new in the release blog

QT Design Studio - Generation of objectName

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 757 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.
  • T Offline
    T Offline
    Targo
    wrote on last edited by
    #1

    The generated "*.ui.qml" files by QT Design Studio, create an "id" for each component but do not generate an "objectName". Finding components is typically done using the "objectName". Is it possible to ensure QT Design Studio generates an "objectName" for each component? If not, how is one supposed to be able to find/reference the components from python or c++?

    JKSHJ 1 Reply Last reply
    0
    • T Targo

      The generated "*.ui.qml" files by QT Design Studio, create an "id" for each component but do not generate an "objectName". Finding components is typically done using the "objectName". Is it possible to ensure QT Design Studio generates an "objectName" for each component? If not, how is one supposed to be able to find/reference the components from python or c++?

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome!

      @Targo said in QT Design Studio - Generation of objectName:

      Is it possible to ensure QT Design Studio generates an "objectName" for each component?

      Qt Design Studio does not currently let us edit the objectNames via the property editor. You could manually add it via the code editor, however: https://doc.qt.io/qtdesignstudio/qtquick-text-editor.html

      @Targo said in QT Design Studio - Generation of objectName:

      Finding components is typically done using the "objectName" ... how is one supposed to be able to find/reference the components from python or c++?

      May I ask where you learnt about finding items using "objectName"?

      The current recommendation is to expose C++/Python classes to QML via QML_ELEMENT/QmlElement: https://doc.qt.io/qt-6/qtqml-cppintegration-overview.html This way, you can call C++/Python methods from QML.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      1
      • SGaistS SGaist moved this topic from Qt in Education on

      • Login

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