Beispiel einer MOC Ersetzung


... [ Seminar Linux und Apache ] ... [ Thema Komponentenmodell von KDE 2 ] ... [ zurück ] ...

eine kurze Beispieldatei: simpleapp.h   inkl. MOC-Schlüselwörtern
1 
2  #include <ktmainwindow.h>
3 
4   class QLabel;
5   class KSimpleApp : public KTMainWindow
6   {
7    Q_OBJECT     //enables slots and signals  (moc)
8 
9    public:
10    KSimpleApp (const char *name=0);
11 
12   public slots:
13    void slotRepositionText();
14 
15   private:
16    QLabel *text;
17    int alignment [3], indexalignment;
18   };
19 
	


die daraus entstandene Datei: simpleapp.moc   mit ersetzten MOC-Schlüselwörtern
1 
2  /****************************************************************************
3  ** KSimpleApp meta object code from reading C++ file 'ksimpleapp.h'
4  ** Created: Tue Nov 6 18:28:34 2001
5  **      by: The Qt MOC ($Id: moc.html,v 1.1 2001/12/10 09:44:51 si Exp $)
6  **
7  ** WARNING! All changes made in this file will be lost!
8  *****************************************************************************/
9 
10 #if !defined(Q_MOC_OUTPUT_REVISION)
11 #define Q_MOC_OUTPUT_REVISION 9
12 #elif Q_MOC_OUTPUT_REVISION != 9
13 #error "Moc format conflict - please regenerate all moc files"
14 #endif
15 
16 #include "ksimpleapp.h"
17 #include <qmetaobject.h>
18 #include <qapplication.h>
19 
20 const char *KSimpleApp::className() const
21 {
22     return "KSimpleApp";
23 }
24 
25 QMetaObject *KSimpleApp::metaObj = 0;
26 
27 void KSimpleApp::initMetaObject()
28 {
29     if ( metaObj )
30 	return;
31     if ( qstrcmp(KTMainWindow::className(), "KTMainWindow") != 0 )
32 	badSuperclassWarning("KSimpleApp","KTMainWindow");
33     (void) staticMetaObject();
34 }
35 
36 #ifndef QT_NO_TRANSLATION
37 
38 QString KSimpleApp::tr(const char* s)
39 {
40     return qApp->translate( "KSimpleApp", s, 0 );
41 }
42 
43 QString KSimpleApp::tr(const char* s, const char * c)
44 {
45     return qApp->translate( "KSimpleApp", s, c );
46 }
47 
48 #endif // QT_NO_TRANSLATION
49 
50 QMetaObject* KSimpleApp::staticMetaObject()
51 {
52     if ( metaObj )
53 	return metaObj;
54     (void) KTMainWindow::staticMetaObject();
55 #ifndef QT_NO_PROPERTIES
56 #endif // QT_NO_PROPERTIES
57     typedef void (KSimpleApp::*m1_t0)();
58     typedef void (QObject::*om1_t0)();
59     m1_t0 v1_0 = &KSimpleApp::slotRepositionText;
60     om1_t0 ov1_0 = (om1_t0)v1_0;
61     QMetaData *slot_tbl = QMetaObject::new_metadata(1);
62     QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
63     slot_tbl[0].name = "slotRepositionText()";
64     slot_tbl[0].ptr = (QMember)ov1_0;
65     slot_tbl_access[0] = QMetaData::Public;
66     metaObj = QMetaObject::new_metaobject(
67 	"KSimpleApp", "KTMainWindow",
68 	slot_tbl, 1,
69 	0, 0,
70 #ifndef QT_NO_PROPERTIES
71 	0, 0,
72 	0, 0,
73 #endif // QT_NO_PROPERTIES
74 	0, 0 );
75     metaObj->set_slot_access( slot_tbl_access );
76 #ifndef QT_NO_PROPERTIES
77 #endif // QT_NO_PROPERTIES
78     return metaObj;
79 }
80 
	



... [ Seminar Linux und Apache] ... [ Thema Komponentenmodell von KDE 2 ] ... [ nach oben ] ... [ zurück ] ...