Qt 4.8
Public Functions | Static Public Functions | Private Functions | Properties | List of all members
QHashableLatin1Literal Class Reference

#include <qgtkstyle_p.h>

Public Functions

const char * data () const
 
QHashableLatin1Literaloperator= (const QHashableLatin1Literal &other)
 
template<int N>
 QHashableLatin1Literal (const char(&str)[N])
 
 QHashableLatin1Literal (const QHashableLatin1Literal &other)
 
int size () const
 
QString toString () const
 

Static Public Functions

static QHashableLatin1Literal fromData (const char *str)
 

Private Functions

 QHashableLatin1Literal (const char *str, int length)
 

Properties

const char * m_data
 
const int m_size
 

Detailed Description

Definition at line 82 of file qgtkstyle_p.h.

Constructors and Destructors

◆ QHashableLatin1Literal() [1/3]

template<int N>
QHashableLatin1Literal::QHashableLatin1Literal ( const char(&)  str[N])
inline

Definition at line 93 of file qgtkstyle_p.h.

Referenced by data(), and fromData().

94  : m_size(N - 1), m_data(str) {}

◆ QHashableLatin1Literal() [2/3]

QHashableLatin1Literal::QHashableLatin1Literal ( const QHashableLatin1Literal other)
inline

Definition at line 97 of file qgtkstyle_p.h.

98  : m_size(other.m_size), m_data(other.m_data)
99  {}

◆ QHashableLatin1Literal() [3/3]

QHashableLatin1Literal::QHashableLatin1Literal ( const char *  str,
int  length 
)
inlineprivate

Definition at line 118 of file qgtkstyle_p.h.

119  : m_size(length), m_data(str)
120  {}

Functions

◆ data()

const char* QHashableLatin1Literal::data ( ) const
inline

Definition at line 86 of file qgtkstyle_p.h.

Referenced by QGtkStylePrivate::addWidgetToMap(), operator==(), and qHash().

86 { return m_data; }

◆ fromData()

static QHashableLatin1Literal QHashableLatin1Literal::fromData ( const char *  str)
inlinestatic

Definition at line 112 of file qgtkstyle_p.h.

Referenced by classPath(), and QGtkStylePrivate::initGtkWidgets().

113  {
114  return QHashableLatin1Literal(str, qstrlen(str));
115  }
QHashableLatin1Literal(const char(&str)[N])
Definition: qgtkstyle_p.h:93
uint qstrlen(const char *str)
Definition: qbytearray.h:79

◆ operator=()

QHashableLatin1Literal& QHashableLatin1Literal::operator= ( const QHashableLatin1Literal other)
inline

Definition at line 101 of file qgtkstyle_p.h.

102  {
103  if (this == &other)
104  return *this;
105  *const_cast<int *>(&m_size) = other.m_size;
106  *const_cast<char **>(&m_data) = const_cast<char *>(other.m_data);
107  return *this;
108  }

◆ size()

int QHashableLatin1Literal::size ( ) const
inline

Definition at line 85 of file qgtkstyle_p.h.

Referenced by operator==(), and qHash().

85 { return m_size; }

◆ toString()

QString QHashableLatin1Literal::toString ( ) const
inline

Definition at line 110 of file qgtkstyle_p.h.

Referenced by QGtkStyle::drawComplexControl().

110 { return QString::fromLatin1(m_data, m_size); }
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

Properties

◆ m_data

const char* QHashableLatin1Literal::m_data
private

Definition at line 123 of file qgtkstyle_p.h.

Referenced by data(), operator=(), and toString().

◆ m_size

const int QHashableLatin1Literal::m_size
private

Definition at line 122 of file qgtkstyle_p.h.

Referenced by data(), operator=(), size(), and toString().


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