Obsolete Members for <QtGlobal>

The following members of class <QtGlobal> are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Types

(obsolete) typedef QtMsgHandler

Functions

(obsolete) QtMsgHandler qInstallMsgHandler(QtMsgHandler handler)
(obsolete) int qrand()
(obsolete) void qsrand(uint seed)

Macros

(obsolete) QABS(n)
(obsolete) QMAX(x, y)
(obsolete) QMIN(x, y)

Type Documentation

typedef QtMsgHandler

This typedef is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This is a typedef for a pointer to a function with the following signature:

void myMsgHandler(QtMsgType, const char *);

This typedef is deprecated, you should use QtMessageHandler instead.

See also QtMsgType, QtMessageHandler, qInstallMsgHandler(), and qInstallMessageHandler().

Function Documentation

QtMsgHandler qInstallMsgHandler(QtMsgHandler handler)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Installs a Qt message handler which has been defined previously. This method is deprecated, use qInstallMessageHandler instead.

See also QtMsgHandler and qInstallMessageHandler().

int qrand()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Thread-safe version of the standard C++ rand() function.

Returns a value between 0 and RAND_MAX (defined in <cstdlib> and <stdlib.h>), the next number in the current sequence of pseudo-random integers.

Use qsrand() to initialize the pseudo-random number generator with a seed value. Seeding must be performed at least once on each thread. If that step is skipped, then the sequence will be pre-seeded with a constant value.

Note: This function is deprecated. In new applications, use QRandomGenerator instead.

This function was introduced in Qt 4.2.

See also qrand() and QRandomGenerator.

void qsrand(uint seed)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Thread-safe version of the standard C++ srand() function.

Sets the argument seed to be used to generate a new random number sequence of pseudo random integers to be returned by qrand().

The sequence of random numbers generated is deterministic per thread. For example, if two threads call qsrand(1) and subsequently call qrand(), the threads will get the same random number sequence.

Note: This function is deprecated. In new applications, use QRandomGenerator instead.

This function was introduced in Qt 4.2.

See also qrand() and QRandomGenerator.

Macro Documentation

QABS(n)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use qAbs(n) instead.

See also QMIN() and QMAX().

QMAX(x, y)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use qMax(x, y) instead.

See also QMIN() and QABS().

QMIN(x, y)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use qMin(x, y) instead.

See also QMAX() and QABS().

© 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.