LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   KDevelop 3 and QT-Designer (https://www.linuxquestions.org/questions/programming-9/kdevelop-3-and-qt-designer-230335/)

JSmith 09-13-2004 11:07 PM

KDevelop 3 and QT-Designer
 
Hey folks,

What are you supposed to do with the .ui file created with QT-Designer? I have it in my debug/src directory.

When I compile it creates a .h, a .cpp, and .moc file from it...so all seems good. But it also spits out a ton of errors saying that what is defined in the .moc file was already defined in the .cpp

I tried doing a "Clean Project" and a "Dist Clean", and then rerunning "AutoMake and Friends" and 'configure". After doing so, all 3 of those files are deleted. But when I compile, they all come back and spit out the same errors.

Here's an example of the errors: How do you prevent this?



/home/myUser/myProject/debug/src/mainWindow.cpp:30: multiple definition of `mainWindow::mainWindow[not-in-charge](QWidget*, char const*, bool, unsigned)'
*mainWindow.o(.text+0x0):/home/myUser/myProject/debug/src/mainWindow.cpp:30: first defined here
*mainWindow.o(.text+0xa7a): In function `mainWindow::languageChange()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:81: multiple definition of `mainWindow::languageChange()'
*mainWindow.o(.text+0xa7a):/home/myUser/myProject/debug/src/mainWindow.cpp:81: first defined here
*mainWindow.o(.text+0x4d4): In function `mainWindow::mainWindow[in-charge](QWidget*, char const*, bool, unsigned)':
*/home/myUser/myProject/debug/src/mainWindow.cpp:30: multiple definition of `mainWindow::mainWindow[in-charge](QWidget*, char const*, bool, unsigned)'
*mainWindow.o(.text+0x4d4):/home/myUser/myProject/debug/src/mainWindow.cpp:30: first defined here
*mainWindow.o(.text+0x9a8): In function `mainWindow::~mainWindow [not-in-charge]()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:72: multiple definition of `mainWindow::~mainWindow [not-in-charge]()'
*mainWindow.o(.text+0x9a8):/home/myUser/myProject/debug/src/mainWindow.cpp:72: first defined here
*mainWindow.o(.text+0x9ee): In function `mainWindow::~mainWindow [in-charge]()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:72: multiple definition of `mainWindow::~mainWindow [in-charge]()'
*mainWindow.o(.text+0x9ee):/home/myUser/myProject/debug/src/mainWindow.cpp:72: first defined here
*mainWindow.o(.text+0xa34): In function `mainWindow::~mainWindow [in-charge deleting]()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:72: multiple definition of `mainWindow::~mainWindow [in-charge deleting]()'
*mainWindow.o(.text+0xa34):/home/myUser/myProject/debug/src/mainWindow.cpp:72: first defined here
*mainWindow.o(.text+0xc96): In function `mainWindow::slotSourceAddrClicked()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:92: multiple definition of `mainWindow::slotSourceAddrClicked()'
*mainWindow.o(.text+0xc96):/home/myUser/myProject/debug/src/mainWindow.cpp:92: first defined here
*mainWindow.o(.text+0xcae): In function `mainWindow::slotDestAddrClicked()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:97: multiple definition of `mainWindow::slotDestAddrClicked()'
*mainWindow.o(.text+0xcae):/home/myUser/myProject/debug/src/mainWindow.cpp:97: first defined here
*mainWindow.o(.text+0xcc6): In function `mainWindow::slotUpdatePortsClicked()':
*/home/myUser/myProject/debug/src/mainWindow.cpp:102: multiple definition of `mainWindow::slotUpdatePortsClicked()'
*mainWindow.o(.text+0xcc6):/home/myUser/myProject/debug/src/mainWindow.cpp:102: first defined here

JSmith 09-15-2004 09:20 PM

anyone?

leonscape 09-15-2004 09:40 PM

I recommended you read this Qt Designer & KDevelop 3 which covers how to use these programs together best.

alexrait1 09-16-2004 12:55 PM

Suppose you create a ui file with qt-designer. Actually you look at it as it was some kind of a base class from which you will subclass your own.
In kdevelop 3 you can add the ui file (in addition if you have ui.h just add it into the project).
Suppose your filename is coolgui.ui, and the name of the class is coolgui, so all you have to do is to include coolgui.h (even if you don't see that file currently, qt tools will make sure it will appear during the compilation) and to subclass.


All times are GMT -5. The time now is 06:51 PM.