IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAxBaseWidget Class

QAxBaseWidget provides static properties and signals for QAxWidget.

This class was introduced in Qt 6.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAxBaseWidget Class

  • Header: QAxBaseWidget

  • Since: Qt 6.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS AxContainer)

    target_link_libraries(mytarget PRIVATE Qt6::AxContainer)

  • qmake: QT += axcontainer

  • Inherits: QWidget and QAxObjectInterface

  • Inherited By: QAxWidget

Detailed Description

 

Property Documentation

 

classContext : const ulong

This property holds the context the ActiveX control will run in (default CLSCTX_SERVER).

The property affects the "dwClsContext" argument when calling CoCreateInstance. This can be used to control in-proc vs. out-of-proc startup for controls supporting both alternatives. Also, it can be used to modify/reduce control permissions when used with CLSCTX_ENABLE_CLOAKING and an impersonation token.

Note that it must be set before setControl() to have any effect.

See Also

See also control

control : const QString

This property holds the name of the COM object wrapped by this QAxBaseWidget object.

Setting this property initializes the COM object. Any COM object previously set is shut down.

The most efficient way to set this property is by using the registered component's UUID, e.g.

 
Sélectionnez
ctrl->setControl("{8E27C92B-1264-101C-8A2F-040224009C02}");

The second fastest way is to use the registered control's class name (with or without version number), e.g.

 
Sélectionnez
ctrl->setControl("MSCal.Calendar");

The slowest, but easiest way to use is to use the control's full name, e.g.

 
Sélectionnez
ctrl->setControl("Calendar Control 9.0");

It is also possible to initialize the object from a file, e.g.

 
Sélectionnez
ctrl->setControl("c:/files/file.doc");

If the component's UUID is used the following patterns can be used to initialize the control on a remote machine, to initialize a licensed control or to connect to a running object:

  • To initialize the control on a different machine use the following pattern:

     
    Sélectionnez
    <domain/username>:<password>@server/{8E27C92B-1264-101C-8A2F-040224009C02}
  • To initialize a licensed control use the following pattern:

     
    Sélectionnez
    {8E27C92B-1264-101C-8A2F-040224009C02}:<LicenseKey>
  • To connect to an already running object use the following pattern:

     
    Sélectionnez
    {8E27C92B-1264-101C-8A2F-040224009C02}&

The first two patterns can be combined, e.g. to initialize a licensed control on a remote machine:

 
Sélectionnez
ctrl->setControl("DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey");

The control's read function always returns the control's UUID, if provided including the license key, and the name of the server, but not including the username, the domain or the password.

See Also

See also classContext

Member Function Documentation

 

void QAxBaseWidget::exception(int code, const QString &source, const QString &desc, const QString &help)

This signal is emitted when the COM object throws an exception while called using the OLE automation interface IDispatch. code, source, desc and help provide information about the exception as provided by the COM server and can be used to provide useful feedback to the end user. help includes the help file, and the help context ID in brackets, e.g. "filename [id]".

See Also

void QAxBaseWidget::propertyChanged(const QString &name)

If the COM object supports property notification, this signal gets emitted when the property called name is changed.

See Also

void QAxBaseWidget::signal(const QString &name, int argc, void *argv)

This generic signal gets emitted when the COM object issues the event name. argc is the number of parameters provided by the event (DISPPARAMS.cArgs), and argv is the pointer to the parameter values (DISPPARAMS.rgvarg). Note that the order of parameter values is turned around, ie. the last element of the array is the first parameter in the function.

 
Sélectionnez
void Receiver::slot(const QString &name, int argc, void *argv)
{
    VARIANTARG *params = (VARIANTARG*)argv;
    if (name.startsWith("BeforeNavigate2(")) {
        IDispatch *pDisp = params[argc-1].pdispVal;
        VARIANTARG URL = *params[argc-2].pvarVal;
        VARIANTARG Flags = *params[argc-3].pvarVal;
        VARIANTARG TargetFrameName = *params[argc-4].pvarVal;
        VARIANTARG PostData = *params[argc-5].pvarVal;
        VARIANTARG Headers = *params[argc-6].pvarVal;
        bool *Cancel = params[argc-7].pboolVal;
    }
}

Use this signal if the event has parameters of unsupported data types. Otherwise, connect directly to the signal name.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+