Macros | Typedefs | Enumerations | Functions | Variables
qglobal.h File Reference
#include <qfeatures.h>

Go to the source code of this file.

Macros

#define QT_VERSION   223
 
#define QT_VERSION_STR   "2.2.3"
 
#define _OS_UNIX_
 
#define UNIX
 
#define Q_PACKED
 
#define _WS_X11_
 
#define Q_DISABLE_COPY
 
#define QT_STATIC_CONST   static const
 
#define QT_STATIC_CONST_IMPL   const
 
#define QMAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define QMIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define QABS(a)   ((a) >= 0 ? (a) : -(a))
 
#define Q_EXPORT
 
#define CHECK_STATE
 
#define CHECK_RANGE
 
#define CHECK_NULL
 
#define CHECK_MATH
 
#define DEBUG
 
#define Q_NO_WARNINGS
 
#define Q_UNUSED(x)   x=x;
 
#define Q_CONST_UNUSED(x)   (void)x;
 
#define ASSERT(x)
 
#define CHECK_PTR(p)   (qt_check_pointer((p)==0,__FILE__,__LINE__))
 
#define QT_OBSOLETE
 
#define Q_DELETING_VOID_UNDEFINED
 

Typedefs

typedef int bool
 
typedef unsigned char uchar
 
typedef unsigned short ushort
 
typedef unsigned uint
 
typedef unsigned long ulong
 
typedef char * pchar
 
typedef ucharpuchar
 
typedef const char * pcchar
 
typedef long long int64
 
typedef unsigned long long uint64
 
typedef signed char INT8
 
typedef unsigned char UINT8
 
typedef short INT16
 
typedef unsigned short UINT16
 
typedef int INT32
 
typedef unsigned int UINT32
 
typedef signed char Q_INT8
 
typedef unsigned char Q_UINT8
 
typedef short Q_INT16
 
typedef unsigned short Q_UINT16
 
typedef int Q_INT32
 
typedef unsigned int Q_UINT32
 
typedef long Q_INT64
 
typedef unsigned long Q_UINT64
 
typedef void(* msg_handler) (QtMsgType, const char *)
 

Enumerations

enum  QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg }
 

Functions

int qRound (double d)
 
Q_EXPORT const char * qVersion ()
 
Q_EXPORT bool qSysInfo (int *wordSize, bool *bigEndian)
 
Q_EXPORT void qDebug (const char *,...)
 
Q_EXPORT void qWarning (const char *,...)
 
Q_EXPORT void qFatal (const char *,...)
 
Q_EXPORT void debug (const char *,...)
 
Q_EXPORT void warning (const char *,...)
 
Q_EXPORT void fatal (const char *,...)
 
Q_EXPORT bool qt_check_pointer (bool c, const char *, int)
 
Q_EXPORT msg_handler qInstallMsgHandler (msg_handler)
 
Q_EXPORT void qSuppressObsoleteWarnings (bool=TRUE)
 
Q_EXPORT void qObsolete (const char *obj, const char *oldfunc, const char *newfunc)
 
Q_EXPORT void qObsolete (const char *obj, const char *oldfunc)
 
Q_EXPORT void qObsolete (const char *message)
 

Variables

const bool FALSE = 0
 
const bool TRUE = !0
 

Macro Definition Documentation

#define _OS_UNIX_

Definition at line 146 of file qglobal.h.

#define _WS_X11_

Definition at line 303 of file qglobal.h.

#define ASSERT (   x)
Value:
if ( !(x) )\
qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
Q_EXPORT void qWarning(const char *,...)
Definition: qglobal.cpp:409
list x
Definition: train.py:276

Definition at line 590 of file qglobal.h.

#define CHECK_MATH

Definition at line 487 of file qglobal.h.

#define CHECK_NULL

Definition at line 486 of file qglobal.h.

#define CHECK_PTR (   p)    (qt_check_pointer((p)==0,__FILE__,__LINE__))

Definition at line 601 of file qglobal.h.

#define CHECK_RANGE

Definition at line 485 of file qglobal.h.

#define CHECK_STATE

Definition at line 484 of file qglobal.h.

#define DEBUG

Definition at line 491 of file qglobal.h.

#define Q_CONST_UNUSED (   x)    (void)x;

Definition at line 537 of file qglobal.h.

#define Q_DELETING_VOID_UNDEFINED

Definition at line 623 of file qglobal.h.

#define Q_DISABLE_COPY

Definition at line 319 of file qglobal.h.

#define Q_EXPORT

Definition at line 468 of file qglobal.h.

#define Q_NO_WARNINGS

Definition at line 501 of file qglobal.h.

#define Q_PACKED

Definition at line 283 of file qglobal.h.

#define Q_UNUSED (   x)    x=x;

Definition at line 536 of file qglobal.h.

#define QABS (   a)    ((a) >= 0 ? (a) : -(a))

Definition at line 392 of file qglobal.h.

#define QMAX (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 390 of file qglobal.h.

