| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
VariantPointer< T > Class Template Reference

A template utility class for converting between pointers and QVariant objects. More...

`#include <variant_pointer.h>`

## Static Public Member Functions
static T * | asPtr (QVariant v)
| Converts a QVariant containing a void pointer back to a typed pointer.
static QVariant | asQVariant (T *ptr)
| Converts a typed pointer into a QVariant.

## Detailed Description

template<typename T>
class VariantPointer< T >

A template utility class for converting between pointers and QVariant objects.

## Member Function Documentation

## ◆ asPtr()

template<typename T>

T * VariantPointer< T >::asPtr | ( | QVariant | v | ) |
| inline static

Converts a QVariant containing a void pointer back to a typed pointer.

Parameters

  v | The QVariant containing the pointer data.

Returns
  A pointer of type T.

## ◆ asQVariant()

template<typename T>

QVariant VariantPointer< T >::asQVariant | ( | T * | ptr | ) |
| inline static

Converts a typed pointer into a QVariant.

Parameters

  ptr | The pointer to convert.

Returns
  A QVariant encapsulating the pointer.

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

- /builds/wireshark/wireshark/ui/qt/utils/variant_pointer.h