Qt 4.8
Classes | Functions
qkeysequence.h File Reference
#include <QtCore/qnamespace.h>
#include <QtCore/qstring.h>

Go to the source code of this file.

Classes

class  QKeySequence
 The QKeySequence class encapsulates a key sequence as used by shortcuts. More...
 

Functions

Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &in, const QKeySequence &ks)
 
Q_GUI_EXPORT QDebug operator<< (QDebug, const QKeySequence &)
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &out, QKeySequence &ks)
 
 Q_DECLARE_TYPEINFO (QKeySequence, Q_MOVABLE_TYPE)
 
void qt_set_sequence_auto_mnemonic (bool b)
 

Function Documentation

◆ operator<<() [1/2]

Q_GUI_EXPORT QDataStream& operator<< ( QDataStream in,
const QKeySequence ks 
)

Definition at line 1720 of file qkeysequence.cpp.

Referenced by QKeySequence::data_ptr().

1721 {
1722  QList<quint32> list;
1723  list << keysequence.d->key[0];
1724 
1725  if (s.version() >= 5 && keysequence.count() > 1) {
1726  list << keysequence.d->key[1];
1727  list << keysequence.d->key[2];
1728  list << keysequence.d->key[3];
1729  }
1730  s << list;
1731  return s;
1732 }
QListData::Data * d
Definition: qlist.h:118
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ operator<<() [2/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug  ,
const QKeySequence  
)

Definition at line 1759 of file qkeysequence.cpp.

1760 {
1761 #ifndef Q_BROKEN_DEBUG_STREAM
1762  dbg.nospace() << "QKeySequence(" << p.toString() << ')';
1763  return dbg.space();
1764 #else
1765  qWarning("This compiler doesn't support streaming QKeySequence to QDebug");
1766  return dbg;
1767  Q_UNUSED(p);
1768 #endif
1769 }
Q_CORE_EXPORT void qWarning(const char *,...)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ operator>>()

Q_GUI_EXPORT QDataStream& operator>> ( QDataStream out,
QKeySequence ks 
)

Definition at line 1746 of file qkeysequence.cpp.

1747 {
1748  qAtomicDetach(keysequence.d);
1749  QList<quint32> list;
1750  s >> list;
1751  for (int i = 0; i < 4; ++i)
1752  keysequence.d->key[i] = list.value(i);
1753  return s;
1754 }
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
Definition: qatomic.h:214
QListData::Data * d
Definition: qlist.h:118
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( QKeySequence  ,
Q_MOVABLE_TYPE   
)

Referenced by QKeySequence::data_ptr().

◆ qt_set_sequence_auto_mnemonic()

void qt_set_sequence_auto_mnemonic ( bool  b)

Definition at line 148 of file qkeysequence.cpp.

148 { qt_sequence_no_mnemonics = !b; }
static bool qt_sequence_no_mnemonics