#define QMIN (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 391 of file qglobal.h.

#define QT_OBSOLETE

Definition at line 615 of file qglobal.h.

#define QT_STATIC_CONST   static const

Definition at line 380 of file qglobal.h.

#define QT_STATIC_CONST_IMPL   const

Definition at line 381 of file qglobal.h.

#define QT_VERSION   223

Definition at line 42 of file qglobal.h.

#define QT_VERSION_STR   "2.2.3"

Definition at line 43 of file qglobal.h.

#define UNIX

Definition at line 151 of file qglobal.h.

Typedef Documentation

typedef int bool

Definition at line 345 of file qglobal.h.

typedef short INT16

Definition at line 409 of file qglobal.h.

typedef int INT32

Definition at line 411 of file qglobal.h.

typedef long long int64

Definition at line 360 of file qglobal.h.

typedef signed char INT8

Definition at line 407 of file qglobal.h.

typedef void(* msg_handler) (QtMsgType, const char *)

Definition at line 608 of file qglobal.h.

typedef const char* pcchar

Definition at line 355 of file qglobal.h.

typedef char* pchar

Definition at line 353 of file qglobal.h.

typedef uchar* puchar

Definition at line 354 of file qglobal.h.

typedef short Q_INT16

Definition at line 417 of file qglobal.h.

typedef int Q_INT32

Definition at line 419 of file qglobal.h.

typedef long Q_INT64

Definition at line 421 of file qglobal.h.

typedef signed char Q_INT8

Definition at line 415 of file qglobal.h.

typedef unsigned short Q_UINT16

Definition at line 418 of file qglobal.h.

typedef unsigned int Q_UINT32

Definition at line 420 of file qglobal.h.

typedef unsigned long Q_UINT64

Definition at line 422 of file qglobal.h.

typedef unsigned char Q_UINT8

Definition at line 416 of file qglobal.h.

typedef unsigned char uchar

Definition at line 349 of file qglobal.h.

typedef unsigned uint

Definition at line 351 of file qglobal.h.

typedef unsigned short UINT16

Definition at line 410 of file qglobal.h.

typedef unsigned int UINT32

Definition at line 412 of file qglobal.h.

typedef unsigned long long uint64

Definition at line 361 of file qglobal.h.

typedef unsigned char UINT8

Definition at line 408 of file qglobal.h.

typedef unsigned long ulong

Definition at line 352 of file qglobal.h.

typedef unsigned short ushort

Definition at line 350 of file qglobal.h.

Enumeration Type Documentation

enum QtMsgType
Enumerator
QtDebugMsg 
QtWarningMsg 
QtFatalMsg 

Definition at line 606 of file qglobal.h.

Function Documentation

Q_EXPORT void debug ( const char *  ,
  ... 
)

Definition at line 393 of file qglobal.cpp.

