Wow... hmm... strange solution... how about:
#ifndef __FRAME_H
#define __FRAME_H
#include <QFrame>
class FramePrivate;
public:
~Frame();
private:
FramePrivate *d;
};
#endif
#ifndef __FRAME_H
#define __FRAME_H
#include <QFrame>
class FramePrivate;
class Frame : public QFrame {
public:
Frame(QWidget *parent=0);
~Frame();
private:
FramePrivate *d;
};
#endif
To copy to clipboard, switch view to plain text mode
#include "frame.h"
#include "ui_frame.h"
struct FramePrivate {
Ui::Frame ui;
};
Frame
::Frame(QWidget *parent
) : QFrame(parent
), d
(new FramePrivate
){ d->ui.setupUi(this);
}
Frame::~Frame(){ delete d; }
#include "frame.h"
#include "ui_frame.h"
struct FramePrivate {
Ui::Frame ui;
};
Frame::Frame(QWidget *parent) : QFrame(parent), d(new FramePrivate){
d->ui.setupUi(this);
}
Frame::~Frame(){ delete d; }
To copy to clipboard, switch view to plain text mode
This way the only place where you include the ui_xxx.h file is the implementation file and only the private class (P-IMPL) that is defined there needs the Ui component.
Bookmarks