Ich habe heut mal wieder ein bisjen mit QT4 geübt.
Ich hab ein Problem in kdevelop.
Folgender Beispielcode:
Code: Alles auswählen
#include <QApplication>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QSpinBox>
#include <QSlider>
int main(int argc, char* argv[])
{
QApplication* app = new QApplication(argc, argv);
QWidget* window = new QWidget;
QVBoxLayout* mainlayout = new QVBoxLayout(window);
QHBoxLayout* buttonlayout = new QHBoxLayout;
QLabel* label1 = new QLabel("0");
QSpinBox* spinbox1 = new QSpinBox;
QSlider* slider1 = new QSlider(Qt::Horizontal);
buttonlayout->addWidget(label1);
buttonlayout->addWidget(spinbox1);
buttonlayout->addWidget(slider1);
QPushButton* close = new QPushButton(tr("Close"));
mainlayout->addLayout(buttonlayout);
mainlayout->addWidget(close);
window->show();
return app->exec();
}
die Kompilierung fehlschägt.
In einem vorigen Projekt, das ich auch mit kdevelop programmiert
hab, funktioniert es problemlos. Dabei hab ich gar nichts anders
gemacht.
Als Template hab ich "einfache QT4-Anwendung" und "QT4-Anwendung"
probiert. In keinem funktioniert tr().
Woran kann das liegen? Ich verwende Debian Lenny.