Hi all,
I have created a class called parathiro which is a form. I need to display that form in the mdiArea of my central window (kentriko class). I nearly copied every line of an example taken from the book c++GUI programming with qt.
The problem is that the code below doesnt work althoush i think it should.
the main window where the mdiArea is placed (kentriko class). the implementation:
#include "kentriko.h"
#include <iostream>
#include <QString>
#include "../diafores_sinartisis/sinartisis.h"
#include <QMdiArea>
using namespace std;
kentriko
::kentriko(QWidget *parent
){
ui.setupUi(this);
connect(ui.sindesi, SIGNAL(triggered()), this, SLOT(anixe()));
}
void kentriko::anixe(){
// setCentralWidget(ui.mdiArea);
// para->show();
QMdiSubWindow *subwindow = ui.mdiArea->addSubWindow(¶);
subwindow->show(); // invalid use of incomplete type 'struct QMdiSubWindow'??????
//para.show();
}
#include "kentriko.h"
#include <iostream>
#include <QString>
#include "../diafores_sinartisis/sinartisis.h"
#include <QMdiArea>
using namespace std;
kentriko::kentriko(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
connect(ui.sindesi, SIGNAL(triggered()), this, SLOT(anixe()));
}
void kentriko::anixe(){
// setCentralWidget(ui.mdiArea);
// para->show();
QMdiSubWindow *subwindow = ui.mdiArea->addSubWindow(¶);
subwindow->show(); // invalid use of incomplete type 'struct QMdiSubWindow'??????
//para.show();
}
To copy to clipboard, switch view to plain text mode
the header file:
#ifndef KENTRIKO_H
#define KENTRIKO_H
#include <QtGui/QMainWindow>
#include "ui_kentriko.h"
#include "../database/database.h"
#include "../kentriko/parathiro/parathiro.h"
{
Q_OBJECT
public:
~kentriko();
private slots:
void anixe();
void pare();
void alagi();
private:
Ui::kentrikoClass ui;
database d;
parathiro para;
};
#ifndef KENTRIKO_H
#define KENTRIKO_H
#include <QtGui/QMainWindow>
#include "ui_kentriko.h"
#include "../database/database.h"
#include "../kentriko/parathiro/parathiro.h"
class kentriko : public QMainWindow
{
Q_OBJECT
public:
kentriko(QWidget *parent = 0);
~kentriko();
private slots:
void anixe();
void pare();
void alagi();
private:
Ui::kentrikoClass ui;
database d;
QString proto;
QString deytero;
QVariant variant;
parathiro para;
};
To copy to clipboard, switch view to plain text mode
the class tha I want to make as a subwindow is the following(parathiro). The header file:
#ifndef PARATHIRO_H
#define PARATHIRO_H
#include <QtGui/QMainWindow>
#include "ui_parathiro.h"
#include "../database/database.h"
{
Q_OBJECT
public:
~parathiro();
private slots:
void anixe();
void pare();
void alagi();
private:
Ui::parathiroClass ui;
database d;
};
#endif // PARATHIRO_H
#ifndef PARATHIRO_H
#define PARATHIRO_H
#include <QtGui/QMainWindow>
#include "ui_parathiro.h"
#include "../database/database.h"
class parathiro : public QMainWindow
{
Q_OBJECT
public:
parathiro(QWidget *parent = 0);
~parathiro();
private slots:
void anixe();
void pare();
void alagi();
private:
Ui::parathiroClass ui;
database d;
QString proto;
QString deytero;
QVariant variant;
};
#endif // PARATHIRO_H
To copy to clipboard, switch view to plain text mode
Many thanks in advance
Bookmarks