Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
variant_pointer.h
Go to the documentation of this file.
1
14#ifndef UI_QT_VARIANT_POINTER_H_
15#define UI_QT_VARIANT_POINTER_H_
16
17#include <QVariant>
18
19template <typename T> class VariantPointer
20{
21
22public:
23 static T* asPtr(QVariant v)
24 {
25 return (T *) v.value<void *>();
26 }
27
28 static QVariant asQVariant(T* ptr)
29 {
30 return QVariant::fromValue((void *) ptr);
31 }
32};
33
34#endif /* UI_QT_VARIANT_POINTER_H_ */
Definition variant_pointer.h:20