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"
#include "PPincludes.h"
To copy to clipboard, switch view to plain text mode
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.
*/
Q_OBJECT
public:
~CGUI();
protected:
private:
Ui::CGUI *ui;
};
#endif // 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
To copy to clipboard, switch view to plain text mode
PPincludes.h is blank.
Then, cgui.cpp:
#include "cgui.h"
#include "ui_cgui.h"
ui(new Ui::CGUI)
{
ui->setupUi(this);
}
CGUI::~CGUI()
{
delete ui;
}
void CGUI
::changeEvent(QEvent *e
) {
switch (e->type()) {
ui->retranslateUi(this);
break;
default:
break;
}
}
#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;
}
}
To copy to clipboard, switch view to plain text mode
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
//***Must include QtGui in the beginning of the file***
#include <QtGui>
//***
#include <cgui.h>
#include <ui_cgui.h>
//etc
To copy to clipboard, switch view to plain text mode
Cheers,
ncrusader
Bookmarks