Mark (non-public API's) 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: I12ad5b6eb1794108c6b7464a2573e84068733b03 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
26b6cce44b
commit
0a37bcf245
|
|
@ -50,11 +50,11 @@ QT_BEGIN_NAMESPACE
|
|||
class QDirPrivate : public QSharedData
|
||||
{
|
||||
public:
|
||||
QDirPrivate(const QString &path, const QStringList &nameFilters_ = QStringList(),
|
||||
QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
|
||||
QDir::Filters filters_ = QDir::AllEntries);
|
||||
explicit QDirPrivate(const QString &path, const QStringList &nameFilters_ = QStringList(),
|
||||
QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
|
||||
QDir::Filters filters_ = QDir::AllEntries);
|
||||
|
||||
QDirPrivate(const QDirPrivate ©);
|
||||
explicit QDirPrivate(const QDirPrivate ©);
|
||||
|
||||
bool exists() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Q_SIGNALS:
|
|||
void bytesWritten(qint64 bytes);
|
||||
|
||||
public:
|
||||
QWindowsPipeWriter(HANDLE writePipe, QObject * parent = 0);
|
||||
explicit QWindowsPipeWriter(HANDLE writePipe, QObject * parent = 0);
|
||||
~QWindowsPipeWriter();
|
||||
|
||||
bool waitForWrite(int msecs);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class Q_CORE_EXPORT QFactoryLoader : public QObject
|
|||
Q_DECLARE_PRIVATE(QFactoryLoader)
|
||||
|
||||
public:
|
||||
QFactoryLoader(const char *iid,
|
||||
explicit QFactoryLoader(const char *iid,
|
||||
const QString &suffix = QString(),
|
||||
Qt::CaseSensitivity = Qt::CaseSensitive);
|
||||
~QFactoryLoader();
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public:
|
|||
class Q_CORE_EXPORT QLocalePrivate : public QSharedData
|
||||
{
|
||||
public:
|
||||
QLocalePrivate(int index, int numberOptions = 0)
|
||||
explicit QLocalePrivate(int index, int numberOptions = 0)
|
||||
: m_index(index), m_numberOptions(numberOptions)
|
||||
{
|
||||
m_data = dataPointerForIndex(index);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public:
|
|||
Curve
|
||||
};
|
||||
|
||||
QPathEdge(int a = -1, int b = -1);
|
||||
explicit QPathEdge(int a = -1, int b = -1);
|
||||
|
||||
mutable int flag;
|
||||
|
||||
|
|
|
|||
|
|
@ -752,7 +752,7 @@ class Q_GUI_EXPORT Parser
|
|||
{
|
||||
public:
|
||||
Parser();
|
||||
Parser(const QString &css, bool file = false);
|
||||
explicit Parser(const QString &css, bool file = false);
|
||||
|
||||
void init(const QString &css, bool file = false);
|
||||
bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity = Qt::CaseSensitive);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
|
|||
class QFontSubset
|
||||
{
|
||||
public:
|
||||
QFontSubset(QFontEngine *fe, int obj_id = 0)
|
||||
explicit QFontSubset(QFontEngine *fe, int obj_id = 0)
|
||||
: object_id(obj_id), noEmbed(false), fontEngine(fe), downloaded_glyphs(0), standard_font(false)
|
||||
{ fontEngine->ref.ref(); addGlyph(0); }
|
||||
~QFontSubset() {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class QZipReaderPrivate;
|
|||
class Q_GUI_EXPORT QZipReader
|
||||
{
|
||||
public:
|
||||
QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
|
||||
explicit QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
|
||||
|
||||
explicit QZipReader(QIODevice *device);
|
||||
~QZipReader();
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class QZipWriterPrivate;
|
|||
class Q_GUI_EXPORT QZipWriter
|
||||
{
|
||||
public:
|
||||
QZipWriter(const QString &fileName, QIODevice::OpenMode mode = (QIODevice::WriteOnly | QIODevice::Truncate) );
|
||||
explicit QZipWriter(const QString &fileName, QIODevice::OpenMode mode = (QIODevice::WriteOnly | QIODevice::Truncate) );
|
||||
|
||||
explicit QZipWriter(QIODevice *device);
|
||||
~QZipWriter();
|
||||
|
|
|
|||
|
|
@ -92,10 +92,10 @@ class Q_AUTOTEST_EXPORT QHttpNetworkConnection : public QObject
|
|||
public:
|
||||
|
||||
#ifndef QT_NO_BEARERMANAGEMENT
|
||||
QHttpNetworkConnection(const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0, QSharedPointer<QNetworkSession> networkSession = QSharedPointer<QNetworkSession>());
|
||||
explicit QHttpNetworkConnection(const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0, QSharedPointer<QNetworkSession> networkSession = QSharedPointer<QNetworkSession>());
|
||||
QHttpNetworkConnection(quint16 channelCount, const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0, QSharedPointer<QNetworkSession> networkSession = QSharedPointer<QNetworkSession>());
|
||||
#else
|
||||
QHttpNetworkConnection(const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0);
|
||||
explicit QHttpNetworkConnection(const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0);
|
||||
QHttpNetworkConnection(quint16 channelCount, const QString &hostName, quint16 port = 80, bool encrypt = false, QObject *parent = 0);
|
||||
#endif
|
||||
~QHttpNetworkConnection();
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public:
|
|||
LowPriority
|
||||
};
|
||||
|
||||
QHttpNetworkRequest(const QUrl &url = QUrl(), Operation operation = Get, Priority priority = NormalPriority);
|
||||
explicit QHttpNetworkRequest(const QUrl &url = QUrl(), Operation operation = Get, Priority priority = NormalPriority);
|
||||
QHttpNetworkRequest(const QHttpNetworkRequest &other);
|
||||
virtual ~QHttpNetworkRequest();
|
||||
QHttpNetworkRequest &operator=(const QHttpNetworkRequest &other);
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ public:
|
|||
class QGLTemporaryContextPrivate;
|
||||
class QGLTemporaryContext {
|
||||
public:
|
||||
QGLTemporaryContext(bool directRendering = true, QWidget *parent = 0);
|
||||
explicit QGLTemporaryContext(bool directRendering = true, QWidget *parent = 0);
|
||||
~QGLTemporaryContext();
|
||||
|
||||
private:
|
||||
|
|
@ -416,7 +416,7 @@ Q_SIGNALS:
|
|||
|
||||
class QGLTexture {
|
||||
public:
|
||||
QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
|
||||
explicit QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
|
||||
QGLContext::BindOptions opt = QGLContext::DefaultBindOption)
|
||||
: context(ctx),
|
||||
id(tx_id),
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class QEvdevTabletHandler : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QEvdevTabletHandler(const QString &spec = QString(), QObject *parent = 0);
|
||||
explicit QEvdevTabletHandler(const QString &spec = QString(), QObject *parent = 0);
|
||||
~QEvdevTabletHandler();
|
||||
|
||||
private slots:
|
||||
|
|
@ -70,7 +70,7 @@ private:
|
|||
class QEvdevTabletHandlerThread : public QThread
|
||||
{
|
||||
public:
|
||||
QEvdevTabletHandlerThread(const QString &spec, QObject *parent = 0);
|
||||
explicit QEvdevTabletHandlerThread(const QString &spec, QObject *parent = 0);
|
||||
~QEvdevTabletHandlerThread();
|
||||
void run();
|
||||
QEvdevTabletHandler *handler() { return m_handler; }
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class QEvdevTouchScreenHandler : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0);
|
||||
explicit QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0);
|
||||
~QEvdevTouchScreenHandler();
|
||||
|
||||
private slots:
|
||||
|
|
@ -81,7 +81,7 @@ private:
|
|||
class QEvdevTouchScreenHandlerThread : public QThread
|
||||
{
|
||||
public:
|
||||
QEvdevTouchScreenHandlerThread(const QString &spec, QObject *parent = 0);
|
||||
explicit QEvdevTouchScreenHandlerThread(const QString &spec, QObject *parent = 0);
|
||||
~QEvdevTouchScreenHandlerThread();
|
||||
void run();
|
||||
QEvdevTouchScreenHandler *handler() { return m_handler; }
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class QSpiDBusCache : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSpiDBusCache(QDBusConnection c, QObject* parent = 0);
|
||||
explicit QSpiDBusCache(QDBusConnection c, QObject* parent = 0);
|
||||
void emitAddAccessible(const QSpiAccessibleCacheItem& item);
|
||||
void emitRemoveAccessible(const QSpiObjectReference& item);
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class QConnmanProfileInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
explicit QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
~QConnmanProfileInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -182,7 +182,7 @@ class QConnmanServiceInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
explicit QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
~QConnmanServiceInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -244,7 +244,7 @@ class QConnmanTechnologyInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
explicit QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
~QConnmanTechnologyInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -269,7 +269,7 @@ class QConnmanAgentInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
explicit QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
|
||||
~QConnmanAgentInterface();
|
||||
|
||||
void release();
|
||||
|
|
@ -288,7 +288,7 @@ class QConnmanCounterInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
explicit QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
~QConnmanCounterInterface();
|
||||
|
||||
// void release();
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class QOfonoModemInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
explicit QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
~QOfonoModemInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -170,7 +170,7 @@ class QOfonoNetworkRegistrationInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
explicit QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
~QOfonoNetworkRegistrationInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -201,7 +201,7 @@ class QOfonoNetworkOperatorInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
//modem or operator paths
|
||||
QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
explicit QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
~QOfonoNetworkOperatorInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -225,7 +225,7 @@ class QOfonoSimInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
explicit QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
~QOfonoSimInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -253,7 +253,7 @@ class QOfonoDataConnectionManagerInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
explicit QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
~QOfonoDataConnectionManagerInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -279,7 +279,7 @@ class QOfonoPrimaryDataContextInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoPrimaryDataContextInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
explicit QOfonoPrimaryDataContextInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||
~QOfonoPrimaryDataContextInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
@ -309,7 +309,7 @@ class QOfonoSmsInterface : public QDBusAbstractInterface
|
|||
|
||||
public:
|
||||
|
||||
QOfonoSmsInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
explicit QOfonoSmsInterface(const QString &dbusModemPathName, QObject *parent = 0);
|
||||
~QOfonoSmsInterface();
|
||||
|
||||
QVariantMap getProperties();
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ class QCUPSSupport;
|
|||
class QPageSetupWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
QPageSetupWidget(QWidget *parent = 0);
|
||||
QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
|
||||
explicit QPageSetupWidget(QWidget *parent = 0);
|
||||
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
|
||||
void setPrinter(QPrinter *printer);
|
||||
/// copy information from the widget and apply that to the printer.
|
||||
void setupPrinter() const;
|
||||
|
|
|
|||
|
|
@ -1642,7 +1642,7 @@ class QML_PARSER_EXPORT CaseBlock: public Node
|
|||
public:
|
||||
QQMLJS_DECLARE_AST_NODE(CaseBlock)
|
||||
|
||||
CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
|
||||
explicit CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
|
||||
clauses (c), defaultClause (d), moreClauses (r)
|
||||
{ kind = K; }
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace QQmlJS { namespace AST {
|
|||
class SourceLocation
|
||||
{
|
||||
public:
|
||||
SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
|
||||
explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
|
||||
: offset(offset), length(length),
|
||||
startLine(line), startColumn(column)
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
class QFileSystemNode
|
||||
{
|
||||
public:
|
||||
QFileSystemNode(const QString &filename = QString(), QFileSystemNode *p = 0)
|
||||
explicit QFileSystemNode(const QString &filename = QString(), QFileSystemNode *p = 0)
|
||||
: fileName(filename), populatedChildren(false), isVisible(false), dirtyChildrenIndex(-1), parent(p), info(0) {}
|
||||
~QFileSystemNode() {
|
||||
QHash<QString, QFileSystemNode*>::const_iterator i = children.constBegin();
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
|
|||
*/
|
||||
class Q_WIDGETS_EXPORT QFSCompleter : public QCompleter {
|
||||
public:
|
||||
QFSCompleter(QFileSystemModel *model, QObject *parent = 0)
|
||||
explicit QFSCompleter(QFileSystemModel *model, QObject *parent = 0)
|
||||
: QCompleter(model, parent), proxyModel(0), sourceModel(model)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
|
|
|
|||
|
|
@ -209,8 +209,8 @@ QT_BEGIN_NAMESPACE
|
|||
class XPThemeData
|
||||
{
|
||||
public:
|
||||
XPThemeData(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
|
||||
int part = 0, int state = 0, const QRect &r = QRect())
|
||||
explicit XPThemeData(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
|
||||
int part = 0, int state = 0, const QRect &r = QRect())
|
||||
: widget(w), painter(p), theme(themeIn), htheme(0), partId(part), stateId(state),
|
||||
mirrorHorizontally(false), mirrorVertically(false), noBorder(false),
|
||||
noContent(false), rotate(0), rect(r)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class QUndoAction : public QAction
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QUndoAction(const QString &prefix, QObject *parent = 0);
|
||||
explicit QUndoAction(const QString &prefix, QObject *parent = 0);
|
||||
void setTextFormat(const QString &textFormat, const QString &defaultText);
|
||||
public Q_SLOTS:
|
||||
void setPrefixedText(const QString &text);
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class QCalendarPopup : public QWidget
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QCalendarPopup(QWidget *parent = 0, QCalendarWidget *cw = 0);
|
||||
explicit QCalendarPopup(QWidget *parent = 0, QCalendarWidget *cw = 0);
|
||||
QDate selectedDate() { return verifyCalendarInstance()->selectedDate(); }
|
||||
void setDate(const QDate &date);
|
||||
void setDateRange(const QDate &min, const QDate &max);
|
||||
|
|
|
|||
Loading…
Reference in New Issue