[Development] Qt 5.2 header diff: QtCore

Thiago Macieira thiago.macieira at intel.com
Tue Nov 5 02:25:45 CET 2013


I didn't find anything, but I did not review qmetatype.h. These are just 
comments and explanations.

On segunda-feira, 4 de novembro de 2013 16:07:32, Thiago Macieira wrote:

qlogging.h:
> -enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg,
> QtSystemMsg = QtCriticalMsg }; 
> +enum QtMsgType { QtDebugMsg, QtWarningMsg,
> QtCriticalMsg, QtFatalMsg, QtTraceMsg, QtSystemMsg = QtCriticalMsg };

Ok, since the QtTraceMsg item is inserted before enum entries that have =.

qurl.h:
> -    void setUserName(const QString &userName, ParsingMode mode =
> TolerantMode); 
> -    QString userName(ComponentFormattingOptions options =
> PrettyDecoded) const; 
> +    void setUserName(const QString &userName,
> ParsingMode mode = DecodedMode); 
> +    QString
> userName(ComponentFormattingOptions options = FullyDecoded) const;

This and all the other QUrl members changed the default parameter only.

qabstractitemmodel.h:
> +// qHash is a friend, but we can't use default arguments for friends
> (ยง8.3.6.4) 
> +uint qHash(const QPersistentModelIndex &index, uint seed = 0);

Please don't refer to sections of the standard by number, they sometimes 
change. Each chapter has a name associated. 8.3.6 is [dcl.fct.default].

> +#ifdef Q_NO_USING_KEYWORD
> +#ifndef Q_QDOC
> +    inline QObject *parent() const { return QAbstractItemModel::parent(); }
> +#endif
> +#else
> +    using QObject::parent;
> +#endif

No compiler we support requires Q_NO_USING_KEYWORD. It's high time we removed 
it from qcompilerdetection.h. The code above should not have been allowed with 
that #define.

> diff --git a/src/corelib/kernel/qfunctions_wince.h
> b/src/corelib/kernel/qfunctions_wince.h 
> index ab7bbe3..c71bd6a 100644
> --- a/src/corelib/kernel/qfunctions_wince.h
> +++ b/src/corelib/kernel/qfunctions_wince.h

This file is probably private and should be renamed.

qmetatype.h:
> +#include <vector>
> +#include <list>
> +#include <map>

Argh. Thanks for making the compilation that much slower. These three lines 
probably impact Qt's compilation time in 20%, or more.

> +    template<class T> QSequentialIterableImpl(const T*p)
> +      : _iterable(p)
> +      , _iterator(0)

I'm going to change this. The comma must go to the line above in all QtCore 
files. Comma on the next line like the above is extremely ugly, it makes me 
want to puke.

I've not reviewed the rest of qmetatype.h. It's too complex for me. The last 
time I had to fix anything there, it took me over 15 minutes just to figure out 
how anything gets created. This file is getting close to Boost-level template 
complexity. 

I'll just pay attention to every change there and will be a little anal about 
all changes made.

qcryptographichash.h:
> +#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
>          Md4,
>          Md5,
> -        Sha1,
> +#endif
> +        Sha1 = 2,

No change in values.

qlist.h:
> -    if (alength < 0 || pos + alength > size())
> +    if (alength < 0 || pos > size() - alength)

This change might have fixed the last warning in QtCore and a warning that 
showed up in user code!

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131104/42f18894/attachment.sig>


More information about the Development mailing list