refactoring qad widgets part 1
c++ cast, nullptr, forward declaration, agregate ui, connect to member functions, order and clear includes
This commit is contained in:
@@ -20,10 +20,9 @@
|
||||
#ifndef ICONEDLABEL_H
|
||||
#define ICONEDLABEL_H
|
||||
|
||||
#include "qad_widgets_export.h"
|
||||
#include <QLabel>
|
||||
#include <QIcon>
|
||||
#include "qad_types.h"
|
||||
#include "qad_widgets_export.h"
|
||||
|
||||
|
||||
class QAD_WIDGETS_EXPORT IconedLabel: public QFrame
|
||||
@@ -37,7 +36,7 @@ class QAD_WIDGETS_EXPORT IconedLabel: public QFrame
|
||||
public:
|
||||
enum Direction {LeftToRight = 0, RightToLeft = 1, TopToBottom = 2, BottomToTop = 3};
|
||||
|
||||
explicit IconedLabel(QWidget * parent = 0);
|
||||
explicit IconedLabel(QWidget * parent = nullptr);
|
||||
|
||||
QString text() const;
|
||||
QIcon icon() const;
|
||||
@@ -46,8 +45,14 @@ public:
|
||||
|
||||
QLabel * textLabel() {return &label_;}
|
||||
|
||||
public slots:
|
||||
void setText(const QString & t);
|
||||
void setIcon(const QIcon & i);
|
||||
void setIconSize(const QSize & s);
|
||||
void setDirection(Direction d);
|
||||
|
||||
protected:
|
||||
virtual bool event(QEvent * e);
|
||||
bool event(QEvent * e) override;
|
||||
void checkSpacing();
|
||||
QSize realIconSize() const;
|
||||
|
||||
@@ -55,15 +60,6 @@ protected:
|
||||
QIcon sicon_;
|
||||
QSize size_;
|
||||
Direction dir_;
|
||||
|
||||
public slots:
|
||||
void setText(const QString & t);
|
||||
void setIcon(const QIcon & i);
|
||||
void setIconSize(const QSize & s);
|
||||
void setDirection(Direction d);
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // ICONEDLABEL_H
|
||||
|
||||
Reference in New Issue
Block a user