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]Qt designer generates two classes with same name from two different ui files.
Forum Update on Monday, May 27th 2025

[Solved]Qt designer generates two classes with same name from two different ui files.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 3.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.
  • S Offline
    S Offline
    SetBetterPass
    wrote on 30 Mar 2013, 11:28 last edited by
    #1

    I have weird problem with adding new form to my project, I have two different widgets created in qt designer, one is mainTab, I added it to project time ago, second is history I am trying to add now. The problem is the designer generated .h files from the .ui files but both have same class names, Ui_Form, so I can't use it in main window together. I run qmake but nothing changed. What can I do?

    errors:
    /root/MD-build-desktop/ui_history.h:25: error: redefinition of ‘class Ui_Form’
    /root/MD-build-desktop/ui_mainTab.h:31: error: previous definition of ‘class Ui_Form’ ()
    /root/MD-build-desktop/ui_history.h:68: error: redefinition of ‘class Ui::Form’ (this makes new class Form as public class of Ui_Form in namespace Ui)
    /root/MD-build-desktop/ui_mainTab.h:327: error: previous definition of ‘class Ui::Form’

    1 Reply Last reply
    0
    • B Offline
      B Offline
      beemaster
      wrote on 30 Mar 2013, 12:08 last edited by
      #2

      You can rename one of the files to something other than Form

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SetBetterPass
        wrote on 30 Mar 2013, 13:26 last edited by
        #3

        How? One file is history.ui and other maintab.ui, they generate ui_history.h and ui_maintab.h but classes declared in those files are both named Ui_Form, I have no file named Form.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          beemaster
          wrote on 30 Mar 2013, 14:21 last edited by
          #4

          Maybe if you open them in Designer you can change "Form" in properties?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SetBetterPass
            wrote on 30 Mar 2013, 14:29 last edited by
            #5

            Ok find out where it is set, I'm just lame^

            1 Reply Last reply
            0

            1/5

            30 Mar 2013, 11:28

            • Login

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