Engauge Digitizer 2
Loading...
Searching...
No Matches
Compatibility Class Reference

Centralize hacks necessary to support multiple qt versions. More...

#include <Compatibility.h>

Collaboration diagram for Compatibility:
Collaboration graph

Public Member Functions

 Compatibility ()
 Single default constructor.

Static Public Member Functions

static QTextStream & endl (QTextStream &stream)
 End of line.
static QTextStream & flush (QTextStream &stream)
 Flush.
static Qt::SplitBehavior SkipEmptyParts ()
 SplitBehavior.

Detailed Description

Centralize hacks necessary to support multiple qt versions.

Definition at line 16 of file Compatibility.h.

Constructor & Destructor Documentation

◆ Compatibility()

Compatibility::Compatibility ( )

Single default constructor.

Definition at line 14 of file Compatibility.cpp.

15{
16}

Member Function Documentation

◆ endl()

QTextStream & Compatibility::endl ( QTextStream & stream)
static

End of line.

Definition at line 18 of file Compatibility.cpp.

19{
20 LOG4CPP_INFO_S ((*mainCat)) << "Compatibility::endl";
21
22 // Comments:
23 // 1) QTextStream in text mode uses \n\r for carriage return
24 // 2) \n by itself does not flush
25 // 3) \n by itself could be safely used wherever this method is used, but this method has nice comments
26 // and the performance gain from skipping the flush that end() adds is insignificant
27
28#if QT_VERSION < QT_VERSION_CHECK (5, 14, 0)
29 str << "\n"; // std::endl will not compile
30#else
31 str << Qt::endl; // Enum
32#endif
33
34 return str;
35}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ flush()

QTextStream & Compatibility::flush ( QTextStream & stream)
static

Flush.

Definition at line 37 of file Compatibility.cpp.

38{
39
40#if QT_VERSION < QT_VERSION_CHECK (5, 14, 0)
41 // std::flush will not compile so we skip flushing
42#else
43 str << Qt::flush; // Enum
44#endif
45
46 return str;
47}

◆ SkipEmptyParts()

Qt::SplitBehavior Compatibility::SkipEmptyParts ( )
static

SplitBehavior.

Definition at line 55 of file Compatibility.cpp.

56{
57 return Qt::SkipEmptyParts;
58}

The documentation for this class was generated from the following files: