Qt

Bin grad dabei mich in Qt einzuarbeiten,
dieses simple Programm sollte laut Buch(Qt 4 Gui-Entwicklung mit C++ von Galileo Computing)
Eine Box mit 2 Buttons (1.Aktualliesieren 2. Beenden)
Mit dem 1. Button ändert sich der Text von "alter Text" in "neuer Text" ^^ (... Wow)
der 2. Button beendet das Programm ..

Hab das Beispiel 1:1 aus dem Buch, aber bekomme ne Fehlermeldung aus der ich nicht so ganz schlau werde.
Hilfe !

mywindow.h:
Code:
/*
 * mywindow.h
 *
 *  Created on: 10.10.2009
 *      Author: erteet
 */

#ifndef MYWINDOW_H_
#define MYWINDSW_H_

#include <QWidget>
#include <QObject>
#include <QPushButton>
#include <QLabel>
#include <QBoxLayout>


class MyWindow : public QWidget
{
	Q_OBJECT

	private:
		QLabel *label;
		QPushButton *button0;
		QPushButton *button1;
		QVBoxLayout* layout;
	private slots:
		void setText();

	public:
		MyWindow(QWidget *parent = 0);
};
#endif /* MYWINDOW_H_ */

mywindow.cpp:
Code:
#include "mywindow.h"

MyWindow::MyWindow(Qwidget *parent = 0) : Qwidget(parent)
{
	label = new QLabel("alter Text");
	button0 = new PushButton("Label Aktualisieren");
	button1 = new PushButton("Beenden");
	layout = new QVBoxLayout(this);
	layout->addWidget(label);
	layout->addWidget(button0);
	layout->addWidget(button1);

	setLayout(layout);
	QObject::connect(button0, SIGNAL(clicked()),
					 this, SLOT( setText()));
	QObject::connect(button1, SIGNAL(clicked()),
					 this, SLOT( quit() ) );
}

void MyWindow::setText(){
	label->setText("neuerText");
}

main.cpp:
Code:
#include "mywindow.h"
#include <QApplication>

int main(int argc, char **argv)
{
	QApplication app(argc, argv);
	MyWindow* window = new MyWindow;
	window->show();
	return app.exec();
}

Fehlermeldung:
Code:
erteet@Logic:~/coding/learnqt/MyClass$ qmake -project
erteet@Logic:~/coding/learnqt/MyClass$ qmake
erteet@Logic:~/coding/learnqt/MyClass$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o mywindow.o mywindow.cpp
mywindow.cpp:5: Fehler: expected `)' before ?*? token
make: *** [mywindow.o] Fehler 1

Sprich bei der Parameterliste des Konstruktors von MyWindow.
Also wenn jemand ne Idee hat nur zu.

mfg prEs
 
Zurück
Oben