VirtualBox

Changeset 16616 in vbox for trunk/src


Ignore:
Timestamp:
Feb 10, 2009 9:14:31 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: support for safe arrays of arbitrary types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/COMDefs.h

    r15051 r16616  
    220220    static void ToSafeArray (const QVector <QT> &aVec, com::SafeArray <CT> &aArr)
    221221    {
    222         Q_UNUSED (aVec);
    223         Q_UNUSED (aArr);
    224         AssertMsgFailedReturnVoid (("No conversion!\n"));
     222        aArr.reset (aVec.size());
     223        for (int i = 0; i < aVec.size(); ++i)
     224            aArr [i] = static_cast<CT> (aVec.at (i));
    225225    }
    226226
     
    228228    static void FromSafeArray (const com::SafeArray <CT> &aArr, QVector <QT> &aVec)
    229229    {
    230         Q_UNUSED (aArr);
    231         Q_UNUSED (aVec);
    232         AssertMsgFailedReturnVoid (("No conversion!\n"));
     230        aVec.resize (static_cast<int> (aArr.size()));
     231        for (int i = 0; i < aVec.size(); ++i)
     232            aVec [i] = static_cast<QT> (aArr [i]);
    233233    }
    234234
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette