Qt 4.8
Public Functions | Public Variables | Properties | List of all members
QtPropertyBag Class Reference
Inheritance diagram for QtPropertyBag:

Public Functions

unsigned long __stdcall AddRef ()
 
 QtPropertyBag ()
 
HRESULT __stdcall QueryInterface (REFIID iid, LPVOID *iface)
 
HRESULT __stdcall Read (LPCOLESTR name, VARIANT *var, IErrorLog *)
 
unsigned long __stdcall Release ()
 
HRESULT __stdcall Write (LPCOLESTR name, VARIANT *var)
 
virtual ~QtPropertyBag ()
 

Public Variables

QAxBase::PropertyBag map
 

Properties

LONG ref
 

Detailed Description

Definition at line 4232 of file qaxbase.cpp.

Constructors and Destructors

◆ QtPropertyBag()

QtPropertyBag::QtPropertyBag ( )
inline

Definition at line 4235 of file qaxbase.cpp.

4235 :ref(0) {}

◆ ~QtPropertyBag()

virtual QtPropertyBag::~QtPropertyBag ( )
inlinevirtual

Definition at line 4236 of file qaxbase.cpp.

4236 {}

Functions

◆ AddRef()

unsigned long __stdcall QtPropertyBag::AddRef ( )
inline

Definition at line 4251 of file qaxbase.cpp.

Referenced by QAxBase::propertyBag(), and QAxBase::setPropertyBag().

4252  {
4253  return InterlockedIncrement(&ref);
4254  }

◆ QueryInterface()

HRESULT __stdcall QtPropertyBag::QueryInterface ( REFIID  iid,
LPVOID *  iface 
)
inline

Definition at line 4238 of file qaxbase.cpp.

4239  {
4240  *iface = 0;
4241  if (iid == IID_IUnknown)
4242  *iface = this;
4243  else if (iid == IID_IPropertyBag)
4244  *iface = this;
4245  else
4246  return E_NOINTERFACE;
4247 
4248  AddRef();
4249  return S_OK;
4250  }
unsigned long __stdcall AddRef()
Definition: qaxbase.cpp:4251

◆ Read()

HRESULT __stdcall QtPropertyBag::Read ( LPCOLESTR  name,
VARIANT *  var,
IErrorLog *   
)
inline

Definition at line 4264 of file qaxbase.cpp.

4265  {
4266  if (!var)
4267  return E_POINTER;
4268 
4269  QString property = QString::fromWCharArray(name);
4270  QVariant qvar = map.value(property);
4271  QVariantToVARIANT(qvar, *var);
4272  return S_OK;
4273  }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
The QString class provides a Unicode character string.
Definition: qstring.h:83
const char * name
bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
Definition: qaxtypes.cpp:246
const char * property
Definition: qwizard.cpp:138

◆ Release()

unsigned long __stdcall QtPropertyBag::Release ( )
inline

Definition at line 4255 of file qaxbase.cpp.

Referenced by QAxBase::propertyBag(), and QAxBase::setPropertyBag().

4256  {
4257  LONG refCount = InterlockedDecrement(&ref);
4258  if (!refCount)
4259  delete this;
4260 
4261  return refCount;
4262  }

◆ Write()

HRESULT __stdcall QtPropertyBag::Write ( LPCOLESTR  name,
VARIANT *  var 
)
inline

Definition at line 4274 of file qaxbase.cpp.

4275  {
4276  if (!var)
4277  return E_POINTER;
4278  QString property = QString::fromWCharArray(name);
4279  QVariant qvar = VARIANTToQVariant(*var, 0);
4280  map[property] = qvar;
4281 
4282  return S_OK;
4283  }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
The QString class provides a Unicode character string.
Definition: qstring.h:83
const char * name
QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type)
Returns arg as a QVariant of type type.
Definition: qaxtypes.cpp:919
const char * property
Definition: qwizard.cpp:138

Properties

◆ map

QAxBase::PropertyBag QtPropertyBag::map

Definition at line 4285 of file qaxbase.cpp.

Referenced by QAxBase::propertyBag(), and QAxBase::setPropertyBag().

◆ ref

LONG QtPropertyBag::ref
private

Definition at line 4288 of file qaxbase.cpp.


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