Hello,
Trying to show a QDialog, but I am getting the errors shown.
What am I doing wrong?
Regards
Header
#ifndef QG_DIVIDEOPTIONS_H
#define QG_DIVIDEOPTIONS_H
#include <QDialog>
namespace Ui {
class qg_divideoptions;
}
class qg_divideoptions
: public QDialog{
Q_OBJECT
public:
explicit qg_divideoptions
(QWidget *parent
= 0);
~qg_divideoptions;
private:
Ui::qg_divideoptions *ui;
};
#endif // QG_DIVIDEOPTIONS_H
Header
#ifndef QG_DIVIDEOPTIONS_H
#define QG_DIVIDEOPTIONS_H
#include <QDialog>
namespace Ui {
class qg_divideoptions;
}
class qg_divideoptions : public QDialog
{
Q_OBJECT
public:
explicit qg_divideoptions(QWidget *parent = 0);
~qg_divideoptions;
private:
Ui::qg_divideoptions *ui;
};
#endif // QG_DIVIDEOPTIONS_H
To copy to clipboard, switch view to plain text mode
qg_divideoptions.cpp
#include <QtGui>
#include "qg_divideoptions.h"
qg_divideoptions
::qg_divideoptions(QWidget *parent
) : //*** qg_divideoptions does not name a type ui(new Ui::qg_divideoptions)
{
ui->setupUi(this);
}
qg_divideoptions.cpp
#include <QtGui>
#include "qg_divideoptions.h"
qg_divideoptions::qg_divideoptions(QWidget *parent) : //*** qg_divideoptions does not name a type
QDialog(parent),
ui(new Ui::qg_divideoptions)
{
ui->setupUi(this);
}
To copy to clipboard, switch view to plain text mode
Calling function header
public:
Calling function header
public:
QDialog* mydialog;
To copy to clipboard, switch view to plain text mode
Calling function
#include "qg_divideoptions.h"
#include <QDialog>
if (e->button() == Qt::LeftButton) {
qg_divideoptions mydialog = new qg_pdivideoptions(); //*** qg_divideoptions was not declared in this scope
mydialog->show(); //*** mydialog was not declared in this scope
}
}
Calling function
#include "qg_divideoptions.h"
#include <QDialog>
void myfunc::mouseReleaseEvent(QMouseEvent* e) {
if (e->button() == Qt::LeftButton) {
qg_divideoptions mydialog = new qg_pdivideoptions(); //*** qg_divideoptions was not declared in this scope
mydialog->show(); //*** mydialog was not declared in this scope
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks