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. Reference generated ui_ header from different subproject
Forum Updated to NodeBB v4.3 + New Features

Reference generated ui_ header from different subproject

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 174 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.
  • A Offline
    A Offline
    AlexanderB
    wrote on last edited by
    #1

    Hi all,

    I have a setup in which I have some custom (promoted) widgets. I started with the widgets in the same subproject as where they are used, but to be able to reuse them, I have now moved them to an own subproject.
    To be able to set some specific things oir on or connect to widgets on the custom widget, I use a reference similar to:

    ui->customWidget->ui->widget
    

    But after the move, the generated ui_customwidget.h is not found anymore when building. Even though in QT Creator it all seems to be fine.
    How can I include the generated ui_*.h files into a different subproject? Or is this the wrong way to go, and should I add wrapper methods to the customwidget.h/cpp?

    TiA!

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      It's not directly possible and would somehow contradict the whole class encapsulation - you have to add a setter to the class which uses the ui-file.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AlexanderB
        wrote on last edited by
        #3

        Thanks for the quick reply! I'll add the wrapper methods for the parts that I need.

        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