PDA

View Full Version : qtextoption.h Expected unqualified-id before '\x9'



ncrusader
24th February 2010, 18:04
Hi everyone,

So I am getting this strange error:

qtextoption.h:140: error: expected unqualified-id before '\x9'
qtextoption.h:153: error: lvalue required as left operand of assignment

But this is only is I have


#include "PPincludes.h"

in my code below for cgui.h:



#ifndef CGUI_H
#define CGUI_H

#include <QMainWindow>
#include "PPincludes.h"


namespace Ui {
class CGUI;
}

//! The main application class
/*!
The CGUI class contains declarations of all variables and functions used
by the application. It is divided into Pre-processing, Run and Post-processing
groups.
*/

class CGUI : public QMainWindow {
Q_OBJECT
public:
CGUI(QWidget *parent = 0);
~CGUI();

protected:
void changeEvent(QEvent *e);

private:
Ui::CGUI *ui;

};

#endif // CGUI_H



PPincludes.h is blank.

Then, cgui.cpp:



#include "cgui.h"
#include "ui_cgui.h"

CGUI::CGUI(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::CGUI)
{
ui->setupUi(this);
}

CGUI::~CGUI()
{
delete ui;

}

void CGUI::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}


Please help. I am not sure why it is giving me such a strange error.
The error dissappears if I remove #include "PPinclude.h"

Thank you in advance,

Ncrusader
-----------------------------------------------------------

Ok I figured it out,
Solution:

in the cgui.cpp file of the form class,


//***Must include QtGui in the beginning of the file***
#include <QtGui>
//***

#include <cgui.h>
#include <ui_cgui.h>

//etc


Cheers,

ncrusader

babygal
16th February 2011, 09:06
Hi ncrusader,
Do you know the reason why
#include<QtGui>

solves the problem?