我已经按楼上的一步步地做了
在编译 demos 出现了以下错误:
好慢啊,今天花了一个下午把 Qt -embedded 编译好了
在编译demos 时发现错误:
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/mkspecs/qws/linux-arm-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.1-arm/include -I. -I. -Iaffine -Ishared -Ideform -Igradients -Ipathstroke -Icomposition -Ibooks -Iboxes -Iboxes/3rdparty -Ibrowser -Ichip -Iembeddeddialogs -Iinterview -Imacmainwindow -Imainwindow -Imediaplayer -Iqtdemo -Ispreadsheet -Isqlbrowser -Itextedit -Iundo -Iembedded/embeddedsvgviewer -Iembedded/fluidlauncher -Iembedded/styledemo -I. -I. -o bookdelegate.o books/bookdelegate.cpp
In file included from books/bookdelegate.cpp:42:
books/bookdelegate.h:48:34: error: QSqlRelationalDelegate: No such file or directory
In file included from books/bookdelegate.cpp:42:
books/bookdelegate.h:53: error: expected class-name before '{' token
books/bookdelegate.h:57: error: expected ',' or '...' before '&' token
books/bookdelegate.h:58: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:60: error: expected ',' or '...' before '&' token
books/bookdelegate.h:60: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:63: error: expected ',' or '...' before '&' token
books/bookdelegate.h:64: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.h:66: error: expected ',' or '...' before '&' token
books/bookdelegate.h:67: error: ISO C++ forbids declaration of 'QStyleOptionViewItem' with no type
books/bookdelegate.cpp: In constructor 'BookDelegate::BookDelegate(QObject*)':
books/bookdelegate.cpp:47: error: class 'BookDelegate' does not have any field named 'QSqlRelationalDelegate'
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:52: error: prototype for 'void BookDelegate::paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:58: error: candidate is: void BookDelegate::paint(QPainter*, int) const
books/bookdelegate.cpp: In member function 'void BookDelegate::paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:57: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp:75: error: 'drawFocus' was not declared in this scope
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:86: error: prototype for 'QSize BookDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:60: error: candidate is: QSize BookDelegate::sizeHint(int) const
books/bookdelegate.cpp: In member function 'QSize BookDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:91: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:96: error: prototype for 'bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, const QStyleOptionViewItem&, const QModelIndex&)' does not match any in class 'BookDelegate'
books/bookdelegate.h:64: error: candidate is: bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, int)
books/bookdelegate.cpp: In member function 'bool BookDelegate::editorEvent(QEvent*, QAbstractItemModel*, const QStyleOptionViewItem&, const QModelIndex&)':
books/bookdelegate.cpp:99: error: 'QSqlRelationalDelegate' has not been declared
books/bookdelegate.cpp: At global scope:
books/bookdelegate.cpp:113: error: prototype for 'QWidget* BookDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const' does not match any in class 'BookDelegate'
books/bookdelegate.h:67: error: candidate is: QWidget* BookDelegate::createEditor(QWidget*, int) const
books/bookdelegate.cpp: In member function 'QWidget* BookDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const':
books/bookdelegate.cpp:116: error: 'QSqlRelationalDelegate' has not been declared
make: *** [bookdelegate.o] Error 1
望楼主能看一下,非常感谢!