• 11.05.2024, 16:56
  • Registrieren
  • Anmelden
  • Sie sind nicht angemeldet.

 

Yet another Q_OBJECT-Makro-Problem...

Montag, 14. Februar 2005, 22:19

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _MAINWIDGET_H_
#define _MAINWIDGET_H_

class CMainWidget : public QWidget
{
private:
      Q_OBJECT
      QMenuBar * itsMenu;
      QPopupMenu * itsFileMenu;
      QPopupMenu * itsOpenMenu;
      QPopupMenu * itsEditMenu;

      std::vector<QListViewItem*> itsListItems;
public:
    CMainWidget( QWidget *parent=0, const char *name=0 );

public slots:
      void openWindow();

signals:
};

#endif


Zitat

Moc'ing MainWidget.h...
Kompilieren...
moc_MainWidget.cpp
e:\Projekte\...\MGCC\Source_Qt\tmp\moc\../../MainWidget.h(5) : error C2504: 'QWidget': Basisklasse undefiniert
e:\Projekte\...\MGCC\Source_Qt\tmp\moc\../../MainWidget.h(8) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner 'QMenuBar'
e:\Projekte\...\MGCC\Source_Qt\tmp\moc\../../MainWidget.h(8) : error C2501: 'CMainWidget::Q_OBJECT': Fehlende Speicherklasse oder Typspezifizierer
e:\Projekte\...\MGCC\Source_Qt\tmp\moc\../../MainWidget.h(8) : error C2143: Syntaxfehler: Es fehlt ';' vor '*'


Was mach ich falsch? Ich brauch doch Q_OBJECT für die slots/signals.... Aber dann findet der aufeinmal ein QWidget mehr (QVBox geht auch ned) :(

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

Re: Yet another Q_OBJECT-Makro-Problem...

Montag, 14. Februar 2005, 22:23

Hat sich erledigt....
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

Re: Yet another Q_OBJECT-Makro-Problem...

Montag, 14. Februar 2005, 22:23

Wie?

Re: Yet another Q_OBJECT-Makro-Problem...

Montag, 14. Februar 2005, 22:33

Hab die Header-Files für die MOC-File falsch verlinkt.

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

Re: Yet another Q_OBJECT-Makro-Problem...

Dienstag, 15. Februar 2005, 03:17

für fast den gleichen fehler hättste auch das andere topic missbrauchen können ;P

Re: Yet another Q_OBJECT-Makro-Problem...

Dienstag, 15. Februar 2005, 08:57

Zitat von »Y0Gi«

für fast den gleichen fehler hättste auch das andere topic missbrauchen können ;P


Nee, das ging darum, dass ich nichma was von MOC gehört hatte. War schon was anderes ;D

MFG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.