I have a problem. I've implemented this:
Maker.h
#ifndef MAKER_H
#define MAKER_H
#include "ui_maker.h"
class MainWindow
: public QMainWindow,
public Ui
::MainWindow {
Q_OBJECT
public:
private slots:
void on_actionAbout_triggered();
private:
Ui::MainWindow ui;
};
#endif
#ifndef MAKER_H
#define MAKER_H
#include "ui_maker.h"
class MainWindow : public QMainWindow, public Ui::MainWindow
{
Q_OBJECT
public:
MainWindow(QMainWindow *parent = 0);
private slots:
void on_actionAbout_triggered();
private:
Ui::MainWindow ui;
};
#endif
To copy to clipboard, switch view to plain text mode
About.h
#ifndef ABOUT_H
#define ABOUT_H
#include "ui_about.h"
class Dialog
: public QDialog,
public Ui
::Dialog {
Q_OBJECT
public:
private:
Ui::Dialog ui;
};
#endif
#ifndef ABOUT_H
#define ABOUT_H
#include "ui_about.h"
class Dialog : public QDialog, public Ui::Dialog
{
Q_OBJECT
public:
Dialog(QDialog *parent = 0);
private:
Ui::Dialog ui;
};
#endif
To copy to clipboard, switch view to plain text mode
Maker.cpp
#include <QtGui>
#include "maker.h"
#include "about.h"
{
ui.setupUi(this);
}
void MainWindow::on_actionAbout_triggered()
{
Dialog dlg( this );
dlg.exec();
}
{
ui.setupUi(this);
}
#include <QtGui>
#include "maker.h"
#include "about.h"
MainWindow::MainWindow(QMainWindow *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
}
void MainWindow::on_actionAbout_triggered()
{
Dialog dlg( this );
dlg.exec();
}
Dialog::Dialog(QDialog *parent)
: QDialog(parent)
{
ui.setupUi(this);
}
To copy to clipboard, switch view to plain text mode
And also main.cpp, which contents I won't post, because it's obvious. And there appear errors:
maker.cpp:in member function 'void MainWindow:
n_actionAbout_triggered()':
maker.cpp:17:error: no matching function for call to 'Dialog:
ialog(MainWindow* const)
about.h:9:note: candidates are Dialog:
ialog(const Dialog&)
about.h:13:note: Dialog:
ialog(QDialog*)
What's wrong? I thought I'd done everything as it was described in C++ GUI and in this topic. Regards
p.s.
Forum mechanism replaced : D with a smile and also : o with the other smile, as you seen so far
Bookmarks