当前位置: 代码迷 >> QT开发 >> 头文件中,用class editPainter比#include "editpainter.h"好多少?解决方案
  详细解决方案

头文件中,用class editPainter比#include "editpainter.h"好多少?解决方案

热度:20   发布时间:2016-04-25 04:07:10.0
头文件中,用class editPainter比#include "editpainter.h"好多少?
.h
#include <QtGui/QWidget>

class QPushButton;
class editPainter;
class QLabel;
class QGroupBox;
class QRadioButton;

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = 0);
    ~Widget();

private slots:
    void OnClickImport();
    void OnClickApply();
    void OnPixmapChange(QPixmap *pixmap);
    void OnRadioFixClick();
    void OnRadioFreeClick();

private:
    QPushButton *m_pButtonImport;
    QPushButton *m_pButtonApply;
    editPainter *m_pPhotoEditor;
    QLabel *m_pLabelPixmap;
    QGroupBox *m_pGrpBoxScaleType;
    QRadioButton *m_pRadioFix;
    QRadioButton *m_pRadioFree;
    QPixmap *m_pPixmapTobesaved;
};

------解决方案--------------------
在头文件中申明类,在实现文件中包含头文件,是为了减少编译连接的依赖,加快编译速度
  相关解决方案