Expected class name error
-
Hi all,
This is the .h file of a program. I face the following error but whatever I look I can't find out why Qt creator's compiler shows that error! Would you please have a look at it?
C:\Users\ME\Documents\Qt\Sort\sortdialog.h:8: error: expected class-name before '{' token
{
^
The.h
file:#ifndef SORTDIALOG_H #define SORTDIALOG_H #include <QDialog> #include "ui_sortdialog.h" class SortDialog : public QDialog, public Ui::SortDialog { Q_OBJECT public: SortDialog(QWidget* parent = 0); void setColumnRange(QChar first, QChar last); }; #endif // SORTDIALOG_H
-
@tomy said in Expected class name error:
What do you mean by "form's (top-level widget's)" please?
This is what I mean. The first object's name is how the class will be called. In my case it's the "inventive"
MainWindow
, thus the generated class will beUi::MainWindow
. Make sure your top level widget (the one that's on top of everything else) is calledSortDialog
.Kind regards.
-
@tomy said in Expected class name error:
What do you mean by "form's (top-level widget's)" please?
This is what I mean. The first object's name is how the class will be called. In my case it's the "inventive"
MainWindow
, thus the generated class will beUi::MainWindow
. Make sure your top level widget (the one that's on top of everything else) is calledSortDialog
.Kind regards.