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. Ui classes and export/import
QtWS25 Last Chance

Ui classes and export/import

Scheduled Pinned Locked Moved Unsolved General and Desktop
libraryqmakevisibility
1 Posts 1 Posters 1.0k 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.
  • kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by
    #1

    Hello,
    I have some user interface put into a dynamic library. It does contain some widgets that I don't want exported, so I've given them the Q_DECL_HIDDEN specifier. Then I have a form that employs one of those widgets, so the uic is generating a class for me. The problem is I get the following warning:

    "'SomeUiGeneratedClass' declared with greater visibility than the type of its field SomeUiGeneratedClass::notExportedClassMember".

    I know that g++ is trying to export the Ui generated class because no explicit visibility was specified (since it's generated). Is there any way to tell qmake/uic that I don't want my Ui classes generated in the global namespace, but instead for example in an anonymous one? I realize I could pass g++ the relevant flag, but since I'm going to compile on different platforms, and probably want to support other compilers beside g++ I'm looking for a somewhat portable solution. Any suggestions are greatly appreciated.

    (I'm currently developing with Qt 5.6 on Linux with g++)

    Kind regards.

    Read and abide by the Qt Code of Conduct

    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