
Originally Posted by
d_stranz
That's because you are trying to access some "Ui::settings" object. I have no clue what that is, and it is probably a bad design to try to access it in the way that you are doing, whatever it is.
What is it that you really want to do?
Click a pushbutton and have it create a window from the ui file.
I basically copied the code that you posted, and I got the errors I posted before:
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QtCore>
#include <QtGui>
#include "settings.h"
namespace Ui {
class Dialog;
}
{
Q_OBJECT
public:
Ui::Dialog *ui;
explicit Dialog
(QWidget *parent
= 0);
~Dialog();
private slots:
void on_pushButton_clicked();
};
#endif // DIALOG_H
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QtCore>
#include <QtGui>
#include "settings.h"
namespace Ui {
class Dialog;
}
class Dialog : public QDialog
{
Q_OBJECT
public:
Ui::Dialog *ui;
explicit Dialog(QWidget *parent = 0);
~Dialog();
private slots:
void on_pushButton_clicked();
};
#endif // DIALOG_H
To copy to clipboard, switch view to plain text mode
#include "dialog.h"
#include "ui_dialog.h"
#include "settings.h"
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
void Dialog::on_pushButton_clicked(){ //settings
settings a(this);
a.exec();
}
#include "dialog.h"
#include "ui_dialog.h"
#include "settings.h"
Dialog::Dialog(QWidget *parent):
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
void Dialog::on_pushButton_clicked(){ //settings
settings a(this);
a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks