Qt Forum

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

    Unsolved problem with promoting widget.

    General and Desktop
    2
    6
    1455
    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.
    • B
      beqa last edited by

      I add new qt designer form class (class name Form) and add one label in there . when i simply promote from mainwindow 's widget , trow me a vague error:
      LNK2019: unresolved external symbol "public: __cdecl Form::Form(class QWidget *)" (??0Form@@QEAA@PEAVQWidget@@@Z) referenced in function "public: void __cdecl Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QEAAXPEAVQMainWindow@@@Z)

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        Make sure your Form widget does in fact have a constructor taking
        Form::Form(class QWidget *)
        Else we need to see some code to give guesses :)

        1 Reply Last reply Reply Quote 0
        • B
          beqa last edited by

          hi
          Yes. it has it. Form class createed by dafault, only i add button in ui. Also mainwindow class is empty, only add widget, then promote it. what do i miss?

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @beqa last edited by mrjj

            @beqa
            Not sure, it sounds ok. Without code its just random guesses..

            I can make u fast sample for test.
            https://www.dropbox.com/s/4cmo89vu24v6mfi/mypromoted.zip?dl=0

            1 Reply Last reply Reply Quote 1
            • B
              beqa last edited by

              you are welcome. when i run my project after yours, it works, I dont know why but woks now :D very thanks

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @beqa last edited by

                @beqa
                Ok that is odd :)
                Maybe try run qmake manually.
                Only thing i can think of.

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