笔者,正在进行QT学习。。。。
在练习对话框程序的时候,出现了
expected class-name before '{' token
的错误。。 不知道为什么。
现将系统信息贴出来
#10#caopeng@laptop ~]$qmake --version
QMake version 2.01aUsing Qt version 4.6.2 in /usr/lib
[#11#caopeng@laptop ~]$g++ --version
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[#12#caopeng@laptop ~]$uname -a
Linux laptop 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux
[#13#caopeng@laptop ~]$qtcreator -version
Qt Creator 1.3.1 based on Qt 4.6.2 BinEditor 1.3.1 Binary editor component.
Bookmarks 1.3.1 Bookmarks in text editors. CMakeProjectManager 1.3.1 CMake support
CVS 1.3.1 CVS integration. CodePaster 1.3.1 Codepaster plugin for pushing/fetching diff from server
Core 1.3.1 The core plugin for the Qt IDE. CppEditor 1.3.1 C/C++ editor component.
CppTools 1.3.1 Tools for analyzing C/C++ code. Debugger 1.3.1 Debugger integration.
Designer 1.3.1 Qt Designer integration. FakeVim 1.3.1 VI-style keyboard navigation.
Find 1.3.1 Provides the find widget and the hooks for find implementations. GenericProjectManager 1.3.1 Generic support
Help 1.3.1 Help system. Locator 1.3.1 Provides the Locator widget and the hooks for Locator filter implementations.
Perforce 1.3.1 Perforce integration. ProjectExplorer 1.3.1 ProjectExplorer framework that can be extended with different kind of project types.
QmlEditor 1.3.1 Editor for QML. QmlProjectManager 1.3.1 Qml support
Qt4ProjectManager 1.3.1 Provides project type for Qt 4 pro files and tools. QtScriptEditor 1.3.1 Editor for QtScript.
ResourceEditor 1.3.1 Editor for qrc files. ScmGit 1.3.1 Git integration.
Subversion 1.3.1 Subversion integration. TextEditor 1.3.1 Text editor framework and the implementation of the basic text editor.
VCSBase 1.3.1 Version Control System Base Plugin Welcome 1.3.1 Default Welcome Screen Plugin
[#14#caopeng@laptop ~]$
有一个listCardDialog.ui文件
然后,在listCardDialog.h 当中由如下代码。。
#ifndef LISTCARDDIALOG_H
#define LISTCARDDIALOG_H
#include <QDialog>
#include "ui_listCardDialog.h"
class ListCardDialog : public QDialog , public Ui::ListCardDialog
{ //错误提示在改行。。。
Q_OBJECT
public:
ListCardDialog(QWidget *parent = 0);
private slots:
void comboBoxChanged();
};
#endif // LISTCARDDIALOG_H
其他的cpp文件,步一一贴出。。。
编译的时候,就会出现
expected class-name before '{' token
的错误