394 {
395  char buf[8196];
396  va_list ap;
397  va_start( ap, msg ); // use variable arg list
398  if ( handler ) {
399  vsprintf( buf, msg, ap );
400  va_end( ap );
401  (*handler)( QtDebugMsg, buf );
402  } else {
403  vfprintf( stderr, msg, ap );
404  va_end( ap );
405  fprintf( stderr, "\n" ); // add newline
406  }
407 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42
Q_EXPORT void fatal ( const char *  ,
  ... 
)

Definition at line 465 of file qglobal.cpp.

466 {
467  char buf[8196];
468  va_list ap;
469  va_start( ap, msg ); // use variable arg list
470  if ( handler ) {
471  vsprintf( buf, msg, ap );
472  va_end( ap );
473  (*handler)( QtFatalMsg, buf );
474  } else {
475  vfprintf( stderr, msg, ap );
476  va_end( ap );
477  fprintf( stderr, "\n" ); // add newline
478 #if defined(_OS_UNIX_) && defined(DEBUG)
479  abort(); // trap; generates core dump
480 #else
481  exit( 1 ); // goodbye cruel world
482 #endif
483  }
484 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42
Q_EXPORT void qDebug ( const char *  ,
  ... 
)

Definition at line 376 of file qglobal.cpp.

377 {
378  char buf[8196];
379  va_list ap;
380  va_start( ap, msg ); // use variable arg list
381  if ( handler ) {
382  vsprintf( buf, msg, ap ); // ### vsnprintf would be great here
383  va_end( ap );
384  (*handler)( QtDebugMsg, buf );
385  } else {
386  vfprintf( stderr, msg, ap );
387  va_end( ap );
388  fprintf( stderr, "\n" ); // add newline
389  }
390 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42
Q_EXPORT void qFatal ( const char *  ,
  ... 
)

Definition at line 443 of file qglobal.cpp.

444 {
445  char buf[8196];
446  va_list ap;
447  va_start( ap, msg ); // use variable arg list
448  if ( handler ) {
449  vsprintf( buf, msg, ap );
450  va_end( ap );
451  (*handler)( QtFatalMsg, buf );
452  } else {
453  vfprintf( stderr, msg, ap );
454  va_end( ap );
455  fprintf( stderr, "\n" ); // add newline
456 #if defined(_OS_UNIX_) && defined(DEBUG)
457  abort(); // trap; generates core dump
458 #else
459  exit( 1 ); // goodbye cruel world
460 #endif
461  }
462 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42
Q_EXPORT msg_handler qInstallMsgHandler ( msg_handler  )
Q_EXPORT void qObsolete ( const char *  obj,
const char *  oldfunc,
const char *  newfunc 
)

Definition at line 586 of file qglobal.cpp.

587 {
588  if ( suppressObsolete )
589  return;
590  if ( !firstObsoleteWarning(obj, oldfunc) )
591  return;
592  if ( obj )
593  qDebug( "%s::%s: This function is obsolete, use %s instead.",
594  obj, oldfunc, newfunc );
595  else
596  qDebug( "%s: This function is obsolete, use %s instead.",
597  oldfunc, newfunc );
598 }
void qDebug(const char *msg,...)
Definition: qglobal.cpp:376
static bool firstObsoleteWarning(const char *obj, const char *oldfunc)
Definition: qglobal.cpp:557
static bool suppressObsolete
Definition: qglobal.cpp:579
Q_EXPORT void qObsolete ( const char *  obj,
const char *  oldfunc 
)

Definition at line 600 of file qglobal.cpp.

601 {
602  if ( suppressObsolete )
603  return;
604  if ( !firstObsoleteWarning(obj, oldfunc) )
605  return;
606  if ( obj )
607  qDebug( "%s::%s: This function is obsolete.", obj, oldfunc );
608  else
609  qDebug( "%s: This function is obsolete.", oldfunc );
610 }
void qDebug(const char *msg,...)
Definition: qglobal.cpp:376
static bool firstObsoleteWarning(const char *obj, const char *oldfunc)
Definition: qglobal.cpp:557
static bool suppressObsolete
Definition: qglobal.cpp:579
Q_EXPORT void qObsolete ( const char *  message)

Definition at line 612 of file qglobal.cpp.

613 {
614  if ( suppressObsolete )
615  return;
616  if ( !firstObsoleteWarning( "Qt", message) )
617  return;
618  qDebug( "%s", message );
619 }
void qDebug(const char *msg,...)
Definition: qglobal.cpp:376
static bool firstObsoleteWarning(const char *obj, const char *oldfunc)
Definition: qglobal.cpp:557
static bool suppressObsolete
Definition: qglobal.cpp:579
int qRound ( double  d)
inline

Definition at line 394 of file qglobal.h.

395 {
396  return d > 0.0 ? int(d+0.5) : int(d-0.5);
397 }
Q_EXPORT void qSuppressObsoleteWarnings ( bool  = TRUE)

Definition at line 581 of file qglobal.cpp.

582 {
583  suppressObsolete = suppress;
584 }
static bool suppressObsolete
Definition: qglobal.cpp:579
Q_EXPORT bool qSysInfo ( int *  wordSize,
bool bigEndian 
)
Q_EXPORT bool qt_check_pointer ( bool  c,
const char *  ,
int   
)

Definition at line 549 of file qglobal.cpp.

550 {
551  if ( c )
552  qFatal( "In file %s, line %d: Out of memory", n, l );
553  return TRUE;
554 }
static QStrList * l
Definition: config.cpp:1044
std::void_t< T > n
void qFatal(const char *msg,...)
Definition: qglobal.cpp:443
const bool TRUE
Definition: qglobal.h:371
Q_EXPORT const char* qVersion ( )
Q_EXPORT void qWarning ( const char *  ,
  ... 
)

Definition at line 409 of file qglobal.cpp.

410 {
411  char buf[8196];
412  va_list ap;
413  va_start( ap, msg ); // use variable arg list
414  if ( handler ) {
415  vsprintf( buf, msg, ap );
416  va_end( ap );
417  (*handler)( QtWarningMsg, buf );
418  } else {
419  vfprintf( stderr, msg, ap );
420  va_end( ap );
421  fprintf( stderr, "\n" ); // add newline
422  }
423 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42
Q_EXPORT void warning ( const char *  ,
  ... 
)

Definition at line 427 of file qglobal.cpp.

428 {
429  char buf[8196];
430  va_list ap;
431  va_start( ap, msg ); // use variable arg list
432  if ( handler ) {
433  vsprintf( buf, msg, ap );
434  va_end( ap );
435  (*handler)( QtWarningMsg, buf );
436  } else {
437  vfprintf( stderr, msg, ap );
438  va_end( ap );
439  fprintf( stderr, "\n" ); // add newline
440  }
441 }
void msg(const char *fmt,...)
Definition: message.cpp:107
static msg_handler handler
Definition: qglobal.cpp:234
UWORD32 buf[4]
Definition: md5.h:42

Variable Documentation

const bool FALSE = 0

Definition at line 370 of file qglobal.h.

const bool TRUE = !0

Definition at line 371 of file qglobal.h.