update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / ui / qt / utils / variant_pointer.h
blob7a95a94c56c2870de35ce253647031cc72d729d8
1 /** @file
3 * Range routines
5 * Roland Knall <rknall@gmail.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #ifndef UI_QT_VARIANT_POINTER_H_
15 #define UI_QT_VARIANT_POINTER_H_
17 #include <QVariant>
19 template <typename T> class VariantPointer
22 public:
23 static T* asPtr(QVariant v)
25 return (T *) v.value<void *>();
28 static QVariant asQVariant(T* ptr)
30 return QVariant::fromValue((void *) ptr);
34 #endif /* UI_QT_VARIANT_POINTER_H_ */