This is the error I got after running the following commands:
qmake -project
qmake
makehere is my header file format...moc_desktop.o: In function `MyDesktop:: progs_Clicked()':
/home/nupul/trials/2desktop/moc_desktop.cpp:93: multiple definition of
`MyDesktop:: progs_Clicked()'
desktop.o:/home/nupul/trials/2desktop/desktop.cpp:94: first defined here
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `MyDesktop:: progs_Clicked()' changed from 24 in desktop.o to 29 in moc_desktop.o
moc_desktop.o: In function `MyDesktop:: docs_Clicked()':
/home/nupul/trials/2desktop/moc_desktop.cpp:87: multiple definition of
`MyDesktop:: docs_Clicked()'
desktop.o:/home/nupul/trials/2desktop/desktop.cpp:87: first defined here
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `MyDesktop:: docs_Clicked()' changed from 24 in desktop.o to 29 in moc_desktop.o
moc_desktop.o: In function `MyDesktop::mycomp_Clicked()':
/home/nupul/trials/2desktop/moc_desktop.cpp:81: multiple definition of `MyDesktop::mycomp_Clicked()'
desktop.o:/home/nupul/trials/2desktop/desktop.cpp:80: first defined here
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: Warning: size of symbol `MyDesktop::mycomp_Clicked()' changed from 24 in desktop.o to 29 in moc_desktop.o
collect2: ld returned 1 exit status
make: *** [2desktop] Error 1
Qt Code:
{ Q_OBJECT private: QPushButton *mycomp; QPushButton *docs; QPushButton *progs; QPushButton *trash; QBrush brush; QPalette pal; void getBackground(); void createButtons(); public: MyDesktop(); signals: void showMyComputerMenu(); protected: }; #endifTo copy to clipboard, switch view to plain text mode
This is my constructor
Qt Code:
{ setGeometry(100,100,400,400); setWindowTitle("My Desktop"); getBackground(); createButtons(); connect(mycomp,SIGNAL(clicked()),this,SLOT(showMyComputerMenu())); }To copy to clipboard, switch view to plain text mode
and this is the signal
Qt Code:
void MyDesktop::showMyComputerMenu() { qDebug("My computer signal activate"); }To copy to clipboard, switch view to plain text mode
Now the thing is this...if i change my signal: showMyComputerMenu to a slot, and run the aforementioned command sequence,
it works fine! No errors pop-up. I read through the docs, and it said qmake can take care of all the signals/slots etc. I have a feeling that I am missing out something...like running moc, But I am not able to understand at all what am I exactly supposed to do???
Thanks
Nupul.
Bookmarks