首页| 论坛| 消息

标题:【提问】例子程序错在哪?
作者:修罗王1981
日期:2005-11-11 15:53
内容:

我用了qt的一个程序结果出错了
请指教!
aclock.h:
#ifndef ACLOCK_H
#define ACLOCK_H

#include
#include

class AnalogClock : public QWidget // analog clock widget
{
Q_OBJECT
public:
AnalogClock( QWidget *parent=0, const char *name=0 );
void setAutoMask(bool b);

protected:
void updateMask();
void paintEvent( QPaintEvent *);

private slots:
void drawClock( QPainter * );
void timeout();

private:
QTime time;
};
#endif // ACLOCK_H

aclock.cpp:
#include "aclock.h"
#include
#include
#include
AnalogClock::AnalogClock( QWidget *parent, const char *name )
: QWidget( parent, name )
{
time = QTime::currentTime(); // get current time
QTimer *int ..


#1 [deweyjew 11-11 16:34]
你去看看qpainter.h的源文件,可以看到以下内容
#ifndef QT_NO_TRANSFORMATIONS
void setViewXForm( bool ); // set xform on/off
QRect window() const; // get window
void setWindow( const QRect & ); // set window
void setWindow( int x, int y, int w, int h );
QRect viewport() const; // get viewport
void setViewport( const QRect & ); // set viewport
void setViewport( int x, int y, int w, int h );
…………
…………
void rotate( double a );
#endif
说明你的库在编译的时候,可能没有把这些函数函数编译进来,
(如果你定义了QT_NO_TRANSFORMATIONS的话)
现在你用了这些函数,当然会报错的了
#2 [修罗王1981 11-14 09:48]
果然是这样,那我如何改才能通过?
还请deweyjew指教一下!
多谢,多谢!
#3 [mudfish 11-14 14:06]
你是用的qt什么版本?编译qt库的时候用的哪个config文件,你就修改那个config文件内容.像我用qt/e2.3.7+
qtopia.1.7.0,编译libqte.so的时候用的是qpe-config.h,默认也是有些#define QT_NO_****,把它注释掉,再重新编译生成libqte.so就OK
#4 [修罗王1981 11-14 14:31]
多谢指点!
我试试!

回复 发表
主题 版块