Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    2
    5
    2714
    Loading More Posts
    • 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
      SetBetterPass last edited by

      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 Reply Quote 0
      • B
        beemaster last edited by

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

        1 Reply Last reply Reply Quote 0
        • S
          SetBetterPass last edited by

          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 Reply Quote 0
          • B
            beemaster last edited by

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

            1 Reply Last reply Reply Quote 0
            • S
              SetBetterPass last edited by

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post