• 5828阅读
  • 1回复

C++_GUI_QT4_书本样例程序源码,如何使用? [复制链接]

上一主题 下一主题
离线zwfd
 
只看楼主 倒序阅读 楼主  发表于: 2009-04-19
使用C++_GUI_QT4_书本样例程序源码\chap04\spreadsheet
进行编译
先:qmake -project
后:qmake
接下来:nmake
出现下面的错误:
mainwindow.cpp
.\mainwindow.cpp(167) : error C2039: 'New' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(167) : error C2065: 'New' : undeclared identifier
.\mainwindow.cpp(173) : error C2039: 'Open' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(173) : error C2065: 'Open' : undeclared identifier
.\mainwindow.cpp(179) : error C2039: 'Save' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(179) : error C2065: 'Save' : undeclared identifier
.\mainwindow.cpp(202) : error C2039: 'Cut' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(202) : error C2065: 'Cut' : undeclared identifier
.\mainwindow.cpp(209) : error C2039: 'Copy' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(209) : error C2065: 'Copy' : undeclared identifier
.\mainwindow.cpp(216) : error C2039: 'Paste' : is not a member of 'QKeySequence'

        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(216) : error C2065: 'Paste' : undeclared identifier
.\mainwindow.cpp(223) : error C2039: 'Delete' : is not a member of 'QKeySequence
'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(223) : error C2065: 'Delete' : undeclared identifier
.\mainwindow.cpp(242) : error C2039: 'SelectAll' : is not a member of 'QKeySeque
nce'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(242) : error C2065: 'SelectAll' : undeclared identifier
.\mainwindow.cpp(250) : error C2039: 'Find' : is not a member of 'QKeySequence'
        C:/Qt/4.1.0/include\QtGui/../../src/gui/kernel/qkeysequence.h(45) : see
declaration of 'QKeySequence'
.\mainwindow.cpp(250) : error C2065: 'Find' : undeclared identifier
.\mainwindow.cpp(394) : error C2065: 'restoreGeometry' : undeclared identifier
.\mainwindow.cpp(410) : error C2065: 'saveGeometry' : undeclared identifier
.\mainwindow.cpp(423) : error C2665: 'warning' : none of the 2 overloads can con
vert parameter 4 from type 'const int'
spreadsheet.cpp
.\spreadsheet.cpp(67) : error C2039: 'Qt_4_3' : is not a member of 'QDataStream'

        C:/Qt/4.1.0/include\QtCore/../../src/corelib/io/qdatastream.h(48) : see
declaration of 'QDataStream'
.\spreadsheet.cpp(67) : error C2065: 'Qt_4_3' : undeclared identifier
.\spreadsheet.cpp(104) : error C2039: 'Qt_4_3' : is not a member of 'QDataStream
'
        C:/Qt/4.1.0/include\QtCore/../../src/corelib/io/qdatastream.h(48) : see
declaration of 'QDataStream'
gotocelldialog.cpp
.\gotocelldialog.cpp(9) : error C2065: 'buttonBox' : undeclared identifier
.\gotocelldialog.cpp(9) : error C2227: left of '->button' must point to class/st
ruct/union
.\gotocelldialog.cpp(9) : error C2653: 'QDialogButtonBox' : is not a class or na
mespace name
.\gotocelldialog.cpp(9) : error C2065: 'Ok' : undeclared identifier
.\gotocelldialog.cpp(9) : error C2227: left of '->setEnabled' must point to clas
s/struct/union
.\gotocelldialog.cpp(20) : error C2227: left of '->button' must point to class/s
truct/union
.\gotocelldialog.cpp(20) : error C2653: 'QDialogButtonBox' : is not a class or n
amespace name
.\gotocelldialog.cpp(20) : error C2227: left of '->setEnabled' must point to cla
ss/struct/union
sortdialog.cpp
Generating Code...
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~4\VC98\BIN\NMAKE.EXE' : return co
de '0x2'
Stop.

请教高手,是什么原因?这些例子是正确的吗?如何使用?
非常感谢!
离线azlbcoo

只看该作者 1楼 发表于: 2009-04-21
我在windows下的qt4.5 QtCreator直接打开  .pro 文件,直接通过了。我机子上只有 4.5。
快速回复
限100 字节
 
上一个 下一个