Thanks for the help talei! I almost got it.. however when I go to fileDialog.ui in the designer and I try to add a slot.. it says that "NO DOCUMENTS MATCHING 'ui_fileDialog.h' could be found. Rebuilding the project might help"
any ideas???
I attached the two ui forms Needed for the program..
here is my whole code.. I would appreciate if you could take a look.. thank you!!
this is my fileDialog.h
#ifndef FILEDIALOG_H
#define FILEDIALOG_H
#include <QDialog>
namespace Ui {
class fileDialog;
}
class fileDialog
: public QDialog { Q_OBJECT
public:
~fileDialog();
protected:
private:
Ui::fileDialog *ui;
};
#endif // FILEDIALOG_H
#ifndef FILEDIALOG_H
#define FILEDIALOG_H
#include <QDialog>
namespace Ui {
class fileDialog;
}
class fileDialog : public QDialog {
Q_OBJECT
public:
fileDialog(QWidget *parent = 0);
~fileDialog();
protected:
void changeEvent(QEvent *e);
private:
Ui::fileDialog *ui;
};
#endif // FILEDIALOG_H
To copy to clipboard, switch view to plain text mode
this is my fileDialog.cpp
#include "fileDialog.h"
#include "ui_filedialog.h"
fileDialog
::fileDialog(QWidget *parent
) : ui(new Ui::fileDialog)
{
ui->setupUi(this);
}
fileDialog::~fileDialog()
{
delete ui;
}
void fileDialog
::changeEvent(QEvent *e
) {
switch (e->type()) {
ui->retranslateUi(this);
break;
default:
break;
}
}
#include "fileDialog.h"
#include "ui_filedialog.h"
fileDialog::fileDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::fileDialog)
{
ui->setupUi(this);
}
fileDialog::~fileDialog()
{
delete ui;
}
void fileDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
To copy to clipboard, switch view to plain text mode
and this is main
#include <QtGui/QApplication>
#include "intercompany.h"
int main(int argc, char *argv[])
{
Intercompany w;
w.show();
return a.exec();
}
#include <QtGui/QApplication>
#include "intercompany.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Intercompany w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
this is my Intercompany.cpp
#ifndef INTERCOMPANY_H
#define INTERCOMPANY_H
#include <QMainWindow>
#include "fileDialog.h"
namespace Ui {
class Intercompany;
}
Q_OBJECT
public:
~Intercompany();
protected:
private:
Ui::Intercompany *ui;
double currentAmount;
fileDialog *fDialog;
private slots:
void on_addButton1_clicked();
void on_createButton_clicked();
void on_actionEXIT_triggered();
};
#endif // INTERCOMPANY_H}
#ifndef INTERCOMPANY_H
#define INTERCOMPANY_H
#include <QMainWindow>
#include "fileDialog.h"
namespace Ui {
class Intercompany;
}
class Intercompany : public QMainWindow {
Q_OBJECT
public:
Intercompany(QWidget *parent = 0);
~Intercompany();
protected:
void changeEvent(QEvent *e);
private:
Ui::Intercompany *ui;
QString date;
QString user;
QString from;
QString to;
QString currentItem;
double currentAmount;
fileDialog *fDialog;
private slots:
void on_addButton1_clicked();
void on_createButton_clicked();
void on_actionEXIT_triggered();
};
#endif // INTERCOMPANY_H}
To copy to clipboard, switch view to plain text mode
this is my intercompany.h
#ifndef INTERCOMPANY_H
#define INTERCOMPANY_H
#include <QMainWindow>
#include "fileDialog.h"
namespace Ui {
class Intercompany;
}
Q_OBJECT
public:
~Intercompany();
protected:
private:
Ui::Intercompany *ui;
double currentAmount;
fileDialog *fDialog;
private slots:
void on_addButton1_clicked();
void on_createButton_clicked();
void on_actionEXIT_triggered();
};
#endif // INTERCOMPANY_H
#ifndef INTERCOMPANY_H
#define INTERCOMPANY_H
#include <QMainWindow>
#include "fileDialog.h"
namespace Ui {
class Intercompany;
}
class Intercompany : public QMainWindow {
Q_OBJECT
public:
Intercompany(QWidget *parent = 0);
~Intercompany();
protected:
void changeEvent(QEvent *e);
private:
Ui::Intercompany *ui;
QString date;
QString user;
QString from;
QString to;
QString currentItem;
double currentAmount;
fileDialog *fDialog;
private slots:
void on_addButton1_clicked();
void on_createButton_clicked();
void on_actionEXIT_triggered();
};
#endif // INTERCOMPANY_H
To copy to clipboard, switch view to plain text mode
Bookmarks