examples: Mark ctor's as explicit
Make C++ class constructors that can be used with only one required argument 'explicit' to minimize wrong use of the class. Change-Id: Ida9f9c2f0c8608c35b0137b2512a6747afd69515 Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
89b12da2ef
commit
58e2b9c01b
@ -82,7 +82,7 @@ public:
|
|||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(PeerWireState, PeerWireStateFlag)
|
Q_DECLARE_FLAGS(PeerWireState, PeerWireStateFlag)
|
||||||
|
|
||||||
PeerWireClient(const QByteArray &peerId, QObject *parent = 0);
|
explicit PeerWireClient(const QByteArray &peerId, QObject *parent = 0);
|
||||||
void initialize(const QByteArray &infoHash, int pieceCount);
|
void initialize(const QByteArray &infoHash, int pieceCount);
|
||||||
|
|
||||||
void setPeer(TorrentPeer *peer);
|
void setPeer(TorrentPeer *peer);
|
||||||
|
@ -59,7 +59,7 @@ class TrackerClient : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TrackerClient(TorrentClient *downloader, QObject *parent = 0);
|
explicit TrackerClient(TorrentClient *downloader, QObject *parent = 0);
|
||||||
|
|
||||||
void start(const MetaInfo &info);
|
void start(const MetaInfo &info);
|
||||||
void stop();
|
void stop();
|
||||||
|
@ -55,7 +55,7 @@ class Renderer : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Renderer(const QSurfaceFormat &format, Renderer *share = 0, QScreen *screen = 0);
|
explicit Renderer(const QSurfaceFormat &format, Renderer *share = 0, QScreen *screen = 0);
|
||||||
|
|
||||||
QSurfaceFormat format() const { return m_format; }
|
QSurfaceFormat format() const { return m_format; }
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class TileBuilder
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { bl, br, tr, tl };
|
enum { bl, br, tr, tl };
|
||||||
TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
|
explicit TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
|
||||||
Tile *newTile(const QVector3D &loc = QVector3D()) const;
|
Tile *newTile(const QVector3D &loc = QVector3D()) const;
|
||||||
void setColor(QColor c) { color = c; }
|
void setColor(QColor c) { color = c; }
|
||||||
protected:
|
protected:
|
||||||
@ -140,7 +140,7 @@ private:
|
|||||||
class CubeBuilder : public TileBuilder
|
class CubeBuilder : public TileBuilder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
|
explicit CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
|
||||||
Cube *newCube(const QVector3D &loc = QVector3D()) const;
|
Cube *newCube(const QVector3D &loc = QVector3D()) const;
|
||||||
private:
|
private:
|
||||||
mutable int ix;
|
mutable int ix;
|
||||||
|
@ -51,7 +51,7 @@ struct Geometry;
|
|||||||
class QtLogo : public QObject
|
class QtLogo : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
|
explicit QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
|
||||||
~QtLogo();
|
~QtLogo();
|
||||||
void setColor(QColor c);
|
void setColor(QColor c);
|
||||||
void draw() const;
|
void draw() const;
|
||||||
|
@ -51,7 +51,7 @@ class GLWidget : public QGLWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GLWidget(QWidget *parent = 0, QGLWidget *shareWidget = 0);
|
explicit GLWidget(QWidget *parent = 0, QGLWidget *shareWidget = 0);
|
||||||
~GLWidget();
|
~GLWidget();
|
||||||
|
|
||||||
QSize minimumSizeHint() const;
|
QSize minimumSizeHint() const;
|
||||||
|
@ -55,7 +55,7 @@ class TableEditor : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TableEditor(const QString &tableName, QWidget *parent = 0);
|
explicit TableEditor(const QString &tableName, QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void submit();
|
void submit();
|
||||||
|
@ -107,7 +107,7 @@ class CustomModel: public QSqlTableModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CustomModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db) {}
|
explicit CustomModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase()):QSqlTableModel(parent, db) {}
|
||||||
QVariant data(const QModelIndex &idx, int role) const
|
QVariant data(const QModelIndex &idx, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::BackgroundRole && isDirty(idx))
|
if (role == Qt::BackgroundRole && isDirty(idx))
|
||||||
|
@ -50,8 +50,8 @@ class TreeModelCompleter : public QCompleter
|
|||||||
Q_PROPERTY(QString separator READ separator WRITE setSeparator)
|
Q_PROPERTY(QString separator READ separator WRITE setSeparator)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TreeModelCompleter(QObject *parent = 0);
|
explicit TreeModelCompleter(QObject *parent = 0);
|
||||||
TreeModelCompleter(QAbstractItemModel *model, QObject *parent = 0);
|
explicit TreeModelCompleter(QAbstractItemModel *model, QObject *parent = 0);
|
||||||
|
|
||||||
QString separator() const;
|
QString separator() const;
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -52,7 +52,7 @@ class Shape
|
|||||||
public:
|
public:
|
||||||
enum Type { Rectangle, Circle, Triangle };
|
enum Type { Rectangle, Circle, Triangle };
|
||||||
|
|
||||||
Shape(Type type = Rectangle, const QColor &color = Qt::red, const QRect &rect = QRect());
|
explicit Shape(Type type = Rectangle, const QColor &color = Qt::red, const QRect &rect = QRect());
|
||||||
|
|
||||||
Type type() const;
|
Type type() const;
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
class DeleteCommand : public QUndoCommand
|
class DeleteCommand : public QUndoCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
|
explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
|
||||||
|
|
||||||
void undo();
|
void undo();
|
||||||
void redo();
|
void redo();
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
enum { Type = UserType + 1 };
|
enum { Type = UserType + 1 };
|
||||||
enum DiagramType { Box, Triangle };
|
enum DiagramType { Box, Triangle };
|
||||||
|
|
||||||
DiagramItem(DiagramType diagramType, QGraphicsItem *item = 0);
|
explicit DiagramItem(DiagramType diagramType, QGraphicsItem *item = 0);
|
||||||
|
|
||||||
DiagramType diagramType() const {
|
DiagramType diagramType() const {
|
||||||
return polygon() == boxPolygon ? Box : Triangle;
|
return polygon() == boxPolygon ? Box : Triangle;
|
||||||
|
@ -47,7 +47,7 @@ class Node: public QGraphicsObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Node(const QPointF &pos, QGraphicsItem *parent = 0);
|
explicit Node(const QPointF &pos, QGraphicsItem *parent = 0);
|
||||||
~Node();
|
~Node();
|
||||||
|
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
|
@ -139,7 +139,7 @@ private:
|
|||||||
class MoveStateRight : public QState
|
class MoveStateRight : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
explicit MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
@ -156,7 +156,7 @@ private:
|
|||||||
class MoveStateLeft : public QState
|
class MoveStateLeft : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
explicit MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
@ -173,7 +173,7 @@ private:
|
|||||||
class StopState : public QState
|
class StopState : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
explicit StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
@ -191,7 +191,7 @@ private:
|
|||||||
class LaunchStateRight : public QState
|
class LaunchStateRight : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
explicit LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
@ -212,7 +212,7 @@ private:
|
|||||||
class LaunchStateLeft : public QState
|
class LaunchStateLeft : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
explicit LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
|
@ -59,7 +59,7 @@ QT_END_NAMESPACE
|
|||||||
class PlayState : public QState
|
class PlayState : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PlayState(GraphicsScene *scene, QState *parent = 0);
|
explicit PlayState(GraphicsScene *scene, QState *parent = 0);
|
||||||
~PlayState();
|
~PlayState();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -96,7 +96,7 @@ private :
|
|||||||
class PauseState : public QState
|
class PauseState : public QState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PauseState(GraphicsScene *scene, QState *parent = 0);
|
explicit PauseState(GraphicsScene *scene, QState *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onEntry(QEvent *);
|
void onEntry(QEvent *);
|
||||||
|
@ -67,7 +67,7 @@ class MovementState : public QAnimationState
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
|
explicit MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
|
||||||
{
|
{
|
||||||
movementAnimation = new QPropertyAnimation(submarine, "pos");
|
movementAnimation = new QPropertyAnimation(submarine, "pos");
|
||||||
connect(movementAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationMovementValueChanged(const QVariant &)));
|
connect(movementAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationMovementValueChanged(const QVariant &)));
|
||||||
@ -106,7 +106,7 @@ private:
|
|||||||
class ReturnState : public QAnimationState
|
class ReturnState : public QAnimationState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
|
explicit ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
|
||||||
{
|
{
|
||||||
returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle");
|
returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle");
|
||||||
returnAnimation->setDuration(500);
|
returnAnimation->setDuration(500);
|
||||||
|
@ -55,7 +55,7 @@ class GeneralTab : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GeneralTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
explicit GeneralTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class PermissionsTab : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
explicit PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
||||||
};
|
};
|
||||||
//! [1]
|
//! [1]
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class ApplicationsTab : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
explicit ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
|
||||||
};
|
};
|
||||||
//! [2]
|
//! [2]
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ class TabDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TabDialog(const QString &fileName, QWidget *parent = 0);
|
explicit TabDialog(const QString &fileName, QWidget *parent = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTabWidget *tabWidget;
|
QTabWidget *tabWidget;
|
||||||
|
@ -48,7 +48,7 @@ class PiecesList : public QListWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PiecesList(int pieceSize, QWidget *parent = 0);
|
explicit PiecesList(int pieceSize, QWidget *parent = 0);
|
||||||
void addPiece(QPixmap pixmap, QPoint location);
|
void addPiece(QPixmap pixmap, QPoint location);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -57,7 +57,7 @@ class PuzzleWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PuzzleWidget(int imageSize, QWidget *parent = 0);
|
explicit PuzzleWidget(int imageSize, QWidget *parent = 0);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
int pieceSize() const;
|
int pieceSize() const;
|
||||||
|
@ -99,7 +99,7 @@ class GLTexture2D : public GLTexture
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GLTexture2D(int width, int height);
|
GLTexture2D(int width, int height);
|
||||||
GLTexture2D(const QString& fileName, int width = 0, int height = 0);
|
explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
|
||||||
void load(int width, int height, QRgb *data);
|
void load(int width, int height, QRgb *data);
|
||||||
virtual void bind();
|
virtual void bind();
|
||||||
virtual void unbind();
|
virtual void unbind();
|
||||||
@ -120,7 +120,7 @@ class GLTextureCube : public GLTexture
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GLTextureCube(int size);
|
GLTextureCube(int size);
|
||||||
GLTextureCube(const QStringList& fileNames, int size = 0);
|
explicit GLTextureCube(const QStringList& fileNames, int size = 0);
|
||||||
void load(int size, int face, QRgb *data);
|
void load(int size, int face, QRgb *data);
|
||||||
virtual void bind();
|
virtual void bind();
|
||||||
virtual void unbind();
|
virtual void unbind();
|
||||||
|
@ -65,7 +65,7 @@ class GLRoundedBox : public GLTriangleMesh<P3T2N3Vertex, unsigned short>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// 0 < r < 0.5, 0 <= n <= 125
|
// 0 < r < 0.5, 0 <= n <= 125
|
||||||
GLRoundedBox(float r = 0.25f, float scale = 1.0f, int n = 10);
|
explicit GLRoundedBox(float r = 0.25f, float scale = 1.0f, int n = 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class View : public QFrame
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
View(const QString &name, QWidget *parent = 0);
|
explicit View(const QString &name, QWidget *parent = 0);
|
||||||
|
|
||||||
QGraphicsView *view() const;
|
QGraphicsView *view() const;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class DiagramScene : public QGraphicsScene
|
|||||||
public:
|
public:
|
||||||
enum Mode { InsertItem, InsertLine, InsertText, MoveItem };
|
enum Mode { InsertItem, InsertLine, InsertText, MoveItem };
|
||||||
|
|
||||||
DiagramScene(QMenu *itemMenu, QObject *parent = 0);
|
explicit DiagramScene(QMenu *itemMenu, QObject *parent = 0);
|
||||||
QFont font() const
|
QFont font() const
|
||||||
{ return myFont; }
|
{ return myFont; }
|
||||||
QColor textColor() const
|
QColor textColor() const
|
||||||
|
@ -49,7 +49,7 @@ class CustomProxy : public QGraphicsProxyWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
|
explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
|
||||||
|
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
class FlippablePad : public RoundRectItem
|
class FlippablePad : public RoundRectItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
|
explicit FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
RoundRectItem *iconAt(int column, int row) const;
|
RoundRectItem *iconAt(int column, int row) const;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
class TreeItem
|
class TreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TreeItem(const QVector<QVariant> &data, TreeItem *parent = 0);
|
explicit TreeItem(const QVector<QVariant> &data, TreeItem *parent = 0);
|
||||||
~TreeItem();
|
~TreeItem();
|
||||||
|
|
||||||
TreeItem *child(int number);
|
TreeItem *child(int number);
|
||||||
|
@ -56,7 +56,7 @@ class PiecesModel : public QAbstractListModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PiecesModel(int pieceSize, QObject *parent = 0);
|
explicit PiecesModel(int pieceSize, QObject *parent = 0);
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
|
@ -57,7 +57,7 @@ class PuzzleWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PuzzleWidget(int imageSize, QWidget *parent = 0);
|
explicit PuzzleWidget(int imageSize, QWidget *parent = 0);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
int pieceSize() const;
|
int pieceSize() const;
|
||||||
|
@ -54,7 +54,7 @@ class DomModel : public QAbstractItemModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DomModel(QDomDocument document, QObject *parent = 0);
|
explicit DomModel(QDomDocument document, QObject *parent = 0);
|
||||||
~DomModel();
|
~DomModel();
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
class TreeItem
|
class TreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
|
explicit TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
|
||||||
~TreeItem();
|
~TreeItem();
|
||||||
|
|
||||||
void appendChild(TreeItem *child);
|
void appendChild(TreeItem *child);
|
||||||
|
@ -53,7 +53,7 @@ class TreeModel : public QAbstractItemModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TreeModel(const QString &data, QObject *parent = 0);
|
explicit TreeModel(const QString &data, QObject *parent = 0);
|
||||||
~TreeModel();
|
~TreeModel();
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
|
@ -51,7 +51,7 @@ class StarRating
|
|||||||
public:
|
public:
|
||||||
enum EditMode { Editable, ReadOnly };
|
enum EditMode { Editable, ReadOnly };
|
||||||
|
|
||||||
StarRating(int starCount = 1, int maxStarCount = 5);
|
explicit StarRating(int starCount = 1, int maxStarCount = 5);
|
||||||
|
|
||||||
void paint(QPainter *painter, const QRect &rect,
|
void paint(QPainter *painter, const QRect &rect,
|
||||||
const QPalette &palette, EditMode mode) const;
|
const QPalette &palette, EditMode mode) const;
|
||||||
|
@ -50,7 +50,7 @@ class BorderLayout : public QLayout
|
|||||||
public:
|
public:
|
||||||
enum Position { West, North, South, East, Center };
|
enum Position { West, North, South, East, Center };
|
||||||
|
|
||||||
BorderLayout(QWidget *parent, int margin = 0, int spacing = -1);
|
explicit BorderLayout(QWidget *parent, int margin = 0, int spacing = -1);
|
||||||
BorderLayout(int spacing = -1);
|
BorderLayout(int spacing = -1);
|
||||||
~BorderLayout();
|
~BorderLayout();
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@
|
|||||||
class FlowLayout : public QLayout
|
class FlowLayout : public QLayout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
explicit FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||||
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||||
~FlowLayout();
|
~FlowLayout();
|
||||||
|
|
||||||
void addItem(QLayoutItem *item);
|
void addItem(QLayoutItem *item);
|
||||||
|
@ -79,7 +79,7 @@ class ColorSwatch : public QDockWidget
|
|||||||
QAction *windowModifiedAction;
|
QAction *windowModifiedAction;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
explicit ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
|
||||||
QMenu *menu;
|
QMenu *menu;
|
||||||
void setCustomSizeHint(const QSize &size);
|
void setCustomSizeHint(const QSize &size);
|
||||||
|
@ -58,7 +58,7 @@ class PathDeformRenderer : public ArthurFrame
|
|||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PathDeformRenderer(QWidget *widget, bool smallScreen = false);
|
explicit PathDeformRenderer(QWidget *widget, bool smallScreen = false);
|
||||||
|
|
||||||
void paint(QPainter *painter);
|
void paint(QPainter *painter);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class RenderArea : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RenderArea(const QPainterPath &path, QWidget *parent = 0);
|
explicit RenderArea(const QPainterPath &path, QWidget *parent = 0);
|
||||||
|
|
||||||
QSize minimumSizeHint() const;
|
QSize minimumSizeHint() const;
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
|
@ -53,7 +53,7 @@ class PathStrokeRenderer : public ArthurFrame
|
|||||||
public:
|
public:
|
||||||
enum PathMode { CurveMode, LineMode };
|
enum PathMode { CurveMode, LineMode };
|
||||||
|
|
||||||
PathStrokeRenderer(QWidget *parent, bool smallScreen = false);
|
explicit PathStrokeRenderer(QWidget *parent, bool smallScreen = false);
|
||||||
|
|
||||||
void paint(QPainter *);
|
void paint(QPainter *);
|
||||||
void mousePressEvent(QMouseEvent *e);
|
void mousePressEvent(QMouseEvent *e);
|
||||||
|
@ -49,7 +49,7 @@ class Button : public QToolButton
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Button(const QString &text, QWidget *parent = 0);
|
explicit Button(const QString &text, QWidget *parent = 0);
|
||||||
|
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
};
|
};
|
||||||
|
@ -55,7 +55,7 @@ class ElidedLabel : public QFrame
|
|||||||
Q_PROPERTY(bool isElided READ isElided)
|
Q_PROPERTY(bool isElided READ isElided)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ElidedLabel(const QString &text, QWidget *parent = 0);
|
explicit ElidedLabel(const QString &text, QWidget *parent = 0);
|
||||||
|
|
||||||
void setText(const QString &text);
|
void setText(const QString &text);
|
||||||
const QString & text() const { return content; }
|
const QString & text() const { return content; }
|
||||||
|
@ -49,7 +49,7 @@ class Dialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Dialog(QWidget *parent = 0, bool smallScreen = false);
|
explicit Dialog(QWidget *parent = 0, bool smallScreen = false);
|
||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user