Hi!
I've been tinkering around with this for a couple days, and errors have come and gone, but still I haven't successfully compiled this. I figure I'm missing something very simple, but haven't tracked it down yet.
The Scenario:
I have a main window that works just fine, a simulator. From this I've connected a push button to a function in a source file, MUstarter.cpp, that will act as a copy of main to start the other window. The reason: I want to keep the new window's code isolated so I can deploy it as a separate project later. I have a feeling the main issue is with the header file for the new window, but I'm not sure.
The code:
MUstarter.cpp -> called from the generator window, should act how main usually does.
#include <QtGui/QApplication>
#include "MobileUnit.h"
#include "ui_MobileUnit.h"
void MUStarter()
{
MobileUnit MU;
MU.show();
MU.setWindowTitle(
}
#include <QtGui/QApplication>
#include "MobileUnit.h"
#include "ui_MobileUnit.h"
void MUStarter()
{
MobileUnit MU;
MU.show();
MU.setWindowTitle(
QApplication::translate("MobileUnit", "Mobile Unit"));
}
To copy to clipboard, switch view to plain text mode
MobileUnit.cpp -> define any widget functionality of the new ui.
#include "MobileUnit.h"
#include "ui_MobileUnit.h"
#include <QWidget>
MobileUnit
::MobileUnit(QWidget *parent
) : MU(new Mu::MobileUnit)
{
MU->setupUi(this);
}
MobileUnit::~MobileUnit()
{
delete MU;
}
#include "MobileUnit.h"
#include "ui_MobileUnit.h"
#include <QWidget>
MobileUnit::MobileUnit(QWidget *parent) :
QWidget(parent),
MU(new Mu::MobileUnit)
{
MU->setupUi(this);
}
MobileUnit::~MobileUnit()
{
delete MU;
}
To copy to clipboard, switch view to plain text mode
MobileUnit.h -> class definitions
#ifndef MOBILEUNIT_H
#define MOBILEUNIT_H
#include <QWidget>
namespace Mu {
class MobileUnit;
}
{
Q_OBJECT
public:
explicit MobileUnit
(QWidget *parent
= 0);
~MobileUnit();
private:
Mu::MobileUnit *MU;
// void MUStarter();
};
#endif // MOBILEUNIT_H
#ifndef MOBILEUNIT_H
#define MOBILEUNIT_H
#include <QWidget>
namespace Mu {
class MobileUnit;
}
class MobileUnit: public QWidget
{
Q_OBJECT
public:
explicit MobileUnit(QWidget *parent = 0);
~MobileUnit();
private:
Mu::MobileUnit *MU;
// void MUStarter();
};
#endif // MOBILEUNIT_H
To copy to clipboard, switch view to plain text mode
Thanks in advance for any help!
Bookmarks