summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cmake.conf5
-rw-r--r--.gitignore1
-rw-r--r--.prev_CMakeLists.txt20
-rw-r--r--.qmake.conf5
-rw-r--r--CMakeLists.txt39
-rw-r--r--LICENSES/BSD-3-Clause.txt9
-rw-r--r--LICENSES/GFDL-1.3-no-invariants-only.txt (renamed from LICENSE.FDL)23
-rw-r--r--LICENSES/GPL-3.0-only.txt (renamed from LICENSE.GPL3-EXCEPT)30
-rw-r--r--LICENSES/LicenseRef-Qt-Commercial.txt8
-rw-r--r--LICENSES/Qt-GPL-exception-1.0.txt22
-rw-r--r--coin/module_config.yaml56
-rw-r--r--dependencies.yaml2
-rw-r--r--dist/changes-5.15.120
-rw-r--r--examples/CMakeLists.txt5
-rw-r--r--examples/activeqt/CMakeLists.txt21
-rw-r--r--examples/activeqt/activeqt.pro10
-rw-r--r--examples/activeqt/comapp/CMakeLists.txt22
-rw-r--r--examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc51
-rw-r--r--examples/activeqt/comapp/doc/src/comapp.qdoc30
-rw-r--r--examples/activeqt/comapp/main.cpp54
-rw-r--r--examples/activeqt/dotnet/walkthrough/Form1.cs127
-rw-r--r--examples/activeqt/dotnet/walkthrough/Form1.resx131
-rw-r--r--examples/activeqt/dotnet/walkthrough/Form1.vb88
-rw-r--r--examples/activeqt/dotnet/walkthrough/csharp.csproj143
-rw-r--r--examples/activeqt/dotnet/walkthrough/vb.vbproj147
-rw-r--r--examples/activeqt/dotnet/wrapper/app.csproj93
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/lib.vcproj149
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/networker.cpp79
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/networker.h76
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/tools.cpp70
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/tools.h63
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/worker.cpp68
-rw-r--r--examples/activeqt/dotnet/wrapper/lib/worker.h78
-rw-r--r--examples/activeqt/dotnet/wrapper/main.cs40
-rw-r--r--examples/activeqt/dotnet/wrapper/wrapper.sln28
-rw-r--r--examples/activeqt/hierarchy/CMakeLists.txt38
-rw-r--r--examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc68
-rw-r--r--examples/activeqt/hierarchy/main.cpp59
-rw-r--r--examples/activeqt/hierarchy/objects.cpp117
-rw-r--r--examples/activeqt/hierarchy/objects.h109
-rw-r--r--examples/activeqt/mediaplayer/CMakeLists.txt39
-rw-r--r--examples/activeqt/mediaplayer/mediaaxwidget.h76
-rw-r--r--examples/activeqt/menus/CMakeLists.txt38
-rw-r--r--examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc56
-rw-r--r--examples/activeqt/menus/doc/src/menus.qdoc60
-rw-r--r--examples/activeqt/menus/main.cpp73
-rw-r--r--examples/activeqt/menus/menus.h88
-rw-r--r--examples/activeqt/multiple/CMakeLists.txt39
-rw-r--r--examples/activeqt/multiple/ax1.h97
-rw-r--r--examples/activeqt/multiple/ax2.h101
-rw-r--r--examples/activeqt/multiple/main.cpp62
-rw-r--r--examples/activeqt/opengl/CMakeLists.txt43
-rw-r--r--examples/activeqt/opengl/glbox.h100
-rw-r--r--examples/activeqt/opengl/globjwin.cpp119
-rw-r--r--examples/activeqt/opengl/globjwin.h71
-rw-r--r--examples/activeqt/opengl/main.cpp97
-rw-r--r--examples/activeqt/qutlook/CMakeLists.txt34
-rw-r--r--examples/activeqt/qutlook/addressview.cpp79
-rw-r--r--examples/activeqt/qutlook/addressview.h51
-rw-r--r--examples/activeqt/qutlook/doc/src/qutlook.qdoc30
-rw-r--r--examples/activeqt/qutlook/main.cpp51
-rw-r--r--examples/activeqt/simple/CMakeLists.txt23
-rw-r--r--examples/activeqt/simple/doc/src/simple.qdoc30
-rw-r--r--examples/activeqt/simple/main.cpp51
-rw-r--r--examples/activeqt/simpleqml/CMakeLists.txt54
-rw-r--r--examples/activeqt/simpleqml/main.cpp126
-rw-r--r--examples/activeqt/simpleqml/main.qml78
-rw-r--r--examples/activeqt/simpleqml/simpleqml.def6
-rw-r--r--examples/activeqt/simpleqml/simpleqml.icobin766 -> 0 bytes
-rw-r--r--examples/activeqt/simpleqml/simpleqml.pro15
-rw-r--r--examples/activeqt/simpleqml/simpleqml.qrc5
-rw-r--r--examples/activeqt/simpleqml/simpleqml.rc2
-rw-r--r--examples/activeqt/wrapper/CMakeLists.txt22
-rw-r--r--examples/activeqt/wrapper/doc/src/wrapper.qdoc30
-rw-r--r--examples/activeqt/wrapper/main.cpp51
-rw-r--r--qtactiveqt.pro9
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/activeqt/.prev_CMakeLists.txt22
-rw-r--r--src/activeqt/CMakeLists.txt43
-rw-r--r--src/activeqt/activeqt.pro14
-rw-r--r--src/activeqt/axbase/CMakeLists.txt11
-rw-r--r--src/activeqt/axbase/axbase.pro18
-rw-r--r--src/activeqt/axbase/qaxtypefunctions.cpp113
-rw-r--r--src/activeqt/axbase/qaxtypefunctions_p.h54
-rw-r--r--src/activeqt/axbase/qaxutils.cpp51
-rw-r--r--src/activeqt/axbase/qaxutils_p.h51
-rw-r--r--src/activeqt/container/CMakeLists.txt14
-rw-r--r--src/activeqt/container/Qt6AxContainerMacros.cmake106
-rw-r--r--src/activeqt/container/container.pro32
-rw-r--r--src/activeqt/container/qaxbase.cpp310
-rw-r--r--src/activeqt/container/qaxbase.h53
-rw-r--r--src/activeqt/container/qaxbase_p.h51
-rw-r--r--src/activeqt/container/qaxdump.cpp91
-rw-r--r--src/activeqt/container/qaxobject.cpp57
-rw-r--r--src/activeqt/container/qaxobject.h51
-rw-r--r--src/activeqt/container/qaxobject_p.h51
-rw-r--r--src/activeqt/container/qaxobjectinterface.h53
-rw-r--r--src/activeqt/container/qaxobjectinterface.qdoc51
-rw-r--r--src/activeqt/container/qaxscript.cpp155
-rw-r--r--src/activeqt/container/qaxscript.h58
-rw-r--r--src/activeqt/container/qaxscriptwrapper.cpp51
-rw-r--r--src/activeqt/container/qaxselect.cpp60
-rw-r--r--src/activeqt/container/qaxselect.h52
-rw-r--r--src/activeqt/container/qaxselect.ui54
-rw-r--r--src/activeqt/container/qaxwidget.cpp187
-rw-r--r--src/activeqt/container/qaxwidget.h51
-rw-r--r--src/activeqt/container/qaxwidget_p.h51
-rw-r--r--src/activeqt/control/CMakeLists.txt14
-rw-r--r--src/activeqt/control/Qt6AxServerMacros.cmake134
-rw-r--r--src/activeqt/control/control.pro32
-rw-r--r--src/activeqt/control/qaxaggregated.cpp51
-rw-r--r--src/activeqt/control/qaxaggregated.h51
-rw-r--r--src/activeqt/control/qaxbindable.cpp54
-rw-r--r--src/activeqt/control/qaxbindable.h51
-rw-r--r--src/activeqt/control/qaxfactory.cpp51
-rw-r--r--src/activeqt/control/qaxfactory.h59
-rw-r--r--src/activeqt/control/qaxmain.cpp51
-rw-r--r--src/activeqt/control/qaxserver.cpp76
-rw-r--r--src/activeqt/control/qaxserverbase.cpp407
-rw-r--r--src/activeqt/control/qaxserverdll.cpp55
-rw-r--r--src/activeqt/control/qaxservermain.cpp65
-rw-r--r--src/activeqt/control/qclassfactory_p.h51
-rw-r--r--src/activeqt/doc/ActiveQtDoc5
-rw-r--r--src/activeqt/doc/CMakeLists.txt6
-rw-r--r--src/activeqt/doc/activeqt.qdocconf6
-rw-r--r--src/activeqt/doc/snippets/doc_src_activeqt-dumpcpp.cpp51
-rw-r--r--src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc54
-rw-r--r--src/activeqt/doc/snippets/doc_src_qaxcontainer.pro51
-rw-r--r--src/activeqt/doc/snippets/doc_src_qaxserver.cpp51
-rw-r--r--src/activeqt/doc/snippets/doc_src_qaxserver.pro51
-rw-r--r--src/activeqt/doc/snippets/doc_src_qaxserver.qdoc51
-rw-r--r--src/activeqt/doc/snippets/qtactive-module-use.qdocinc23
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp51
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_container_qaxscript.cpp51
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_container_qaxselect.cpp51
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_control_qaxbindable.cpp51
-rw-r--r--src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp51
-rw-r--r--src/activeqt/doc/src/activeqt-dumpcpp.qdoc31
-rw-r--r--src/activeqt/doc/src/activeqt-dumpdoc.qdoc28
-rw-r--r--src/activeqt/doc/src/activeqt-index.qdoc161
-rw-r--r--src/activeqt/doc/src/examples/dotnet.qdoc334
-rw-r--r--src/activeqt/doc/src/qtaxcontainer.qdoc30
-rw-r--r--src/activeqt/doc/src/qtaxserver.qdoc54
-rw-r--r--src/activeqt/shared/qaxtypes.cpp411
-rw-r--r--src/activeqt/shared/qaxtypes_p.h57
-rw-r--r--src/src.pro4
-rw-r--r--src/tools/CMakeLists.txt3
-rw-r--r--src/tools/idc/CMakeLists.txt15
-rw-r--r--src/tools/idc/idc.pro6
-rw-r--r--src/tools/idc/main.cpp49
-rw-r--r--src/tools/tools.pro2
-rw-r--r--sync.profile10
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/auto/CMakeLists.txt8
-rw-r--r--tests/auto/auto.pro10
-rw-r--r--tests/auto/cmake/CMakeLists.txt44
-rw-r--r--tests/auto/cmake/cmake.pro5
-rw-r--r--tests/auto/cmake/test_modules/CMakeLists.txt7
-rw-r--r--tests/auto/cmake/test_modules/container/CMakeLists.txt24
-rw-r--r--tests/auto/cmake/test_modules/container/axcontainer.cpp29
-rw-r--r--tests/auto/cmake/test_modules/server/CMakeLists.txt24
-rw-r--r--tests/auto/cmake/test_modules/server/axserver.cpp29
-rw-r--r--tests/auto/cmake/test_target_typelibs/CMakeLists.txt12
-rw-r--r--tests/auto/cmake/test_target_typelibs/main.cpp11
-rw-r--r--tests/auto/cmake/test_target_typelibs_absolute/CMakeLists.txt12
-rw-r--r--tests/auto/cmake/test_target_typelibs_absolute/main.cpp11
-rw-r--r--tests/auto/cmake/test_target_typelibs_empty_libs/CMakeLists.txt12
-rw-r--r--tests/auto/cmake/test_target_typelibs_empty_libs/main.cpp11
-rw-r--r--tests/auto/cmake/test_target_typelibs_non_existing_libs/CMakeLists.txt12
-rw-r--r--tests/auto/cmake/test_target_typelibs_non_existing_libs/main.cpp11
-rw-r--r--tests/auto/cmake/test_target_typelibs_out_dir/CMakeLists.txt15
-rw-r--r--tests/auto/cmake/test_target_typelibs_out_dir/main.cpp11
-rw-r--r--tests/auto/conversion/CMakeLists.txt16
-rw-r--r--tests/auto/conversion/comutil_p.h304
-rw-r--r--tests/auto/conversion/conversion.pro3
-rw-r--r--tests/auto/conversion/testutil_p.h98
-rw-r--r--tests/auto/conversion/tst_conversion.cpp345
-rw-r--r--tests/auto/dumpcpp/CMakeLists.txt20
-rw-r--r--tests/auto/dumpcpp/dumpcpp.pro11
-rw-r--r--tests/auto/dumpcpp/tst_dumpcpp.cpp119
-rw-r--r--tests/auto/qaxobject/CMakeLists.txt15
-rw-r--r--tests/auto/qaxobject/qaxobject.pro3
-rw-r--r--tests/auto/qaxobject/tst_qaxobject.cpp29
-rw-r--r--tests/auto/qaxscript/CMakeLists.txt15
-rw-r--r--tests/auto/qaxscript/qaxscript.pro3
-rw-r--r--tests/auto/qaxscript/tst_qaxscript.cpp175
-rw-r--r--tests/auto/qaxscriptmanager/CMakeLists.txt19
-rw-r--r--tests/auto/qaxscriptmanager/tst_qaxscriptmanager.cpp188
-rw-r--r--tests/manual/CMakeLists.txt8
-rw-r--r--tests/manual/axviewer/.prev_CMakeLists.txt69
-rw-r--r--tests/manual/axviewer/CMakeLists.txt56
-rw-r--r--tests/manual/axviewer/axviewer.pro9
-rw-r--r--tests/manual/axviewer/main.cpp34
-rw-r--r--tests/manual/dumpcpp/CMakeLists.txt14
-rw-r--r--tests/manual/dumpcpp/dumpcpp.pro13
-rw-r--r--tests/manual/dumpcpp/main.cpp33
-rw-r--r--tests/manual/hierarchy/CMakeLists.txt24
-rw-r--r--tests/manual/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc44
-rw-r--r--tests/manual/hierarchy/doc/src/hierarchy.qdoc (renamed from examples/activeqt/hierarchy/doc/src/hierarchy.qdoc)29
-rw-r--r--tests/manual/hierarchy/hierarchy.def (renamed from examples/activeqt/hierarchy/hierarchy.def)0
-rw-r--r--tests/manual/hierarchy/hierarchy.ico (renamed from examples/activeqt/hierarchy/hierarchy.ico)bin766 -> 766 bytes
-rw-r--r--tests/manual/hierarchy/hierarchy.inf (renamed from examples/activeqt/hierarchy/hierarchy.inf)0
-rw-r--r--tests/manual/hierarchy/hierarchy.pro (renamed from examples/activeqt/hierarchy/hierarchy.pro)0
-rw-r--r--tests/manual/hierarchy/hierarchy.rc (renamed from examples/activeqt/hierarchy/hierarchy.rc)0
-rw-r--r--tests/manual/hierarchy/main.cpp12
-rw-r--r--tests/manual/hierarchy/objects.cpp70
-rw-r--r--tests/manual/hierarchy/objects.h62
-rw-r--r--tests/manual/manual.pro2
-rw-r--r--tests/manual/mediaplayer/CMakeLists.txt30
-rw-r--r--tests/manual/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg (renamed from examples/activeqt/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg)bin48753 -> 48753 bytes
-rw-r--r--tests/manual/mediaplayer/doc/src/mediaplayer.qdoc (renamed from examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc)29
-rw-r--r--tests/manual/mediaplayer/main.cpp (renamed from examples/activeqt/mediaplayer/main.cpp)52
-rw-r--r--tests/manual/mediaplayer/mainwindow.ui (renamed from examples/activeqt/mediaplayer/mainwindow.ui)0
-rw-r--r--tests/manual/mediaplayer/mediaaxwidget.h29
-rw-r--r--tests/manual/mediaplayer/mediaplayer.pro (renamed from examples/activeqt/mediaplayer/mediaplayer.pro)0
-rw-r--r--tests/manual/menus/CMakeLists.txt25
-rw-r--r--tests/manual/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc9
-rw-r--r--tests/manual/menus/doc/src/menus.qdoc37
-rw-r--r--tests/manual/menus/fileopen.xpm (renamed from examples/activeqt/menus/fileopen.xpm)0
-rw-r--r--tests/manual/menus/filesave.xpm (renamed from examples/activeqt/menus/filesave.xpm)0
-rw-r--r--tests/manual/menus/main.cpp26
-rw-r--r--tests/manual/menus/menus.cpp (renamed from examples/activeqt/menus/menus.cpp)51
-rw-r--r--tests/manual/menus/menus.def (renamed from examples/activeqt/menus/menus.def)0
-rw-r--r--tests/manual/menus/menus.h41
-rw-r--r--tests/manual/menus/menus.ico (renamed from examples/activeqt/menus/menus.ico)bin766 -> 766 bytes
-rw-r--r--tests/manual/menus/menus.inf (renamed from examples/activeqt/menus/menus.inf)0
-rw-r--r--tests/manual/menus/menus.pro (renamed from examples/activeqt/menus/menus.pro)0
-rw-r--r--tests/manual/menus/menus.rc (renamed from examples/activeqt/menus/menus.rc)0
-rw-r--r--tests/manual/multiple/CMakeLists.txt25
-rw-r--r--tests/manual/multiple/ax1.h50
-rw-r--r--tests/manual/multiple/ax2.h54
-rw-r--r--tests/manual/multiple/doc/src/multiple.qdoc (renamed from examples/activeqt/multiple/doc/src/multiple.qdoc)29
-rw-r--r--tests/manual/multiple/main.cpp15
-rw-r--r--tests/manual/multiple/multiple.inf (renamed from examples/activeqt/multiple/multiple.inf)0
-rw-r--r--tests/manual/multiple/multiple.pro (renamed from examples/activeqt/multiple/multiple.pro)0
-rw-r--r--tests/manual/multiple/multipleax.def (renamed from examples/activeqt/multiple/multipleax.def)0
-rw-r--r--tests/manual/multiple/multipleax.ico (renamed from examples/activeqt/multiple/multipleax.ico)bin766 -> 766 bytes
-rw-r--r--tests/manual/multiple/multipleax.rc (renamed from examples/activeqt/multiple/multipleax.rc)0
-rw-r--r--tests/manual/opengl/CMakeLists.txt27
-rw-r--r--tests/manual/opengl/doc/src/opengl.qdoc (renamed from examples/activeqt/opengl/doc/src/opengl.qdoc)29
-rw-r--r--tests/manual/opengl/glbox.cpp (renamed from examples/activeqt/opengl/glbox.cpp)51
-rw-r--r--tests/manual/opengl/glbox.h53
-rw-r--r--tests/manual/opengl/globjwin.cpp72
-rw-r--r--tests/manual/opengl/globjwin.h24
-rw-r--r--tests/manual/opengl/main.cpp49
-rw-r--r--tests/manual/opengl/opengl.def (renamed from examples/activeqt/opengl/opengl.def)0
-rw-r--r--tests/manual/opengl/opengl.ico (renamed from examples/activeqt/opengl/opengl.ico)bin766 -> 766 bytes
-rw-r--r--tests/manual/opengl/opengl.inf (renamed from examples/activeqt/opengl/opengl.inf)0
-rw-r--r--tests/manual/opengl/opengl.pro (renamed from examples/activeqt/opengl/opengl.pro)0
-rw-r--r--tests/manual/opengl/opengl.rc (renamed from examples/activeqt/opengl/opengl.rc)0
-rw-r--r--tests/manual/shared/metaobjectdump.cpp29
-rw-r--r--tests/manual/shared/metaobjectdump.h29
-rw-r--r--tests/manual/shared/shared.pri3
-rw-r--r--tests/manual/shared/textdialog.cpp29
-rw-r--r--tests/manual/shared/textdialog.h29
-rw-r--r--tests/manual/testcontrol/CMakeLists.txt15
-rw-r--r--tests/manual/testcontrol/main.cpp29
-rw-r--r--tests/manual/testcontrol/testcontrol.pro6
-rw-r--r--tests/tests.pro2
-rw-r--r--tools/CMakeLists.txt4
-rw-r--r--tools/dumpcpp/CMakeLists.txt15
-rw-r--r--tools/dumpcpp/dumpcpp.pro8
-rw-r--r--tools/dumpcpp/main.cpp266
-rw-r--r--tools/dumpcpp/moc.cpp40
-rw-r--r--tools/dumpcpp/moc.h31
-rw-r--r--tools/dumpdoc/CMakeLists.txt15
-rw-r--r--tools/dumpdoc/dumpdoc.pro6
-rw-r--r--tools/dumpdoc/main.cpp29
-rw-r--r--tools/testcon/CMakeLists.txt24
-rw-r--r--tools/testcon/ambientproperties.cpp29
-rw-r--r--tools/testcon/ambientproperties.h29
-rw-r--r--tools/testcon/ambientproperties.ui32
-rw-r--r--tools/testcon/changeproperties.cpp62
-rw-r--r--tools/testcon/changeproperties.h29
-rw-r--r--tools/testcon/changeproperties.ui32
-rw-r--r--tools/testcon/controlinfo.cpp29
-rw-r--r--tools/testcon/controlinfo.h29
-rw-r--r--tools/testcon/controlinfo.ui32
-rw-r--r--tools/testcon/docuwindow.cpp29
-rw-r--r--tools/testcon/docuwindow.h29
-rw-r--r--tools/testcon/invokemethod.cpp31
-rw-r--r--tools/testcon/invokemethod.h29
-rw-r--r--tools/testcon/invokemethod.ui32
-rw-r--r--tools/testcon/main.cpp34
-rw-r--r--tools/testcon/mainwindow.cpp104
-rw-r--r--tools/testcon/mainwindow.h29
-rw-r--r--tools/testcon/mainwindow.ui33
-rw-r--r--tools/testcon/sandboxing.cpp204
-rw-r--r--tools/testcon/sandboxing.h20
-rw-r--r--tools/testcon/scripts/hierarchyax.vbs29
-rw-r--r--tools/testcon/scripts/perlscript.pl29
-rw-r--r--tools/testcon/scripts/pythonscript.py29
-rw-r--r--tools/testcon/testcon.pro15
-rw-r--r--tools/testcon/testcon.qrc7
-rw-r--r--tools/tools.pro11
295 files changed, 4281 insertions, 9405 deletions
diff --git a/.cmake.conf b/.cmake.conf
index 9305480..62cb061 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1 +1,4 @@
-set(QT_REPO_MODULE_VERSION "6.0.0")
+set(QT_REPO_MODULE_VERSION "6.8.0")
+set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
+set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
+list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
diff --git a/.gitignore b/.gitignore
index f932ee2..393811e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ ui_*.h
tools/testcon/testcon.tlb
qrc_*.cpp
*_wrapper.bat
+CMakeUserPresets.json
# Test generated files
QObject.log
diff --git a/.prev_CMakeLists.txt b/.prev_CMakeLists.txt
deleted file mode 100644
index 06e2911..0000000
--- a/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated from qtactiveqt.pro.
-
-cmake_minimum_required(VERSION 3.15.0)
-
-include(.cmake.conf)
-project(activeqt_FIXME
- VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "Qt activeqt_FIXME Libraries"
- HOMEPAGE_URL "https://qt.io/"
- LANGUAGES CXX C
-)
-
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core SET_ME_TO_SOMETHING_USEFUL)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS SET_ME_TO_SOMETHING_USEFUL)
-
-if(NOT TARGET Qt::Widgets)
- message(NOTICE "Skipping the build as the condition \"TARGET Qt::Widgets\" is not met.")
- return()
-endif()
-qt_build_repo()
diff --git a/.qmake.conf b/.qmake.conf
deleted file mode 100644
index 3066cd8..0000000
--- a/.qmake.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-load(qt_build_config)
-
-DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS
-
-MODULE_VERSION = 6.0.0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14352ff..bfddcf2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,20 +1,43 @@
-# Generated from qtactiveqt.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.15.0)
+cmake_minimum_required(VERSION 3.16)
include(".cmake.conf")
-project(QtActiveQt # special case
+project(QtActiveQt
VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "Qt Active Qt Libraries" # special case
+ DESCRIPTION "Qt Active Qt Libraries"
HOMEPAGE_URL "https://qt.io/"
LANGUAGES CXX C
)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Gui Widgets PrintSupport) # special case
-find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Qml Quick) # special case
+if (NOT WIN32)
+ message(NOTICE "Condition \"WIN32\" is not met, enabling documentation build only.")
+ # special case begin
+ set(QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS TRUE)
+ find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
+ qt_internal_project_setup()
-if(NOT TARGET Qt::Widgets)
- message(NOTICE "Skipping the build as the condition \"TARGET Qt::Widgets\" is not met.")
+ qt_build_repo_begin()
+ add_subdirectory(src/activeqt/doc)
+ qt_build_repo_end()
+ # special case end
return()
endif()
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Qml Quick Gui Widgets
+ PrintSupport OpenGL OpenGLWidgets
+)
+qt_internal_project_setup()
+
+if(NOT TARGET Qt::Gui OR NOT TARGET Qt::Widgets OR NOT TARGET Qt::PrintSupport)
+ message(NOTICE "Skipping the build as the condition \"TARGET Qt::Gui\", \"TARGET Qt::Widget\" "
+ "or \"TARGET Qt::Printsupport\" is not met.")
+ return()
+endif()
+
+include("${CMAKE_CURRENT_SOURCE_DIR}/src/activeqt/container/Qt6AxContainerMacros.cmake")
+include("${CMAKE_CURRENT_SOURCE_DIR}/src/activeqt/control/Qt6AxServerMacros.cmake")
+
qt_build_repo()
diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt
new file mode 100644
index 0000000..b91bbd8
--- /dev/null
+++ b/LICENSES/BSD-3-Clause.txt
@@ -0,0 +1,9 @@
+Copyright (c) <year> <owner>.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSE.FDL b/LICENSES/GFDL-1.3-no-invariants-only.txt
index 938bb8d..857214d 100644
--- a/LICENSE.FDL
+++ b/LICENSES/GFDL-1.3-no-invariants-only.txt
@@ -1,9 +1,10 @@
+
GNU Free Documentation License
Version 1.3, 3 November 2008
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
- <http://fsf.org/>
+ <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -376,7 +377,7 @@ The Free Software Foundation may publish new, revised versions of the
GNU Free Documentation License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
+https://www.gnu.org/licenses/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@@ -400,19 +401,19 @@ public wiki that anybody can edit is an example of such a server. A
"Massive Multiauthor Collaboration" (or "MMC") contained in the site
means any set of copyrightable works thus published on the MMC site.
-"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
published by that same organization.
-"Incorporate" means to publish or republish a Document, in whole or in
+"Incorporate" means to publish or republish a Document, in whole or in
part, as part of another Document.
-An MMC is "eligible for relicensing" if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole or
-in part into the MMC, (1) had no cover texts or invariant sections, and
+An MMC is "eligible for relicensing" if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole or
+in part into the MMC, (1) had no cover texts or invariant sections, and
(2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
diff --git a/LICENSE.GPL3-EXCEPT b/LICENSES/GPL-3.0-only.txt
index b1cb1be..94a9ed0 100644
--- a/LICENSE.GPL3-EXCEPT
+++ b/LICENSES/GPL-3.0-only.txt
@@ -1,33 +1,3 @@
-This is the GNU General Public License version 3, annotated with The
-Qt Company GPL Exception 1.0:
-
--------------------------------------------------------------------------
-
-The Qt Company GPL Exception 1.0
-
-Exception 1:
-
-As a special exception you may create a larger work which contains the
-output of this application and distribute that work under terms of your
-choice, so long as the work is not otherwise derived from or based on
-this application and so long as the work does not in itself generate
-output that contains the output from this application in its original
-or modified form.
-
-Exception 2:
-
-As a special exception, you have permission to combine this application
-with Plugins licensed under the terms of your choice, to produce an
-executable, and to copy and distribute the resulting executable under
-the terms of your choice. However, the executable must be accompanied
-by a prominent notice offering all users of the executable the entire
-source code to this application, excluding the source code of the
-independent modules, but including any changes you have made to this
-application, under the terms of this license.
-
-
--------------------------------------------------------------------------
-
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
diff --git a/LICENSES/LicenseRef-Qt-Commercial.txt b/LICENSES/LicenseRef-Qt-Commercial.txt
new file mode 100644
index 0000000..825b1f3
--- /dev/null
+++ b/LICENSES/LicenseRef-Qt-Commercial.txt
@@ -0,0 +1,8 @@
+Licensees holding valid commercial Qt licenses may use this software in
+accordance with the the terms contained in a written agreement between
+you and The Qt Company. Alternatively, the terms and conditions that were
+accepted by the licensee when buying and/or downloading the
+software do apply.
+
+For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions.
+For further information use the contact form at https://www.qt.io/contact-us.
diff --git a/LICENSES/Qt-GPL-exception-1.0.txt b/LICENSES/Qt-GPL-exception-1.0.txt
new file mode 100644
index 0000000..d0322bf
--- /dev/null
+++ b/LICENSES/Qt-GPL-exception-1.0.txt
@@ -0,0 +1,22 @@
+The Qt Company GPL Exception 1.0
+
+Exception 1:
+
+As a special exception you may create a larger work which contains the
+output of this application and distribute that work under terms of your
+choice, so long as the work is not otherwise derived from or based on
+this application and so long as the work does not in itself generate
+output that contains the output from this application in its original
+or modified form.
+
+Exception 2:
+
+As a special exception, you have permission to combine this application
+with Plugins licensed under the terms of your choice, to produce an
+executable, and to copy and distribute the resulting executable under
+the terms of your choice. However, the executable must be accompanied
+by a prominent notice offering all users of the executable the entire
+source code to this application, excluding the source code of the
+independent modules, but including any changes you have made to this
+application, under the terms of this license.
+
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
new file mode 100644
index 0000000..fa0affc
--- /dev/null
+++ b/coin/module_config.yaml
@@ -0,0 +1,56 @@
+version: 2
+accept_configuration:
+ condition: or
+ conditions:
+ # Include all windows targets
+ - condition: property
+ property: target.os
+ equals_value: "Windows"
+
+instructions:
+ Build:
+ - type: EnvironmentVariable
+ variableName: QT_CI_SKIP_MODULE_BUILD
+ variableValue: "1"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: Documentation
+ - type: AppendToEnvironmentVariable
+ variableName: NON_QTBASE_CONFIGURE_ARGS
+ variableValue: " -DQT_NO_AX_SERVER_REGISTRATION=ON"
+ disable_if:
+ condition: property
+ property: features
+ contains_value: UseConfigure
+ - type: AppendToEnvironmentVariable
+ variableName: NON_QTBASE_TARGET_CONFIGURE_ARGS
+ variableValue: " -DQT_NO_AX_SERVER_REGISTRATION=ON"
+ disable_if:
+ condition: property
+ property: features
+ contains_value: UseConfigure
+ - type: AppendToEnvironmentVariable
+ variableName: NON_QTBASE_CMAKE_ARGS
+ variableValue: " -DQT_NO_AX_SERVER_REGISTRATION=ON"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: UseConfigure
+ - type: AppendToEnvironmentVariable
+ variableName: NON_QTBASE_TARGET_CMAKE_ARGS
+ variableValue: " -DQT_NO_AX_SERVER_REGISTRATION=ON"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: UseConfigure
+ - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
+
+ Test:
+ - type: Group
+ instructions:
+ - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
+ disable_if:
+ condition: property
+ property: features
+ contains_value: Documentation
diff --git a/dependencies.yaml b/dependencies.yaml
index 27b9ae8..06312fa 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,4 +1,4 @@
dependencies:
../qtbase:
- ref: d0689ec867244a25635fb9504f2e6ff6e5c4a77b
+ ref: e7362764d4931f255d2377462df8ac7a0d4e7c84
required: true
diff --git a/dist/changes-5.15.1 b/dist/changes-5.15.1
new file mode 100644
index 0000000..332ee9d
--- /dev/null
+++ b/dist/changes-5.15.1
@@ -0,0 +1,20 @@
+Qt 5.15.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.15.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+ - This release contains only minor code improvements.
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 362d2da..aea2e67 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,6 +1,7 @@
-# Generated from examples.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-qt_examples_build_begin()
+qt_examples_build_begin(EXTERNAL_BUILD)
add_subdirectory(activeqt)
diff --git a/examples/activeqt/CMakeLists.txt b/examples/activeqt/CMakeLists.txt
index c71db69..c95e04e 100644
--- a/examples/activeqt/CMakeLists.txt
+++ b/examples/activeqt/CMakeLists.txt
@@ -1,17 +1,8 @@
-# Generated from activeqt.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-add_subdirectory(comapp)
-add_subdirectory(hierarchy)
-add_subdirectory(menus)
-add_subdirectory(multiple)
-add_subdirectory(simple)
-add_subdirectory(wrapper)
-if(MINGW OR QT_BUILD_SHARED_LIBS)
- add_subdirectory(mediaplayer)
-endif()
-if(TARGET Qt6::OpenGLWidgets AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2) # special case
- add_subdirectory(opengl)
-endif()
-if(TARGET Qt::QuickControls2)
- add_subdirectory(simpleqml)
+if(MSVC)
+ qt_internal_add_example(comapp)
+ qt_internal_add_example(simple)
+ qt_internal_add_example(wrapper)
endif()
diff --git a/examples/activeqt/activeqt.pro b/examples/activeqt/activeqt.pro
index 6f189bc..3628f1c 100644
--- a/examples/activeqt/activeqt.pro
+++ b/examples/activeqt/activeqt.pro
@@ -1,14 +1,4 @@
TEMPLATE = subdirs
SUBDIRS += comapp \
- hierarchy \
- menus \
- multiple \
simple \
wrapper
-
-contains(QT_CONFIG, shared):SUBDIRS += mediaplayer
-contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2): SUBDIRS += opengl
-qtHaveModule(quickcontrols2):SUBDIRS += simpleqml
-
-# Other examples need an IDL compiler
-mingw:SUBDIRS = mediaplayer
diff --git a/examples/activeqt/comapp/CMakeLists.txt b/examples/activeqt/comapp/CMakeLists.txt
index d2100be..5ae396c 100644
--- a/examples/activeqt/comapp/CMakeLists.txt
+++ b/examples/activeqt/comapp/CMakeLists.txt
@@ -1,30 +1,24 @@
-# Generated from comapp.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.16)
project(comapp LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/comapp")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS AxServer)
-find_package(Qt6 COMPONENTS Widgets)
-
-add_qt_gui_executable(comapp
+find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets)
+qt6_add_axserver_executable(comapp
main.cpp
+ comapp.rc
)
+
target_link_libraries(comapp PUBLIC
- Qt::AxServer
Qt::Core
Qt::Gui
Qt::Widgets
diff --git a/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc b/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc
index 3ded4a1..69a90cf 100644
--- a/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc
+++ b/examples/activeqt/comapp/doc/snippets/doc_src_examples_activeqt_comapp.qdoc
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
Private Application As comappLib.Application
diff --git a/examples/activeqt/comapp/doc/src/comapp.qdoc b/examples/activeqt/comapp/doc/src/comapp.qdoc
index 6deccf9..92d65d0 100644
--- a/examples/activeqt/comapp/doc/src/comapp.qdoc
+++ b/examples/activeqt/comapp/doc/src/comapp.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example activeqt/comapp
\title COM App Example (ActiveQt)
+ \examplecategory {Desktop}
+ \ingroup activeqt-examples
\brief The COM App example shows how to use ActiveQt to develop a Qt
application that can be automated via COM. Different QObject
diff --git a/examples/activeqt/comapp/main.cpp b/examples/activeqt/comapp/main.cpp
index 8cc34bf..b87ec34 100644
--- a/examples/activeqt/comapp/main.cpp
+++ b/examples/activeqt/comapp/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QApplication>
#include <QAxFactory>
@@ -188,7 +141,7 @@ Application *DocumentList::application() const
int DocumentList::count() const
{
- return m_list.count();
+ return m_list.size();
}
Document *DocumentList::item(int index) const
@@ -248,7 +201,6 @@ QAXFACTORY_END()
//! [6] //! [7]
int main(int argc, char *argv[])
{
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);
diff --git a/examples/activeqt/dotnet/walkthrough/Form1.cs b/examples/activeqt/dotnet/walkthrough/Form1.cs
deleted file mode 100644
index 9fb572a..0000000
--- a/examples/activeqt/dotnet/walkthrough/Form1.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Data;
-
-namespace csharp
-{
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- public class Form1 : System.Windows.Forms.Form
- {
- private AxwrapperaxLib.AxQPushButton resetButton;
- private AxmultipleaxLib.AxQAxWidget2 circleWidget;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public Form1()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
- this.resetButton = new AxwrapperaxLib.AxQPushButton();
- this.circleWidget = new AxmultipleaxLib.AxQAxWidget2();
- ((System.ComponentModel.ISupportInitialize)(this.resetButton)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).BeginInit();
- this.SuspendLayout();
- //
- // resetButton
- //
- this.resetButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.resetButton.Enabled = true;
- this.resetButton.Location = new System.Drawing.Point(160, 296);
- this.resetButton.Name = "resetButton";
- this.resetButton.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("resetButton.OcxState")));
- this.resetButton.Size = new System.Drawing.Size(168, 32);
- this.resetButton.TabIndex = 1;
- this.resetButton.clicked += new System.EventHandler(this.resetLineWidth);
- //
- // circleWidget
- //
- this.circleWidget.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.circleWidget.Enabled = true;
- this.circleWidget.Location = new System.Drawing.Point(8, 8);
- this.circleWidget.Name = "circleWidget";
- this.circleWidget.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("circleWidget.OcxState")));
- this.circleWidget.Size = new System.Drawing.Size(320, 264);
- this.circleWidget.TabIndex = 2;
- this.circleWidget.ClickEvent += new System.EventHandler(this.circleClicked);
- //
- // Form1
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(336, 333);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.circleWidget,
- this.resetButton});
- this.Name = "Form1";
- this.Text = "Form1";
- ((System.ComponentModel.ISupportInitialize)(this.resetButton)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).EndInit();
- this.ResumeLayout(false);
-
- }
- #endregion
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.Run(new Form1());
- }
-
-//! [0]
- private void circleClicked(object sender, System.EventArgs e)
- {
- this.circleWidget.lineWidth++;
- }
-//! [0]
-
-//! [1]
- private void resetLineWidth(object sender, System.EventArgs e)
- {
- this.circleWidget.lineWidth = 1;
- this.resetButton.setFocus();
- }
-//! [1]
- }
-}
diff --git a/examples/activeqt/dotnet/walkthrough/Form1.resx b/examples/activeqt/dotnet/walkthrough/Form1.resx
deleted file mode 100644
index 6353f82..0000000
--- a/examples/activeqt/dotnet/walkthrough/Form1.resx
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 1.3
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">1.3</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1">this is my long string</data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- [base64 mime encoded serialized .NET Framework object]
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- [base64 mime encoded string representing a byte array form of the .NET Framework object]
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>1.3</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="resetButton.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>
- AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw
- MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFT
- eXN0ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAGwMA
- AAIBAAAAAQAAAAAAAAAAAAAAAAYDAAAAAAAFAAAACGVuYWJsZWQAAAAAEgEAAAACeAAAAAAQAAAAAAAA
- AAJ5AAAAABAAAAAAAAAABndpZHRoAAAAABAAAACoAAAAB2hlaWdodAAAAAAQAAAAGgAAAA1taW5pbXVt
- V2lkdGgAAAAAEAAAAAAAAAAObWluaW11bUhlaWdodAAAAAAQAAAAAAAAAA1tYXhpbXVtV2lkdGgAAAAA
- EAAAf/8AAAAObWF4aW11bUhlaWdodAAAAAAQAAB//wAAAA9iYWNrZ3JvdW5kTW9kZQAAAAAQAAAABAAA
- ABdwYWxldHRlRm9yZWdyb3VuZENvbG9yAAAAAAr/AAAAAAAAF3BhbGV0dGVCYWNrZ3JvdW5kQ29sb3IA
- AAAACv/U0MgAAAARYmFja2dyb3VuZE9yaWdpbgAAAAAQAAAAAAAAAAVmb250AAAAAAUAAAAYAE0AUwAg
- AFMAaABlAGwAbAAgAEQAbABnAFP//wUBADIAAAAACGNhcHRpb24AAAAAA/////8AAAAJaWNvblRleHQA
- AAAAA/////8AAAAObW91c2VUcmFja2luZwAAAAASAAAAAAxmb2N1c1BvbGljeQAAAAAQAAAAAQAAAA91
- cGRhdGVzRW5hYmxlZAAAAAASAQAAAAptYXhpbWl6ZWQAAAAAEgAAAAALZnVsbFNjcmVlbgAAAAASAAAA
- AAxhY2NlcHREcm9wcwAAAAASAAAAABNpbnB1dE1ldGhvZEVuYWJsZWQAAAAAEgAAAAAFdGV4dAAAAAAD
- AAAADAAmAFIAZQBzAGUAdAAAAAt0b2dnbGVUeXBlAAAAABAAAAAAAAAABWRvd24AAAAAEgAAAAAMdG9n
- Z2xlU3RhdGUAAAAAEAAAAAAAAAALYXV0b1Jlc2l6ZQAAAAASAAAAAAthdXRvUmVwZWF0AAAAABIAAAAA
- EGV4Y2x1c2l2ZVRvZ2dsZQAAAAASAAAAAAxhdXRvRGVmYXVsdAAAAAASAQAAAAttZW51QnV0dG9uAAAA
- ABIAAAAABWZsYXQAAAAAEgAL
-</value>
- </data>
- <data name="circleWidget.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>
- AAEAAAD/////AQAAAAAAAAAMAgAAAFpTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0xLjAuMzMw
- MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFT
- eXN0ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAALwAA
- AAIBAAAAAQAAAAAAAAAAAAAAABoAAAAAAAAFAAAACmxpbmVXaWR0aAAAAAAQAAAAAAs=
-</value>
- </data>
- <data name="$this.Name">
- <value>Form1</value>
- </data>
-</root> \ No newline at end of file
diff --git a/examples/activeqt/dotnet/walkthrough/Form1.vb b/examples/activeqt/dotnet/walkthrough/Form1.vb
deleted file mode 100644
index f5f241b..0000000
--- a/examples/activeqt/dotnet/walkthrough/Form1.vb
+++ /dev/null
@@ -1,88 +0,0 @@
-Public Class Form1
- Inherits System.Windows.Forms.Form
-
-#Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
-
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- Friend WithEvents circleWidget As AxmultipleaxLib.AxQAxWidget2
- Friend WithEvents resetButton As AxwrapperaxLib.AxQPushButton
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
- Me.circleWidget = New AxmultipleaxLib.AxQAxWidget2()
- Me.resetButton = New AxwrapperaxLib.AxQPushButton()
- CType(Me.circleWidget, System.ComponentModel.ISupportInitialize).BeginInit()
- CType(Me.resetButton, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'circleWidget
- '
- Me.circleWidget.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
- Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right)
- Me.circleWidget.Enabled = True
- Me.circleWidget.Location = New System.Drawing.Point(8, 8)
- Me.circleWidget.Name = "circleWidget"
- Me.circleWidget.OcxState = CType(resources.GetObject("circleWidget.OcxState"), System.Windows.Forms.AxHost.State)
- Me.circleWidget.Size = New System.Drawing.Size(280, 216)
- Me.circleWidget.TabIndex = 0
- '
- 'resetButton
- '
- Me.resetButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
- ' VB is case insensitive, but our C++ controls are not.
- ' Me.resetButton.enabled = True
- Me.resetButton.Location = New System.Drawing.Point(184, 240)
- Me.resetButton.Name = "resetButton"
- Me.resetButton.OcxState = CType(resources.GetObject("resetButton.OcxState"), System.Windows.Forms.AxHost.State)
- Me.resetButton.Size = New System.Drawing.Size(104, 24)
- Me.resetButton.TabIndex = 1
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
- Me.ClientSize = New System.Drawing.Size(292, 273)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.resetButton, Me.circleWidget})
- Me.Name = "Form1"
- Me.Text = "Form1"
- CType(Me.circleWidget, System.ComponentModel.ISupportInitialize).EndInit()
- CType(Me.resetButton, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
-
- End Sub
-
-#End Region
-
- Private Sub circleWidget_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles circleWidget.ClickEvent
- Me.circleWidget.lineWidth = Me.circleWidget.lineWidth + 1
- End Sub
-
- Private Sub resetButton_clicked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles resetButton.clicked
- Me.circleWidget.lineWidth = 1
- Me.resetButton.setFocus()
- End Sub
-End Class
diff --git a/examples/activeqt/dotnet/walkthrough/csharp.csproj b/examples/activeqt/dotnet/walkthrough/csharp.csproj
deleted file mode 100644
index 4c5502b..0000000
--- a/examples/activeqt/dotnet/walkthrough/csharp.csproj
+++ /dev/null
@@ -1,143 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{F15600FD-7677-4C01-B98A-6776CE500617}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "csharp"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "WinExe"
- RootNamespace = "csharp"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll"
- />
- <Reference
- Name = "System.Windows.Forms"
- AssemblyName = "System.Windows.Forms"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- <Reference
- Name = "stdole"
- Guid = "{00020430-0000-0000-C000-000000000046}"
- VersionMajor = "2"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "primary"
- />
- <Reference
- Name = "wrapperaxLib"
- Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "tlbimp"
- />
- <Reference
- Name = "AxwrapperaxLib"
- Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "aximp"
- />
- <Reference
- Name = "multipleaxLib"
- Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "tlbimp"
- />
- <Reference
- Name = "AxmultipleaxLib"
- Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "aximp"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "Form1.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "Form1.resx"
- DependentUpon = "Form1.cs"
- BuildAction = "EmbeddedResource"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/examples/activeqt/dotnet/walkthrough/vb.vbproj b/examples/activeqt/dotnet/walkthrough/vb.vbproj
deleted file mode 100644
index eb0a9d6..0000000
--- a/examples/activeqt/dotnet/walkthrough/vb.vbproj
+++ /dev/null
@@ -1,147 +0,0 @@
-<VisualStudioProject>
- <VisualBasic
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{BFF242A6-967C-4F73-BEBE-DED2D9C395C6}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "vb"
- AssemblyOriginatorKeyFile = ""
- AssemblyOriginatorKeyMode = "None"
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "WinExe"
- OptionCompare = "Binary"
- OptionExplicit = "On"
- OptionStrict = "Off"
- RootNamespace = "vb"
- StartupObject = "vb.Form1"
- >
- <Config
- Name = "Debug"
- BaseAddress = "285212672"
- ConfigurationOverrideFile = ""
- DefineConstants = ""
- DefineDebug = "true"
- DefineTrace = "true"
- DebugSymbols = "true"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Release"
- BaseAddress = "285212672"
- ConfigurationOverrideFile = ""
- DefineConstants = ""
- DefineDebug = "false"
- DefineTrace = "true"
- DebugSymbols = "false"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- />
- <Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- />
- <Reference
- Name = "System.Windows.Forms"
- AssemblyName = "System.Windows.Forms"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- />
- <Reference
- Name = "stdole"
- Guid = "{00020430-0000-0000-C000-000000000046}"
- VersionMajor = "2"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "primary"
- />
- <Reference
- Name = "wrapperaxLib"
- Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "tlbimp"
- />
- <Reference
- Name = "multipleaxLib"
- Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "tlbimp"
- />
- <Reference
- Name = "AxwrapperaxLib"
- Guid = "{3B756301-0075-4E40-8BE8-5A81DE2426B7}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "aximp"
- />
- <Reference
- Name = "AxmultipleaxLib"
- Guid = "{05828915-AD1C-47AB-AB96-D6AD1E25F0E2}"
- VersionMajor = "1"
- VersionMinor = "0"
- Lcid = "0"
- WrapperTool = "aximp"
- />
- </References>
- <Imports>
- <Import Namespace = "Microsoft.VisualBasic" />
- <Import Namespace = "System" />
- <Import Namespace = "System.Collections" />
- <Import Namespace = "System.Data" />
- <Import Namespace = "System.Drawing" />
- <Import Namespace = "System.Diagnostics" />
- <Import Namespace = "System.Windows.Forms" />
- </Imports>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "Form1.vb"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "Form1.resx"
- DependentUpon = "Form1.vb"
- BuildAction = "EmbeddedResource"
- />
- </Include>
- </Files>
- </VisualBasic>
-</VisualStudioProject>
-
diff --git a/examples/activeqt/dotnet/wrapper/app.csproj b/examples/activeqt/dotnet/wrapper/app.csproj
deleted file mode 100644
index dce4bf0..0000000
--- a/examples/activeqt/dotnet/wrapper/app.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{334C8F04-E034-4082-9380-43906DDE71AB}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "wrapper"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Exe"
- RootNamespace = "wrapper"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "D:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- <Reference
- Name = "lib"
- AssemblyName = "lib"
- HintPath = "lib\lib.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "main.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/examples/activeqt/dotnet/wrapper/lib/lib.vcproj b/examples/activeqt/dotnet/wrapper/lib/lib.vcproj
deleted file mode 100644
index f49c35d..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/lib.vcproj
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="lib"
- ProjectGUID="{2E94A303-45A2-47AC-B87A-7C3519E9D6D8}"
- Keyword="ManagedCProj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="2"
- CharacterSet="2"
- ManagedExtensions="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtCore&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG"
- IgnoreStandardIncludePath="FALSE"
- MinimalRebuild="FALSE"
- BasicRuntimeChecks="0"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="QtCored4.lib"
- OutputFile="lib.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories="$(QTDIR)/lib"
- GenerateDebugInformation="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="2"
- CharacterSet="2"
- ManagedExtensions="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtCore&quot;"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG"
- MinimalRebuild="FALSE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="QtCore4.lib"
- OutputFile="$(OutDir)/lib.dll"
- LinkIncremental="1"
- AdditionalLibraryDirectories="$(QTDIR)/lib"
- GenerateDebugInformation="TRUE"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
- <File
- RelativePath="networker.cpp">
- </File>
- <File
- RelativePath="tools.cpp">
- </File>
- <File
- RelativePath="worker.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc">
- <File
- RelativePath="networker.h">
- </File>
- <File
- RelativePath="tools.h">
- </File>
- <File
- RelativePath="worker.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc.exe $(InputName).h -o moc_$(InputName).cpp"
- Outputs="moc_$(InputName).cpp"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc.exe $(InputName).h -o moc_$(InputName).cpp"
- Outputs="moc_$(InputName).cpp"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Generated MOC"
- Filter="">
- <File
- RelativePath="moc_worker.cpp">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/examples/activeqt/dotnet/wrapper/lib/networker.cpp b/examples/activeqt/dotnet/wrapper/lib/networker.cpp
deleted file mode 100644
index 4f5ba28..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/networker.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-#include "networker.h"
-#include "worker.h"
-#include "tools.h"
-
-netWorker::netWorker()
-{
- workerObject = new Worker();
-}
-//! [0] //! [1]
-
-netWorker::~netWorker()
-{
- delete workerObject;
-}
-//! [1] //! [2]
-
-String *netWorker::get_StatusString()
-{
- return QStringToString(workerObject->statusString());
-}
-//! [2] //! [3]
-
-void netWorker::set_StatusString(String *string)
-{
- workerObject->setStatusString(StringToQString(string));
- __raise statusStringChanged(string);
-}
-//! [3]
diff --git a/examples/activeqt/dotnet/wrapper/lib/networker.h b/examples/activeqt/dotnet/wrapper/lib/networker.h
deleted file mode 100644
index 14c4f67..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/networker.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// lib.h
-
-#pragma once
-
-#using <mscorlib.dll>
-using namespace System;
-
-//! [0]
-class Worker;
-
-// .NET class
-public __gc class netWorker
-{
-public:
- netWorker();
- ~netWorker();
-
- __property String *get_StatusString();
- __property void set_StatusString(String *string);
-
- __event void statusStringChanged(String *args);
-
-private:
- Worker *workerObject;
-};
-//! [0]
diff --git a/examples/activeqt/dotnet/wrapper/lib/tools.cpp b/examples/activeqt/dotnet/wrapper/lib/tools.cpp
deleted file mode 100644
index 7b7ab61..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/tools.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-#include <QString>
-
-#using <mscorlib.dll>
-#include <vcclr.h>
-
-using namespace System;
-
-String *QStringToString(const QString &qstring)
-{
- return new String((const wchar_t *)qstring.utf16());
-}
-//! [0] //! [1]
-
-QString StringToQString(String *string)
-{
- const wchar_t __pin *chars = PtrToStringChars(string);
- return QString::fromWCharArray(chars);
-}
-//! [1]
diff --git a/examples/activeqt/dotnet/wrapper/lib/tools.h b/examples/activeqt/dotnet/wrapper/lib/tools.h
deleted file mode 100644
index ca1f5b9..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/tools.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef TOOLS_H
-#define TOOLS_H
-
-#using <mscorlib.dll>
-
-QT_BEGIN_NAMESPACE
-class QString;
-QT_END_NAMESPACE
-
-System::String *QStringToString(const QString &qstring);
-QString StringToQString(System::String *string);
-
-#endif // TOOLS_H
diff --git a/examples/activeqt/dotnet/wrapper/lib/worker.cpp b/examples/activeqt/dotnet/wrapper/lib/worker.cpp
deleted file mode 100644
index 70b2fd3..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/worker.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "worker.h"
-#include "tools.h"
-
-Worker::Worker()
-{
- status = "Idle";
-}
-
-void Worker::setStatusString(const QString &string)
-{
- status = string;
- emit statusStringChanged(status);
-}
-
-QString Worker::statusString() const
-{
- return status;
-}
diff --git a/examples/activeqt/dotnet/wrapper/lib/worker.h b/examples/activeqt/dotnet/wrapper/lib/worker.h
deleted file mode 100644
index 479648b..0000000
--- a/examples/activeqt/dotnet/wrapper/lib/worker.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef WORKER_H
-#define WORKER_H
-
-#include <QObject>
-
-// native Qt/C++ class
-//! [0]
-class Worker : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString statusString READ statusString WRITE setStatusString)
-public:
- Worker();
-
- QString statusString() const;
-
-public slots:
- void setStatusString(const QString &string);
-
-signals:
- void statusStringChanged(const QString &string);
-
-private:
- QString status;
-};
-//! [0]
-
-#endif // WORKER_H
diff --git a/examples/activeqt/dotnet/wrapper/main.cs b/examples/activeqt/dotnet/wrapper/main.cs
deleted file mode 100644
index 1d43029..0000000
--- a/examples/activeqt/dotnet/wrapper/main.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//! [0]
-using System;
-
-namespace WrapperApp
-{
- class App
- {
- void Run()
- {
- netWorker worker = new netWorker();
-
- worker.statusStringChanged += new netWorker.__Delegate_statusStringChanged(onStatusStringChanged);
-
- System.Console.Out.WriteLine(worker.StatusString);
-
- System.Console.Out.WriteLine("Working cycle begins...");
- worker.StatusString = "Working";
- worker.StatusString = "Lunch Break";
- worker.StatusString = "Working";
- worker.StatusString = "Idle";
- System.Console.Out.WriteLine("Working cycle ends...");
- }
-
- private void onStatusStringChanged(string str)
- {
- System.Console.Out.WriteLine(str);
- }
-
- [STAThread]
-//! [0] //! [1]
- static void Main(string[] args)
- {
- App app = new App();
- app.Run();
- }
-//! [1] //! [2]
- }
-//! [2] //! [3]
-}
-//! [3]
diff --git a/examples/activeqt/dotnet/wrapper/wrapper.sln b/examples/activeqt/dotnet/wrapper/wrapper.sln
deleted file mode 100644
index e25e6bd..0000000
--- a/examples/activeqt/dotnet/wrapper/wrapper.sln
+++ /dev/null
@@ -1,28 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "app", "app.csproj", "{334C8F04-E034-4082-9380-43906DDE71AB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib", "lib\lib.vcproj", "{2E94A303-45A2-47AC-B87A-7C3519E9D6D8}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- {334C8F04-E034-4082-9380-43906DDE71AB}.0 = {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {334C8F04-E034-4082-9380-43906DDE71AB}.Debug.ActiveCfg = Debug|.NET
- {334C8F04-E034-4082-9380-43906DDE71AB}.Debug.Build.0 = Debug|.NET
- {334C8F04-E034-4082-9380-43906DDE71AB}.Release.ActiveCfg = Release|.NET
- {334C8F04-E034-4082-9380-43906DDE71AB}.Release.Build.0 = Release|.NET
- {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Debug.ActiveCfg = Debug|Win32
- {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Debug.Build.0 = Debug|Win32
- {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Release.ActiveCfg = Release|Win32
- {2E94A303-45A2-47AC-B87A-7C3519E9D6D8}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/examples/activeqt/hierarchy/CMakeLists.txt b/examples/activeqt/hierarchy/CMakeLists.txt
deleted file mode 100644
index 0d6d006..0000000
--- a/examples/activeqt/hierarchy/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Generated from hierarchy.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(hierarchyax LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/hierarchy")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-
-add_qt_gui_executable(hierarchyax
- main.cpp
- objects.cpp objects.h
-)
-target_link_libraries(hierarchyax PUBLIC
- Qt::AxServer
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS hierarchyax
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc b/examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc
deleted file mode 100644
index d9e3932..0000000
--- a/examples/activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [script]
-<script language="javascript">
-function createSubWidget( form )
-{
- ParentWidget.createSubWidget( form.nameEdit.value );
-}
-
-function renameSubWidget( form )
-{
- var SubWidget = ParentWidget.subWidget( form.nameEdit.value );
- if ( !SubWidget ) {
- alert( "No such widget " + form.nameEdit.value + "!" );
- return;
- }
- SubWidget.label = form.labelEdit.value;
- form.nameEdit.value = SubWidget.label;
-}
-
-function setFont( form )
-{
- ParentWidget.font = form.fontEdit.value;
-}
-</script>
-
-<p>
-This widget can have many children!
-</p>
-<object ID="ParentWidget" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c"
-CODEBASE="http://www.qt-project.org/demos/hierarchy.cab">
-[Object not available! Did you forget to build and register the server?]
-</object><br />
-<form>
-<input type="edit" ID="nameEdit" value="&lt;enter object name&gt;" />
-<input type="button" value="Create" onClick="createSubWidget(this.form)" />
-<input type="edit" ID="labelEdit" />
-<input type="button" value="Rename" onClick="renameSubWidget(this.form)" />
-<br />
-<input type="edit" ID="fontEdit" value="MS Sans Serif" />
-<input type="button" value = "Set Font" onClick="setFont(this.form)" />
-</form>
-//! [script]
diff --git a/examples/activeqt/hierarchy/main.cpp b/examples/activeqt/hierarchy/main.cpp
deleted file mode 100644
index a29487d..0000000
--- a/examples/activeqt/hierarchy/main.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-#include "objects.h"
-#include <QAxFactory>
-
-QAXFACTORY_BEGIN("{9e626211-be62-4d18-9483-9419358fbb03}", "{75c276de-1df5-451f-a004-e4fa1a587df1}")
- QAXCLASS(QParentWidget)
- QAXTYPE(QSubWidget)
-QAXFACTORY_END()
-//! [0]
diff --git a/examples/activeqt/hierarchy/objects.cpp b/examples/activeqt/hierarchy/objects.cpp
deleted file mode 100644
index af9d966..0000000
--- a/examples/activeqt/hierarchy/objects.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "objects.h"
-#include <QLayout>
-#include <QPainter>
-
-/* Implementation of QParentWidget */
-//! [0]
-QParentWidget::QParentWidget(QWidget *parent)
-: QWidget(parent),
- m_vbox(new QVBoxLayout(this))
-{
-}
-
-//! [0] //! [1]
-void QParentWidget::createSubWidget(const QString &name)
-{
- QSubWidget *sw = new QSubWidget(this, name);
- m_vbox->addWidget(sw);
- sw->setLabel(name);
- sw->show();
-}
-
-//! [1] //! [2]
-QSubWidget *QParentWidget::subWidget(const QString &name)
-{
- return findChild<QSubWidget *>(name);
-}
-
-//! [2]
-QSize QParentWidget::sizeHint() const
-{
- return QWidget::sizeHint().expandedTo(QSize(100, 100));
-}
-
-/* Implementation of QSubWidget */
-//! [3]
-QSubWidget::QSubWidget(QWidget *parent, const QString &name)
-: QWidget(parent)
-{
- setObjectName(name);
-}
-
-void QSubWidget::setLabel(const QString &text)
-{
- m_label = text;
- setObjectName(text);
- update();
-}
-
-QString QSubWidget::label() const
-{
- return m_label;
-}
-
-QSize QSubWidget::sizeHint() const
-{
- QFontMetrics fm(font());
- return QSize(fm.horizontalAdvance(m_label), fm.height());
-}
-
-void QSubWidget::paintEvent(QPaintEvent *)
-{
- QPainter painter(this);
- painter.setPen(palette().text().color());
- painter.drawText(rect(), Qt::AlignCenter, m_label);
-//! [3] //! [4]
-}
-//! [4]
diff --git a/examples/activeqt/hierarchy/objects.h b/examples/activeqt/hierarchy/objects.h
deleted file mode 100644
index cc9186e..0000000
--- a/examples/activeqt/hierarchy/objects.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef OBJECTS_H
-#define OBJECTS_H
-
-#include <QWidget>
-
-QT_BEGIN_NAMESPACE
-class QVBoxLayout;
-QT_END_NAMESPACE
-class QSubWidget;
-
-//! [0]
-class QParentWidget : public QWidget
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{d574a747-8016-46db-a07c-b2b4854ee75c}");
- Q_CLASSINFO("InterfaceID", "{4a30719d-d9c2-4659-9d16-67378209f822}");
- Q_CLASSINFO("EventsID", "{4a30719d-d9c2-4659-9d16-67378209f823}");
-public:
- explicit QParentWidget(QWidget *parent = nullptr);
-
- QSize sizeHint() const override;
-
-public slots:
- void createSubWidget(const QString &name);
-
- QSubWidget *subWidget(const QString &name);
-
-private:
- QVBoxLayout *m_vbox;
-};
-//! [0]
-
-//! [1]
-class QSubWidget : public QWidget
-{
- Q_OBJECT
- Q_PROPERTY(QString label READ label WRITE setLabel)
-
- Q_CLASSINFO("ClassID", "{850652f4-8f71-4f69-b745-bce241ccdc30}");
- Q_CLASSINFO("InterfaceID", "{2d76cc2f-3488-417a-83d6-debff88b3c3f}");
- Q_CLASSINFO("ToSuperClass", "QSubWidget");
-
-public:
- QSubWidget(QWidget *parent = nullptr, const QString &name = QString());
-
- void setLabel(const QString &text);
- QString label() const;
-
- QSize sizeHint() const override;
-
-protected:
- void paintEvent(QPaintEvent *e) override;
-
-private:
- QString m_label;
-};
-//! [1]
-
-#endif // OBJECTS_H
diff --git a/examples/activeqt/mediaplayer/CMakeLists.txt b/examples/activeqt/mediaplayer/CMakeLists.txt
deleted file mode 100644
index 317ea40..0000000
--- a/examples/activeqt/mediaplayer/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# Generated from mediaplayer.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(mediaplayer LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/mediaplayer")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxContainer)
-
-add_qt_gui_executable(mediaplayer
- main.cpp
- mainwindow.ui
- mediaaxwidget.h
-)
-target_link_libraries(mediaplayer PUBLIC
- Qt::AxContainer
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS mediaplayer
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/mediaplayer/mediaaxwidget.h b/examples/activeqt/mediaplayer/mediaaxwidget.h
deleted file mode 100644
index 9eedb0a..0000000
--- a/examples/activeqt/mediaplayer/mediaaxwidget.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MEDIAAXWIDGET_H
-#define MEDIAAXWIDGET_H
-
-#include <QtAxContainer/QAxWidget>
-#include <qt_windows.h>
-
-// Overrides the translateKeyEvent() function to pass keystrokes
-// to the Windows Media Player ActiveX control.
-class MediaAxWidget : public QAxWidget
-{
-public:
- MediaAxWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {})
- : QAxWidget(parent, f)
- {
- }
-
-protected:
- bool translateKeyEvent(int message, int keycode) const override
- {
- if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
- return true;
- return QAxWidget::translateKeyEvent(message, keycode);
- }
-};
-
-#endif // MEDIAAXWIDGET_H
diff --git a/examples/activeqt/menus/CMakeLists.txt b/examples/activeqt/menus/CMakeLists.txt
deleted file mode 100644
index 1bf6a6b..0000000
--- a/examples/activeqt/menus/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Generated from menus.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(menusax LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/menus")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-
-add_qt_gui_executable(menusax
- main.cpp
- menus.cpp menus.h
-)
-target_link_libraries(menusax PUBLIC
- Qt::AxServer
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS menusax
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc b/examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc
deleted file mode 100644
index c0535a6..0000000
--- a/examples/activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-<object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
-CODEBASE="http://www.qt-project.org/demos/menusax.cab">
-[Object not available! Did you forget to build and register the server?]
-</object>
-//! [0]
diff --git a/examples/activeqt/menus/doc/src/menus.qdoc b/examples/activeqt/menus/doc/src/menus.qdoc
deleted file mode 100644
index 343f3b2..0000000
--- a/examples/activeqt/menus/doc/src/menus.qdoc
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qaxserver-demo-menus.html
- \preliminary
-
- \title Menubar Merging
-
- This example is not fully functional at the moment.
-
- \raw HTML
- <object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
- CODEBASE="http://www.qt-project.org/demos/menusax.cab">
- [Object not available! Did you forget to build and register the server?]
- </object>
- \endraw
-*/
-
-/*!
- \example activeqt/menus
- \title Menus Example (ActiveQt)
-
- \brief The Menus example demonstrates the use of QMenuBar and QStatusBar
- in a QMainWindow to implement an in-place active control.
-
- To build the example you must first build the QAxServer library.
- Then run \c qmake and your make tool in \c
- examples/activeqt/menus.
-
- The \l{qaxserver-demo-menus.html}{demonstration} requires your
- WebBrowser to support ActiveX controls, and scripting to be
- enabled.
-
- \snippet activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc 0
-*/
diff --git a/examples/activeqt/menus/main.cpp b/examples/activeqt/menus/main.cpp
deleted file mode 100644
index 8d70e4d..0000000
--- a/examples/activeqt/menus/main.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "menus.h"
-#include <QApplication>
-#include <QAxFactory>
-#include <QScopedPointer>
-
-QAXFACTORY_BEGIN(
- "{ce947ee3-0403-4fdc-895a-4fe779394b46}", // type library ID
- "{8de435ce-8d2a-46ac-b3b3-cb800d0847c7}") // application ID
- QAXCLASS(QMenus)
-QAXFACTORY_END()
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- QScopedPointer<QWidget> window;
-
- if (!QAxFactory::isServer()) {
- window.reset(new QMenus());
- window->show();
- }
-
- return a.exec();
-}
diff --git a/examples/activeqt/menus/menus.h b/examples/activeqt/menus/menus.h
deleted file mode 100644
index efc6cca..0000000
--- a/examples/activeqt/menus/menus.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MENUS_H
-#define MENUS_H
-
-#include <QMainWindow>
-
-QT_BEGIN_NAMESPACE
-class QTextEdit;
-QT_END_NAMESPACE
-
-class QMenus : public QMainWindow
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{4dc3f340-a6f7-44e4-a79b-3e9217695fbd}")
- Q_CLASSINFO("InterfaceID", "{9ee49617-7d5c-441a-b833-4b068d40d751}")
- Q_CLASSINFO("EventsID", "{13eca64b-ee2a-4f3c-aa04-5d9d975979a7}")
-
-public:
- explicit QMenus(QWidget *parent = nullptr);
-
-public slots:
- void fileOpen();
- void fileSave();
-
- void editNormal();
- void editBold();
- void editUnderline();
-
- void editAdvancedFont();
- void editAdvancedStyle();
-
- void helpAbout();
- void helpAboutQt();
-
-private:
- QTextEdit *m_editor;
-};
-
-#endif // MENUS_H
diff --git a/examples/activeqt/multiple/CMakeLists.txt b/examples/activeqt/multiple/CMakeLists.txt
deleted file mode 100644
index ac9f8a9..0000000
--- a/examples/activeqt/multiple/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# Generated from multiple.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(multipleax LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/multiple")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-
-add_qt_gui_executable(multipleax
- ax1.h
- ax2.h
- main.cpp
-)
-target_link_libraries(multipleax PUBLIC
- Qt::AxServer
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS multipleax
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/multiple/ax1.h b/examples/activeqt/multiple/ax1.h
deleted file mode 100644
index 0a8ccb6..0000000
--- a/examples/activeqt/multiple/ax1.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef AX1_H
-#define AX1_H
-
-#include <QWidget>
-#include <QPainter>
-
-//! [0]
-class QAxWidget1 : public QWidget
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{1D9928BD-4453-4bdd-903D-E525ED17FDE5}")
- Q_CLASSINFO("InterfaceID", "{99F6860E-2C5A-42ec-87F2-43396F4BE389}")
- Q_CLASSINFO("EventsID", "{0A3E9F27-E4F1-45bb-9E47-63099BCCD0E3}")
-
- Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor)
-public:
- explicit QAxWidget1(QWidget *parent = nullptr)
- : QWidget(parent)
- {
- }
-
- QColor fillColor() const
- {
- return m_fillColor;
- }
-
- void setFillColor(const QColor &fc)
- {
- m_fillColor = fc;
- repaint();
- }
-
-protected:
- void paintEvent(QPaintEvent *e) override
- {
- QPainter paint(this);
- QRect r = rect();
- r.adjust(10, 10, -10, -10);
- paint.fillRect(r, m_fillColor);
- }
-
-private:
- QColor m_fillColor = Qt::red;
-};
-//! [0]
-
-#endif // AX1_H
diff --git a/examples/activeqt/multiple/ax2.h b/examples/activeqt/multiple/ax2.h
deleted file mode 100644
index 9249f1a..0000000
--- a/examples/activeqt/multiple/ax2.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef AX2_H
-#define AX2_H
-
-#include <QWidget>
-#include <QPainter>
-
-//! [0]
-class QAxWidget2 : public QWidget
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{58139D56-6BE9-4b17-937D-1B1EDEDD5B71}")
- Q_CLASSINFO("InterfaceID", "{B66280AB-08CC-4dcc-924F-58E6D7975B7D}")
- Q_CLASSINFO("EventsID", "{D72BACBA-03C4-4480-B4BB-DE4FE3AA14A0}")
- Q_CLASSINFO("ToSuperClass", "QAxWidget2")
- Q_CLASSINFO("StockEvents", "yes")
- Q_CLASSINFO("Insertable", "yes")
-
- Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
-public:
- using QWidget::QWidget;
-
- int lineWidth() const
- {
- return m_lineWidth;
- }
-
- void setLineWidth(int lw)
- {
- m_lineWidth = lw;
- repaint();
- }
-
-protected:
- void paintEvent(QPaintEvent *e) override
- {
- QPainter paint(this);
- QPen pen = paint.pen();
- pen.setWidth(m_lineWidth);
- paint.setPen(pen);
-
- QRect r = rect();
- r.adjust(10, 10, -10, -10);
- paint.drawEllipse(r);
- }
-
-private:
- int m_lineWidth = 1;
-};
-//! [0]
-
-#endif // AX2_H
diff --git a/examples/activeqt/multiple/main.cpp b/examples/activeqt/multiple/main.cpp
deleted file mode 100644
index ce7bf25..0000000
--- a/examples/activeqt/multiple/main.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-#include "ax1.h"
-#include "ax2.h"
-#include <QAxFactory>
-
-QT_USE_NAMESPACE
-
-QAXFACTORY_BEGIN("{98DE28B6-6CD3-4e08-B9FA-3D1DB43F1D2F}", "{05828915-AD1C-47ab-AB96-D6AD1E25F0E2}")
- QAXCLASS(QAxWidget1)
- QAXCLASS(QAxWidget2)
-QAXFACTORY_END()
-//! [0]
diff --git a/examples/activeqt/opengl/CMakeLists.txt b/examples/activeqt/opengl/CMakeLists.txt
deleted file mode 100644
index 5c08b0c..0000000
--- a/examples/activeqt/opengl/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-# Generated from opengl.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(openglax LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/opengl")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-find_package(Qt6 COMPONENTS OpenGL)
-find_package(Qt6 COMPONENTS OpenGLWidgets)
-
-add_qt_gui_executable(openglax
- glbox.cpp glbox.h
- globjwin.cpp globjwin.h
- main.cpp
-)
-target_link_libraries(openglax PUBLIC
- Qt::AxServer
- Qt::Core
- Qt::Gui
- Qt::OpenGL
- Qt::OpenGLWidgets
- Qt::Widgets
-)
-
-install(TARGETS openglax
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/opengl/glbox.h b/examples/activeqt/opengl/glbox.h
deleted file mode 100644
index 6197b3a..0000000
--- a/examples/activeqt/opengl/glbox.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** This is a simple QGLWidget displaying an openGL wireframe box
-**
-****************************************************************************/
-
-#ifndef GLBOX_H
-#define GLBOX_H
-
-#include <QOpenGLWidget>
-#include <QOpenGLFunctions_1_1>
-//! [0]
-#include <QAxBindable>
-
-class GLBox : public QOpenGLWidget,
- public QOpenGLFunctions_1_1,
- public QAxBindable
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}")
- Q_CLASSINFO("InterfaceID", "{33b051af-bb25-47cf-a390-5cfd2987d26a}")
- Q_CLASSINFO("EventsID", "{8c996c29-eafa-46ac-a6f9-901951e765b5}")
- //! [0] //! [1]
-
-public:
- explicit GLBox(QWidget *parent, const char *name = nullptr);
- virtual ~GLBox();
- QAxAggregated *createAggregate() override;
-
-public slots:
- void setXRotation(int degrees);
-//! [1]
- void setYRotation(int degrees);
- void setZRotation(int degrees);
-
-protected:
- void initializeGL() override;
- void paintGL() override;
- void resizeGL(int w, int h) override;
- virtual GLuint makeObject();
-
-private:
- GLuint m_object = 0;
- GLdouble m_xRot = 0;
- GLdouble m_yRot = 0;
- GLdouble m_zRot = 0;
- GLdouble m_scale = 1.25;
-};
-
-#endif // GLBOX_H
diff --git a/examples/activeqt/opengl/globjwin.cpp b/examples/activeqt/opengl/globjwin.cpp
deleted file mode 100644
index 0324f06..0000000
--- a/examples/activeqt/opengl/globjwin.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "globjwin.h"
-#include "glbox.h"
-#include <QPushButton>
-#include <QSlider>
-#include <QLayout>
-#include <QFrame>
-#include <QMenuBar>
-#include <QMenu>
-#include <QApplication>
-
-
-GLObjectWindow::GLObjectWindow(QWidget *parent)
- : QWidget(parent)
-{
- // Create a menu
- QMenu *file = new QMenu(this);
- file->addAction(tr("Exit"), qApp, &QApplication::quit);
-
- // Create a menu bar
- QMenuBar *m = new QMenuBar(this);
- m->addMenu(file)->setText(tr("&File"));
-
- // Create a nice frame to put around the OpenGL widget
- QFrame *f = new QFrame(this);
- f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
- f->setLineWidth(2);
-
- // Create our OpenGL widget
- GLBox *c = new GLBox(f, "glbox");
-
- // Create the three sliders; one for each rotation axis
- QSlider *x = new QSlider(Qt::Vertical, this);
- x->setMaximum(360);
- x->setPageStep(60);
- x->setTickPosition(QSlider::TicksLeft);
- connect(x, &QSlider::valueChanged, c, &GLBox::setXRotation);
-
- QSlider *y = new QSlider(Qt::Vertical, this);
- y->setMaximum(360);
- y->setPageStep(60);
- y->setTickPosition(QSlider::TicksLeft);
- connect(y, &QSlider::valueChanged, c, &GLBox::setYRotation);
-
- QSlider *z = new QSlider(Qt::Vertical, this);
- z->setMaximum(360);
- z->setPageStep(60);
- z->setTickPosition(QSlider::TicksLeft);
- connect(z, &QSlider::valueChanged, c, &GLBox::setZRotation);
-
- // Now that we have all the widgets, put them into a nice layout
-
- // Top level layout, puts the sliders to the left of the frame/GL widget
- QHBoxLayout *hlayout = new QHBoxLayout(this);
-
- // Put the sliders on top of each other
- QVBoxLayout *vlayout = new QVBoxLayout();
- vlayout->addWidget(x);
- vlayout->addWidget(y);
- vlayout->addWidget(z);
-
- // Put the GL widget inside the frame
- QHBoxLayout *flayout = new QHBoxLayout(f);
- flayout->setContentsMargins(0, 0, 0, 0);
- flayout->addWidget(c, 1);
-
- hlayout->setMenuBar(m);
- hlayout->addLayout(vlayout);
- hlayout->addWidget(f, 1);
-}
diff --git a/examples/activeqt/opengl/globjwin.h b/examples/activeqt/opengl/globjwin.h
deleted file mode 100644
index 500c241..0000000
--- a/examples/activeqt/opengl/globjwin.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/****************************************************************************
-**
-** The GLObjectWindow contains a GLBox and three sliders connected to
-** the GLBox's rotation slots.
-**
-****************************************************************************/
-
-#ifndef GLOBJWIN_H
-#define GLOBJWIN_H
-
-#include <qwidget.h>
-
-class GLObjectWindow : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit GLObjectWindow(QWidget *parent = nullptr);
-};
-
-#endif
diff --git a/examples/activeqt/opengl/main.cpp b/examples/activeqt/opengl/main.cpp
deleted file mode 100644
index a3de04b..0000000
--- a/examples/activeqt/opengl/main.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//
-// Qt OpenGL example: Box
-//
-// A small example showing how a GLWidget can be used just as any Qt widget
-//
-// File: main.cpp
-//
-// The main() function
-//
-
-#include "globjwin.h"
-#include "glbox.h"
-#include <QApplication>
-//! [0]
-#include <QAxFactory>
-
-QAXFACTORY_BEGIN(
- "{2c3c183a-eeda-41a4-896e-3d9c12c3577d}", // type library ID
- "{83e16271-6480-45d5-aaf1-3f40b7661ae4}") // application ID
- QAXCLASS(GLBox)
-QAXFACTORY_END()
-
-//! [0] //! [1]
-/*
- The main program is here.
-*/
-
-int main(int argc, char *argv[])
-{
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication a(argc,argv);
-
- if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL) {
- qWarning("This system does not support OpenGL. Exiting.");
- return -1;
- }
-
- if (!QAxFactory::isServer()) {
- GLObjectWindow w;
- w.resize(400, 350);
- w.show();
- return a.exec();
-//! [1] //! [2]
- }
- return a.exec();
-//! [2] //! [3]
-}
-//! [3]
diff --git a/examples/activeqt/qutlook/CMakeLists.txt b/examples/activeqt/qutlook/CMakeLists.txt
index 3373330..8cfbf9a 100644
--- a/examples/activeqt/qutlook/CMakeLists.txt
+++ b/examples/activeqt/qutlook/CMakeLists.txt
@@ -1,26 +1,31 @@
-# Generated from qutlook.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.16)
project(qutlook LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/qutlook")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxContainer)
+find_package(Qt6 REQUIRED COMPONENTS AxContainer Core Gui Widgets)
+
+qt_add_executable(qutlook
+ addressview.cpp addressview.h
+ main.cpp
+)
+set_target_properties(qutlook PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
)
+
+qt6_target_typelibs(qutlook LIBRARIES "msoutl:{00062FFF-0000-0000-C000-000000000046}")
+
target_link_libraries(qutlook PUBLIC
Qt::AxContainer
Qt::Core
@@ -28,13 +33,6 @@ target_link_libraries(qutlook PUBLIC
Qt::Widgets
)
-if(NOT TYPELIBS_ISEMPTY)
- target_sources(qutlook PUBLIC
- addressview.cpp addressview.h
- main.cpp
- )
-endif()
-
install(TARGETS qutlook
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/activeqt/qutlook/addressview.cpp b/examples/activeqt/qutlook/addressview.cpp
index fd1e0d3..f3d4fc7 100644
--- a/examples/activeqt/qutlook/addressview.cpp
+++ b/examples/activeqt/qutlook/addressview.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
#include "addressview.h"
@@ -70,7 +23,7 @@ public:
private:
Outlook::Application outlook;
- Outlook::Items * contactItems;
+ Outlook::Items *folderItems = nullptr;
mutable QHash<QModelIndex, QStringList> cache;
};
@@ -83,10 +36,10 @@ AddressBookModel::AddressBookModel(AddressView *parent)
Outlook::NameSpace session(outlook.Session());
session.Logon();
Outlook::MAPIFolder *folder = session.GetDefaultFolder(Outlook::olFolderContacts);
- contactItems = new Outlook::Items(folder->Items());
- connect(contactItems, SIGNAL(ItemAdd(IDispatch*)), parent, SLOT(updateOutlook()));
- connect(contactItems, SIGNAL(ItemChange(IDispatch*)), parent, SLOT(updateOutlook()));
- connect(contactItems, SIGNAL(ItemRemove()), parent, SLOT(updateOutlook()));
+ folderItems = new Outlook::Items(folder->Items());
+ connect(folderItems, SIGNAL(ItemAdd(IDispatch*)), parent, SLOT(updateOutlook()));
+ connect(folderItems, SIGNAL(ItemChange(IDispatch*)), parent, SLOT(updateOutlook()));
+ connect(folderItems, SIGNAL(ItemRemove()), parent, SLOT(updateOutlook()));
delete folder;
}
@@ -95,7 +48,7 @@ AddressBookModel::AddressBookModel(AddressView *parent)
//! [1] //! [2]
AddressBookModel::~AddressBookModel()
{
- delete contactItems;
+ delete folderItems;
if (!outlook.isNull())
Outlook::NameSpace(outlook.Session()).Logoff();
@@ -104,7 +57,7 @@ AddressBookModel::~AddressBookModel()
//! [2] //! [3]
int AddressBookModel::rowCount(const QModelIndex &) const
{
- return contactItems ? contactItems->Count() : 0;
+ return folderItems ? folderItems->Count() : 0;
}
int AddressBookModel::columnCount(const QModelIndex & /*parent*/) const
@@ -144,12 +97,15 @@ QVariant AddressBookModel::data(const QModelIndex &index, int role) const
if (cache.contains(index)) {
data = cache.value(index);
} else {
- Outlook::ContactItem contact(contactItems->Item(index.row() + 1));
- data << contact.FirstName() << contact.LastName() << contact.HomeAddress() << contact.Email1Address();
+ Outlook::ContactItem contact(folderItems->Item(index.row() + 1));
+
+ if (contact.Class() == Outlook::OlObjectClass::olContact)
+ data << contact.FirstName() << contact.LastName() << contact.HomeAddress() << contact.Email1Address();
+
cache.insert(index, data);
}
- if (index.column() < data.count())
+ if (index.column() < data.size())
return data.at(index.column());
return QVariant();
@@ -158,7 +114,10 @@ QVariant AddressBookModel::data(const QModelIndex &index, int role) const
//! [5] //! [6]
void AddressBookModel::changeItem(const QModelIndex &index, const QString &firstName, const QString &lastName, const QString &address, const QString &email)
{
- Outlook::ContactItem item(contactItems->Item(index.row() + 1));
+ Outlook::ContactItem item(folderItems->Item(index.row() + 1));
+
+ if (item.Class() != Outlook::OlObjectClass::olContact)
+ return; // Not a contact
item.SetFirstName(firstName);
item.SetLastName(lastName);
diff --git a/examples/activeqt/qutlook/addressview.h b/examples/activeqt/qutlook/addressview.h
index a95c803..afb8767 100644
--- a/examples/activeqt/qutlook/addressview.h
+++ b/examples/activeqt/qutlook/addressview.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef ADDRESSVIEW_H
#define ADDRESSVIEW_H
diff --git a/examples/activeqt/qutlook/doc/src/qutlook.qdoc b/examples/activeqt/qutlook/doc/src/qutlook.qdoc
index 5ed5f69..04f9123 100644
--- a/examples/activeqt/qutlook/doc/src/qutlook.qdoc
+++ b/examples/activeqt/qutlook/doc/src/qutlook.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example activeqt/qutlook
\title Qutlook Example (ActiveQt)
+ \examplecategory {Desktop}
+ \ingroup activeqt-examples
\brief The Qutlook example demonstrates the use of ActiveQt to automate
Outlook. The example makes use of the \l dumpcpp tool to generate
diff --git a/examples/activeqt/qutlook/main.cpp b/examples/activeqt/qutlook/main.cpp
index 6aaa5ea..c3b0e40 100644
--- a/examples/activeqt/qutlook/main.cpp
+++ b/examples/activeqt/qutlook/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
#include "addressview.h"
diff --git a/examples/activeqt/simple/CMakeLists.txt b/examples/activeqt/simple/CMakeLists.txt
index 600defb..2d7cbc6 100644
--- a/examples/activeqt/simple/CMakeLists.txt
+++ b/examples/activeqt/simple/CMakeLists.txt
@@ -1,30 +1,25 @@
-# Generated from simple.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.16)
project(simpleax LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/simple")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-
-add_qt_gui_executable(simpleax
+find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets)
+qt6_add_axserver_executable(simpleax
main.cpp
+ simple.def
+ simple.rc
)
+
target_link_libraries(simpleax PUBLIC
- Qt::AxServer
Qt::Core
Qt::Gui
Qt::Widgets
diff --git a/examples/activeqt/simple/doc/src/simple.qdoc b/examples/activeqt/simple/doc/src/simple.qdoc
index 76ac4ea..8e0f6ae 100644
--- a/examples/activeqt/simple/doc/src/simple.qdoc
+++ b/examples/activeqt/simple/doc/src/simple.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qaxserver-demo-simple.html
@@ -73,6 +49,8 @@
/*!
\example activeqt/simple
\title Simple Example (ActiveQt)
+ \examplecategory {Desktop}
+ \ingroup activeqt-examples
\brief The Simple example demonstrates the use
of QAxBindable and QAxFactory.
diff --git a/examples/activeqt/simple/main.cpp b/examples/activeqt/simple/main.cpp
index 0c5e49a..8aec313 100644
--- a/examples/activeqt/simple/main.cpp
+++ b/examples/activeqt/simple/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QAxBindable>
#include <QAxFactory>
diff --git a/examples/activeqt/simpleqml/CMakeLists.txt b/examples/activeqt/simpleqml/CMakeLists.txt
deleted file mode 100644
index bc293ad..0000000
--- a/examples/activeqt/simpleqml/CMakeLists.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-# Generated from simpleqml.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(simpleqmlax LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/simpleqml")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
-find_package(Qt6 COMPONENTS Quick)
-find_package(Qt6 COMPONENTS QuickWidgets)
-
-add_qt_gui_executable(simpleqmlax
- main.cpp
-)
-target_link_libraries(simpleqmlax PUBLIC
- Qt::AxServer
- Qt::Core
- Qt::Gui
- Qt::Quick
- Qt::QuickWidgets
- Qt::Widgets
-)
-
-
-# Resources:
-set(simpleqml_resource_files
- "main.qml"
-)
-
-qt6_add_resources(simpleqmlax "simpleqml"
- PREFIX
- "/"
- FILES
- ${simpleqml_resource_files}
-)
-
-install(TARGETS simpleqmlax
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/activeqt/simpleqml/main.cpp b/examples/activeqt/simpleqml/main.cpp
deleted file mode 100644
index f6e7c14..0000000
--- a/examples/activeqt/simpleqml/main.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QAxBindable>
-#include <QAxFactory>
-#include <QMainWindow>
-#include <QQuickWidget>
-#include <QQmlContext>
-
-class Controller : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
- Q_PROPERTY(QColor color READ color NOTIFY valueChanged)
-public:
- explicit Controller(QWidget *parent = nullptr) :
- QObject(parent)
- { }
-
- qreal value() const { return m_value; }
-
- void setValue(qreal value)
- {
- m_value = qBound(qreal(0.0), value, qreal(1.0));
- valueChanged();
- }
-
- QColor color() const
- {
- QColor start = Qt::yellow;
- QColor end = Qt::magenta;
-
- // Linear interpolation between two colors in HSV space
- return QColor::fromHsvF(
- start.hueF() * (1.0f - m_value) + end.hueF() * m_value,
- start.saturationF() * (1.0f - m_value) + end.saturationF() * m_value,
- start.valueF() * (1.0f - m_value) + end.valueF() * m_value,
- start.alphaF() * (1.0f - m_value) + end.alphaF() * m_value
- );
- }
-
-signals:
- void valueChanged();
-
-private:
- qreal m_value = 0;
-};
-
-class QSimpleQmlAx : public QMainWindow
-{
- Q_OBJECT
- Q_CLASSINFO("ClassID", "{50477337-58FE-4898-8FFC-6F6199CEAE08}")
- Q_CLASSINFO("InterfaceID", "{A5EC7D99-CEC9-4BD1-8336-ED15A579B185}")
- Q_CLASSINFO("EventsID", "{5BBFBCFD-20FD-48A3-96C7-1F6649CD1F52}")
-public:
- explicit QSimpleQmlAx(QWidget *parent = nullptr) :
- QMainWindow(parent)
- {
- auto ui = new QQuickWidget(this);
-
- // Register our type to qml
- qmlRegisterType<Controller>("app", 1, 0, "Controller");
-
- // Initialize view
- ui->rootContext()->setContextProperty(QStringLiteral("context"), QVariant::fromValue(new Controller(this)));
- ui->setMinimumSize(200, 200);
- ui->setResizeMode(QQuickWidget::SizeRootObjectToView);
- ui->setSource(QUrl(QStringLiteral("qrc:/main.qml")));
- setCentralWidget(ui);
- }
-};
-
-#include "main.moc"
-
-QAXFACTORY_BEGIN(
- "{E544E321-EF8B-4CD4-91F6-DB55A59DBADB}", // type library ID
- "{E37E3131-DEA2-44EB-97A2-01CDD09A5A4D}") // application ID
- QAXCLASS(QSimpleQmlAx)
-QAXFACTORY_END()
diff --git a/examples/activeqt/simpleqml/main.qml b/examples/activeqt/simpleqml/main.qml
deleted file mode 100644
index 63737d9..0000000
--- a/examples/activeqt/simpleqml/main.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.5
-import QtQuick.Controls 2.0
-
-import app 1.0
-
-Rectangle {
- // Properties from context
- property Controller controller: context
-
- color: controller.color
-
- Label {
- id: idText
- text: "Color slider"
- anchors.top: parent.top
- anchors.left: parent.left
- color: "black"
- font.pixelSize: 12
- }
-
- Slider {
- value: controller.value
- onVisualPositionChanged: controller.value = visualPosition
-
- anchors.top: idText.bottom
- anchors.left: parent.left
- }
-}
diff --git a/examples/activeqt/simpleqml/simpleqml.def b/examples/activeqt/simpleqml/simpleqml.def
deleted file mode 100644
index bc82a03..0000000
--- a/examples/activeqt/simpleqml/simpleqml.def
+++ /dev/null
@@ -1,6 +0,0 @@
-EXPORTS
- DllCanUnloadNow PRIVATE
- DllGetClassObject PRIVATE
- DllRegisterServer PRIVATE
- DllUnregisterServer PRIVATE
- DumpIDL PRIVATE
diff --git a/examples/activeqt/simpleqml/simpleqml.ico b/examples/activeqt/simpleqml/simpleqml.ico
deleted file mode 100644
index c80d36a..0000000
--- a/examples/activeqt/simpleqml/simpleqml.ico
+++ /dev/null
Binary files differ
diff --git a/examples/activeqt/simpleqml/simpleqml.pro b/examples/activeqt/simpleqml/simpleqml.pro
deleted file mode 100644
index 9043e9d..0000000
--- a/examples/activeqt/simpleqml/simpleqml.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-include(../shared.pri)
-
-TEMPLATE = lib
-TARGET = simpleqmlax
-
-QT += widgets axserver quick quickwidgets
-
-SOURCES = main.cpp
-RC_FILE = simpleqml.rc
-DEF_FILE = simpleqml.def
-RESOURCES = simpleqml.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simpleqml
-INSTALLS += target
diff --git a/examples/activeqt/simpleqml/simpleqml.qrc b/examples/activeqt/simpleqml/simpleqml.qrc
deleted file mode 100644
index 5f6483a..0000000
--- a/examples/activeqt/simpleqml/simpleqml.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/activeqt/simpleqml/simpleqml.rc b/examples/activeqt/simpleqml/simpleqml.rc
deleted file mode 100644
index d2978ce..0000000
--- a/examples/activeqt/simpleqml/simpleqml.rc
+++ /dev/null
@@ -1,2 +0,0 @@
-1 TYPELIB "simpleqml.rc"
-1 ICON "simpleqml.ico"
diff --git a/examples/activeqt/wrapper/CMakeLists.txt b/examples/activeqt/wrapper/CMakeLists.txt
index 4a43092..78eea2c 100644
--- a/examples/activeqt/wrapper/CMakeLists.txt
+++ b/examples/activeqt/wrapper/CMakeLists.txt
@@ -1,30 +1,26 @@
-# Generated from wrapper.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.16)
project(wrapperax LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/activeqt/wrapper")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS AxServer)
+find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets)
-add_qt_gui_executable(wrapperax
+qt6_add_axserver_library(wrapperax
main.cpp
+ wrapperax.def
+ wrapperax.rc
)
+
target_link_libraries(wrapperax PUBLIC
- Qt::AxServer
Qt::Core
Qt::Gui
Qt::Widgets
diff --git a/examples/activeqt/wrapper/doc/src/wrapper.qdoc b/examples/activeqt/wrapper/doc/src/wrapper.qdoc
index 34b59ea..b2a50a8 100644
--- a/examples/activeqt/wrapper/doc/src/wrapper.qdoc
+++ b/examples/activeqt/wrapper/doc/src/wrapper.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qaxserver-demo-wrapper.html
@@ -36,6 +12,8 @@
/*!
\example activeqt/wrapper
\title Wrapper Example (ActiveQt)
+ \examplecategory {Desktop}
+ \ingroup activeqt-examples
\brief The Wrapper example demonstrates how to export existing QWidget
classes as ActiveX controls, and the use of QAxFactory together
diff --git a/examples/activeqt/wrapper/main.cpp b/examples/activeqt/wrapper/main.cpp
index 3d8d0a1..dbe1e61 100644
--- a/examples/activeqt/wrapper/main.cpp
+++ b/examples/activeqt/wrapper/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QAxFactory>
#include <QCheckBox>
diff --git a/qtactiveqt.pro b/qtactiveqt.pro
deleted file mode 100644
index ba8e079..0000000
--- a/qtactiveqt.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-requires(qtHaveModule(widgets))
-
-CONFIG += tests_need_tools
-load(qt_parts)
-
-!win32 {
- message("ActiveQt is a Windows Desktop-only module. Will just generate a docs target.")
- SUBDIRS = src
-}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b8658da..d7ec6d0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from src.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(activeqt)
if(WIN32)
diff --git a/src/activeqt/.prev_CMakeLists.txt b/src/activeqt/.prev_CMakeLists.txt
deleted file mode 100644
index bdfe1b3..0000000
--- a/src/activeqt/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-# Generated from activeqt.pro.
-
-#####################################################################
-## activeqt Binary:
-#####################################################################
-
-qt_add_executable(activeqt
- GUI
- PUBLIC_LIBRARIES
- Qt::Gui
-)
-
-## Scopes:
-#####################################################################
-
-#### Keys ignored in scope 2:.:.:activeqt.pro:WIN32:
-# SUBDIRS = "axbase" "control" "container" "activeqt"
-# TEMPLATE = "subdirs"
-# activeqt.file = "activeqt.prx"
-
-#### Keys ignored in scope 3:.:.:activeqt.pro:else:
-# TEMPLATE = "aux"
diff --git a/src/activeqt/CMakeLists.txt b/src/activeqt/CMakeLists.txt
index 5034157..e0050d3 100644
--- a/src/activeqt/CMakeLists.txt
+++ b/src/activeqt/CMakeLists.txt
@@ -1,22 +1,35 @@
-# Generated from activeqt.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-# special case begin
add_subdirectory(axbase)
add_subdirectory(control)
add_subdirectory(container)
-qt_add_module(ActiveQt HEADER_MODULE MODULE_INCLUDE_NAME ActiveQt)
-qt_add_docs(ActiveQt
+# We disable the headersclean check, since these header files don't belong to the ActiveQt module.
+# Headersclean rules fail because ActiveQt module doesn't link the necessary libraries so their
+# compile flags and include directories are missing. We cannot simply link libraries because the
+# missing include directories belong to the AxServer and AxContainer modules which have conflicting
+# object files and meaning and cannot be linked in the same time.
+qt_internal_add_module(ActiveQt
+ HEADER_MODULE
+ MODULE_INCLUDE_NAME ActiveQt
+ NO_HEADERSCLEAN_CHECK
+ SOURCES
+ axbase/qaxtypefunctions_p.h
+ axbase/qaxutils_p.h
+ container/qaxbase.h container/qaxbase_p.h
+ container/qaxobject.h container/qaxobject_p.h
+ container/qaxobjectinterface.h
+ container/qaxscript.h
+ container/qaxselect.h
+ container/qaxwidget.h container/qaxwidget_p.h
+ control/qaxaggregated.h
+ control/qaxbindable.h
+ control/qaxfactory.h
+ control/qclassfactory_p.h
+ shared/qaxtypes_p.h
+ NO_GENERATE_CPP_EXPORTS
+)
+qt_internal_add_docs(ActiveQt
doc/activeqt.qdocconf
)
-# special case end
-## Scopes:
-#####################################################################
-
-#### Keys ignored in scope 2:.:.:activeqt.pro:WIN32:
-# SUBDIRS = "axbase" "control" "container" "activeqt"
-# TEMPLATE = "subdirs"
-# activeqt.file = "activeqt.prx"
-
-#### Keys ignored in scope 3:.:.:activeqt.pro:else:
-# TEMPLATE = "aux"
diff --git a/src/activeqt/activeqt.pro b/src/activeqt/activeqt.pro
deleted file mode 100644
index 327c232..0000000
--- a/src/activeqt/activeqt.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-win32 {
- TEMPLATE = subdirs
-
- CONFIG += ordered
- activeqt.file = activeqt.prx
- SUBDIRS = axbase control container activeqt
-} else {
- # fake project for creating the documentation
- message("ActiveQt is a Windows Desktop-only module. Will just generate a docs target.")
- TEMPLATE = aux
- CONFIG += force_qt
- QMAKE_DOCS = $$PWD/doc/activeqt.qdocconf
-}
-
diff --git a/src/activeqt/axbase/CMakeLists.txt b/src/activeqt/axbase/CMakeLists.txt
index 787d240..aba9ebc 100644
--- a/src/activeqt/axbase/CMakeLists.txt
+++ b/src/activeqt/axbase/CMakeLists.txt
@@ -1,10 +1,11 @@
-# Generated from axbase.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## AxBase Module:
#####################################################################
-qt_add_module(AxBase
+qt_internal_add_module(AxBasePrivate
STATIC
INTERNAL_MODULE
SOURCES
@@ -22,15 +23,13 @@ qt_add_module(AxBase
Qt::Gui
Qt::GuiPrivate
Qt::Widgets
+ NO_GENERATE_CPP_EXPORTS
)
-#### Keys ignored in scope 1:.:.:axbase.pro:<TRUE>:
-# MODULE = "axbase"
-
## Scopes:
#####################################################################
-qt_extend_target(AxBase CONDITION MINGW
+qt_internal_extend_target(AxBasePrivate CONDITION MINGW
LIBRARIES
uuid
)
diff --git a/src/activeqt/axbase/axbase.pro b/src/activeqt/axbase/axbase.pro
deleted file mode 100644
index 2c53614..0000000
--- a/src/activeqt/axbase/axbase.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TARGET = QtAxBase
-MODULE = axbase
-
-QT += core-private gui-private widgets
-CONFIG += static internal_module
-
-load(qt_module)
-
-LIBS_PRIVATE += -lole32 -loleaut32 -luser32 -lgdi32 -ladvapi32
-mingw: LIBS_PRIVATE += -luuid
-
-HEADERS = \
- qaxtypefunctions_p.h \
- qaxutils_p.h
-
-SOURCES = \
- qaxtypefunctions.cpp \
- qaxutils.cpp
diff --git a/src/activeqt/axbase/qaxtypefunctions.cpp b/src/activeqt/axbase/qaxtypefunctions.cpp
index c1b76f5..8cba274 100644
--- a/src/activeqt/axbase/qaxtypefunctions.cpp
+++ b/src/activeqt/axbase/qaxtypefunctions.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <qt_windows.h>
#include "qaxtypefunctions_p.h"
@@ -63,7 +16,7 @@ QColor OLEColorToQColor(uint col)
return QColor(GetRValue(col),GetGValue(col),GetBValue(col));
}
-/*!
+/*
Copies the data in \a var into \a data.
Used by
@@ -76,88 +29,88 @@ QColor OLEColorToQColor(uint col)
- internalInvoke(update out parameters/return value)
*/
-bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeName, uint type)
+bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeName, int type)
{
if (!data)
return true;
- if (type == QMetaType::QVariant || type == uint(QVariant::LastType) || (type == 0 && typeName == "QVariant")) {
+ if (type == QMetaType::QVariant || (type == QMetaType::UnknownType && typeName == "QVariant")) {
*reinterpret_cast<QVariant *>(data) = var;
return true;
}
- switch (var.type()) {
- case QVariant::Invalid:
+ switch (var.metaType().id()) {
+ case QMetaType::UnknownType:
break;
- case QVariant::String:
+ case QMetaType::QString:
*reinterpret_cast<QString *>(data) = var.toString();
break;
- case QVariant::Int:
+ case QMetaType::Int:
*reinterpret_cast<int *>(data) = var.toInt();
break;
- case QVariant::UInt:
+ case QMetaType::UInt:
*reinterpret_cast<uint *>(data) = var.toUInt();
break;
- case QVariant::Bool:
+ case QMetaType::Bool:
*reinterpret_cast<bool *>(data) = var.toBool();
break;
- case QVariant::Double:
+ case QMetaType::Double:
*reinterpret_cast<double *>(data) = var.toDouble();
break;
- case QVariant::Color:
+ case QMetaType::QColor:
*reinterpret_cast<QColor *>(data) = qvariant_cast<QColor>(var);
break;
- case QVariant::Date:
+ case QMetaType::QDate:
*reinterpret_cast<QDate *>(data) = var.toDate();
break;
- case QVariant::Time:
+ case QMetaType::QTime:
*reinterpret_cast<QTime *>(data) = var.toTime();
break;
- case QVariant::DateTime:
+ case QMetaType::QDateTime:
*reinterpret_cast<QDateTime *>(data) = var.toDateTime();
break;
- case QVariant::Font:
+ case QMetaType::QFont:
*reinterpret_cast<QFont *>(data) = qvariant_cast<QFont>(var);
break;
- case QVariant::Pixmap:
+ case QMetaType::QPixmap:
*reinterpret_cast<QPixmap *>(data) = qvariant_cast<QPixmap>(var);
break;
#ifndef QT_NO_CURSOR
- case QVariant::Cursor:
+ case QMetaType::QCursor:
*reinterpret_cast<QCursor *>(data) = qvariant_cast<QCursor>(var);
break;
#endif
- case QVariant::List:
+ case QMetaType::QVariantList:
*reinterpret_cast<QVariantList *>(data) = var.toList();
break;
- case QVariant::StringList:
+ case QMetaType::QStringList:
*reinterpret_cast<QStringList *>(data) = var.toStringList();
break;
- case QVariant::ByteArray:
+ case QMetaType::QByteArray:
*reinterpret_cast<QByteArray *>(data) = var.toByteArray();
break;
- case QVariant::LongLong:
+ case QMetaType::LongLong:
*reinterpret_cast<qint64 *>(data) = var.toLongLong();
break;
- case QVariant::ULongLong:
+ case QMetaType::ULongLong:
*reinterpret_cast<quint64 *>(data) = var.toULongLong();
break;
- case QVariant::Rect:
+ case QMetaType::QRect:
*reinterpret_cast<QRect *>(data) = var.toRect();
break;
- case QVariant::Size:
+ case QMetaType::QSize:
*reinterpret_cast<QSize *>(data) = var.toSize();
break;
- case QVariant::Point:
+ case QMetaType::QPoint:
*reinterpret_cast<QPoint *>(data) = var.toPoint();
break;
- case QVariant::UserType:
- *reinterpret_cast<void **>(data) =
- *reinterpret_cast<void **>(const_cast<void *>(var.constData()));
-// qVariantGet(var, *(void**)data, typeName);
- break;
default:
- qWarning("QVariantToVoidStar: Unhandled QVariant type");
+ if (var.metaType().id() >= QMetaType::User) {
+ *reinterpret_cast<void **>(data) =
+ *reinterpret_cast<void **>(const_cast<void *>(var.constData()));
+ } else {
+ qWarning("QVariantToVoidStar: Unhandled QVariant type");
+ }
return false;
}
diff --git a/src/activeqt/axbase/qaxtypefunctions_p.h b/src/activeqt/axbase/qaxtypefunctions_p.h
index 7ce9067..ccc14ad 100644
--- a/src/activeqt/axbase/qaxtypefunctions_p.h
+++ b/src/activeqt/axbase/qaxtypefunctions_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXTYPEFUNCTIONS_P_H
#define QAXTYPEFUNCTIONS_P_H
@@ -99,7 +52,8 @@ static inline uint QColorToOLEColor(const QColor &col)
}
extern QColor OLEColorToQColor(uint col);
-extern bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeName, uint type = 0);
+extern bool QVariantToVoidStar(const QVariant &var, void *data,
+ const QByteArray &typeName, int type = 0);
extern void clearVARIANT(VARIANT *var);
#define QAX_INPROC_SERVER (0x51540001)
diff --git a/src/activeqt/axbase/qaxutils.cpp b/src/activeqt/axbase/qaxutils.cpp
index 3514558..f93910a 100644
--- a/src/activeqt/axbase/qaxutils.cpp
+++ b/src/activeqt/axbase/qaxutils.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxutils_p.h"
diff --git a/src/activeqt/axbase/qaxutils_p.h b/src/activeqt/axbase/qaxutils_p.h
index 5324dc5..ebc784c 100644
--- a/src/activeqt/axbase/qaxutils_p.h
+++ b/src/activeqt/axbase/qaxutils_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXUTILS_P_H
#define QAXUTILS_P_H
diff --git a/src/activeqt/container/CMakeLists.txt b/src/activeqt/container/CMakeLists.txt
index 0f2ac6d..6458d3e 100644
--- a/src/activeqt/container/CMakeLists.txt
+++ b/src/activeqt/container/CMakeLists.txt
@@ -1,10 +1,11 @@
-# Generated from container.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## AxContainer Module:
#####################################################################
-qt_add_module(AxContainer
+qt_internal_add_module(AxContainer
STATIC
QMAKE_MODULE_CONFIG dumpcpp
SOURCES
@@ -29,8 +30,11 @@ qt_add_module(AxContainer
Qt::Widgets
ENABLE_AUTOGEN_TOOLS
uic
+ NO_GENERATE_CPP_EXPORTS
)
-#### Keys ignored in scope 1:.:.:container.pro:<TRUE>:
-# MODULE = "axcontainer"
-# MODULE_CONFIG = "dumpcpp"
+set_source_files_properties(qaxbase.cpp # defines QT_CHECK_STATE
+ qaxscriptwrapper.cpp # references qAxFactory()
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+qt_internal_add_sync_header_dependencies(AxContainer AxServer)
diff --git a/src/activeqt/container/Qt6AxContainerMacros.cmake b/src/activeqt/container/Qt6AxContainerMacros.cmake
new file mode 100644
index 0000000..4d3bd7e
--- /dev/null
+++ b/src/activeqt/container/Qt6AxContainerMacros.cmake
@@ -0,0 +1,106 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Generates a C++ namespace for a type library and adds generated sources to the target. Arguments:
+#
+# LIBRARIES: List of type libraries. A type library (.tlb) is a binary file that stores information
+# about a COM or DCOM object's properties and methods in a form that is accessible to other
+# applications at runtime. The list may contain either the path to the library or the name
+# of the library.
+# If the library name is specified, the function will search for the library according to the
+# CMake find_file function rules. See https://cmake.org/cmake/help/latest/command/find_file.html
+# for details.
+# Note: The library name must include a file suffix, e.g "ieframe.dll".
+# LIBRARIES also may contain the library UUID in the following format:
+# <generated_files_basename>:<{00000000-0000-0000-0000-000000000000}>
+# The 'generated_files_basename' may contain ASCII letters, numbers and underscores and will be
+# used as the base name for the generated files.
+#
+# OUTPUT_DIRECTORY: Custom location of the generated source files.
+# ${CMAKE_CURRENT_BINARY_DIR} is the default location if not specified. (OPTIONAL)
+#
+# COMPAT: Adds compatibility flag to the dumpcpp call, that generates namespace with
+# dynamicCall-compatible API. (OPTIONAL)
+#
+# This function is currently in Technical Preview.
+# Its signature and behavior might change.
+function(qt6_target_typelibs target)
+ cmake_parse_arguments(arg "COMPAT" "OUTPUT_DIRECTORY" "LIBRARIES" ${ARGN})
+ if(NOT arg_LIBRARIES)
+ message(FATAL_ERROR "qt6_target_typelibs: LIBRARIES are not specified")
+ endif()
+
+ set(output_directory "${CMAKE_CURRENT_BINARY_DIR}")
+ if(arg_OUTPUT_DIRECTORY)
+ set(output_directory "${arg_OUTPUT_DIRECTORY}")
+ endif()
+
+ set(extra_args "")
+ if(arg_COMPAT)
+ list(APPEND extra_args "-compat")
+ endif()
+
+ set(out_sources "")
+
+ # CMake doesn't support quantifiers.
+ set(hex_num "[a-fA-F0-9][a-fA-F0-9]")
+ set(hex_two "${hex_num}${hex_num}")
+ set(hex_four "${hex_two}${hex_two}")
+ set(hex_six "${hex_two}${hex_two}${hex_two}")
+
+ set(ident_ "[a-zA-Z0-9_]")
+ foreach(lib IN LISTS arg_LIBRARIES)
+ unset(libpath CACHE)
+ if(lib MATCHES "^(${ident_}+):({${hex_four}-${hex_two}-${hex_two}-${hex_two}-${hex_six}})$")
+ set(libpath "${CMAKE_MATCH_2}")
+ set(out_basename "${CMAKE_MATCH_1}")
+ string(MAKE_C_IDENTIFIER "${out_basename}" out_basename_valid)
+ if(NOT "${out_basename_valid}" STREQUAL "${out_basename}")
+ message("The specified generated files basename ${out_basename} is not valid\
+C indentifier")
+ endif()
+ else()
+ # If lib exists on the filesystem, we assume the user provided the path.
+ get_filename_component(lib_abspath "${lib}" ABSOLUTE)
+ if(EXISTS "${lib_abspath}")
+ set(libpath "${lib_abspath}")
+ else()
+ find_file(libpath NAMES "${lib}")
+ if(NOT libpath)
+ message(FATAL_ERROR "qt6_target_typelibs: Unable to find type lib with name ${lib}")
+ endif()
+ endif()
+
+ get_filename_component(out_basename "${libpath}" NAME_WE)
+ endif()
+
+ set(out_filebasepath "${output_directory}/${out_basename}")
+ set(out_header "${out_filebasepath}.h")
+ set_source_files_properties("${out_header}" PROPERTIES HEADER_FILE_ONLY TRUE)
+ set(out_source "${out_filebasepath}.cpp")
+ list(APPEND out_sources "${out_header}" "${out_source}")
+
+ _qt_internal_get_tool_wrapper_script_path(tool_wrapper)
+ set(dumpcpp_bin "${tool_wrapper}" "$<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::dumpcpp>")
+
+ add_custom_command(OUTPUT "${out_header}" "${out_source}"
+ COMMAND ${dumpcpp_bin}
+ "${libpath}" -o "${out_filebasepath}"
+ ${extra_args}
+ DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::dumpcpp
+ WORKING_DIRECTORY "${output_directory}"
+ COMMENT "Generate type lib sources ${out_header} ${out_source}..."
+ )
+ endforeach()
+
+ set_source_files_properties("${out_sources}" PROPERTIES SKIP_AUTOGEN TRUE)
+
+ target_sources(${target} PRIVATE "${out_sources}")
+ target_include_directories(${target} PRIVATE "${output_directory}")
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_target_typelibs)
+ qt6_target_typelibs(${ARGV})
+ endfunction()
+endif()
diff --git a/src/activeqt/container/container.pro b/src/activeqt/container/container.pro
deleted file mode 100644
index f0b482b..0000000
--- a/src/activeqt/container/container.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET = QtAxContainer
-
-QT += widgets
-QT_PRIVATE += core-private gui-private widgets-private axbase-private
-CONFIG += static
-
-HEADERS = ../control/qaxaggregated.h \
- qaxbase.h \
- qaxbase_p.h \
- qaxwidget.h \
- qaxwidget_p.h \
- qaxobject.h \
- qaxobject_p.h \
- qaxobjectinterface.h \
- qaxscript.h \
- qaxselect.h \
- ../shared/qaxtypes_p.h
-
-SOURCES = qaxbase.cpp \
- qaxdump.cpp \
- qaxwidget.cpp \
- qaxobject.cpp \
- qaxscript.cpp \
- qaxscriptwrapper.cpp \
- qaxselect.cpp \
- ../shared/qaxtypes.cpp
-
-FORMS = qaxselect.ui
-
-MODULE = axcontainer
-MODULE_CONFIG = dumpcpp
-load(qt_module)
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 21b94e1..3463f3c 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//#define QAX_NO_CLASSINFO
@@ -68,7 +21,8 @@
#include <qsettings.h>
#include <qdebug.h>
#include <QGuiApplication>
-#include <qpa/qplatformnativeinterface.h>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#ifndef QT_NO_THREAD
# include <qmutex.h>
@@ -77,6 +31,7 @@
#include <private/qobject_p.h>
#include <private/qmetaobject_p.h>
#include <private/qmetaobjectbuilder_p.h>
+#include <private/qtools_p.h>
#include <qt_windows.h>
#include <ocidl.h>
@@ -185,7 +140,7 @@ int QMetaObjectExtra::numParameter(const QByteArray &prototype) const
if (!memberInfo.contains(prototype))
parsePrototype(prototype);
- return memberInfo.value(prototype).count();
+ return memberInfo.value(prototype).size();
}
QByteArray QMetaObjectExtra::paramType(const QByteArray &prototype, int index, bool *out) const
@@ -197,7 +152,7 @@ QByteArray QMetaObjectExtra::paramType(const QByteArray &prototype, int index, b
*out = false;
const auto plist = memberInfo.value(prototype);
- if (index > plist.count() - 1)
+ if (index > plist.size() - 1)
return QByteArray();
QByteArray param(plist.at(index));
@@ -387,7 +342,7 @@ public:
if (qobject->signalsBlocked())
return S_OK;
- const QMetaObject *meta = combase->axBaseMetaObject();
+ const QMetaObject *meta = qobject->metaObject();
const QMetaObjectExtra &moExtra = moextra_cache.value(meta);
int index = -1;
@@ -444,7 +399,7 @@ public:
varp[p + 1] = VARIANTToQVariant(pDispParams->rgvarg[pcount - p - 1], ptype);
argv_pointer[p + 1] = nullptr;
if (varp[p + 1].isValid()) {
- if (varp[p + 1].type() == QVariant::UserType) {
+ if (varp[p + 1].metaType().id() >= QMetaType::User) {
argv[p + 1] = varp[p + 1].data();
} else if (ptype == "QVariant") {
argv[p + 1] = varp + p + 1;
@@ -496,7 +451,11 @@ public:
if (dispID == DISPID_UNKNOWN || !combase)
return S_OK;
- const QMetaObject *meta = combase->axBaseMetaObject();
+ QObject *qobject = combase->qObject();
+ if (qobject->signalsBlocked())
+ return S_OK;
+
+ const QMetaObject *meta = qobject->metaObject();
if (!meta)
return S_OK;
@@ -504,10 +463,6 @@ public:
if (propname.isEmpty())
return S_OK;
- QObject *qobject = combase->qObject();
- if (qobject->signalsBlocked())
- return S_OK;
-
// emit the generic signal
combase->d->emitPropertyChanged(QString::fromLatin1(propname));
@@ -528,7 +483,7 @@ public:
const QMetaProperty metaProp = meta->property(meta->indexOfProperty(propname));
void *argv[] = {nullptr, var.data()};
- if (metaProp.type() == QVariant::Type(QMetaType::QVariant) || metaProp.type() == QVariant::LastType)
+ if (metaProp.metaType().id() == QMetaType::QVariant)
argv[1] = &var;
// emit the "changed" signal
@@ -581,8 +536,8 @@ QAxBasePrivate::QAxBasePrivate()
QMutexLocker locker(&cache_mutex);
mo_cache_ref++;
- qRegisterMetaType<IUnknown*>("IUnknown*", &ptr);
- qRegisterMetaType<IDispatch*>("IDispatch*", &disp);
+ qRegisterMetaType<IUnknown*>("IUnknown*");
+ qRegisterMetaType<IDispatch*>("IDispatch*");
}
QAxBasePrivate::~QAxBasePrivate()
@@ -623,7 +578,7 @@ QByteArray QAxEventSink::findProperty(DISPID dispID)
typeinfo->Release();
QByteArray propsignal(propname + "Changed(");
- const QMetaObject *mo = combase->axBaseMetaObject();
+ const QMetaObject *mo = combase->qObject()->metaObject();
int index = mo->indexOfProperty(propname);
const QMetaProperty prop = mo->property(index);
propsignal += prop.typeName();
@@ -818,7 +773,7 @@ QVariant QAxBasePrivate::VARIANTToQVariant(const VARIANT &arg, const QByteArray
*/
/*!
- \typedef QAxBase::PropertyBag
+ \typealias QAxBase::PropertyBag
A QMap<QString,QVariant> that can store properties as name:value pairs.
*/
@@ -920,6 +875,9 @@ bool QAxBase::setControl(const QString &c)
return true;
}
+/*!
+ Returns the ActiveX control.
+*/
QString QAxBase::control() const
{
return d->ctrl;
@@ -1114,6 +1072,8 @@ long QAxBase::indexOfVerb(const QString &verb) const
*/
bool QAxBase::initialize(IUnknown **ptr)
{
+ using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
+
if (*ptr || control().isEmpty())
return false;
@@ -1121,11 +1081,8 @@ bool QAxBase::initialize(IUnknown **ptr)
// Otherwise painter can get corrupted if Invoke or some other COM method that cause Windows
// messages to be processed is called during an existing paint operation when WM_PAINT is
// also in the queue.
- static bool asyncExposeSet = false;
- if (!asyncExposeSet && QGuiApplication::platformNativeInterface()) {
- QGuiApplication::platformNativeInterface()->setProperty("asyncExpose", QVariant(true));
- asyncExposeSet = true;
- }
+ if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration()))
+ nativeWindowsApp->setAsyncExpose(true);
*ptr = nullptr;
@@ -1800,6 +1757,63 @@ MetaObjectGenerator::~MetaObjectGenerator()
bool qax_dispatchEqualsIDispatch = true;
QByteArrayList qax_qualified_usertypes;
+// Value strings for enums
+QHash<QByteArray, QByteArray> qax_enum_values;
+
+// Read enum values
+QList<QPair<QByteArray, int> > qax_readEnumValues(ITypeLib *typelib, UINT index)
+{
+ QList<QPair<QByteArray, int> > result;
+
+ // Get the type information for the enum
+ ITypeInfo *enuminfo = nullptr;
+ typelib->GetTypeInfo(index, &enuminfo);
+ if (!enuminfo)
+ return result;
+
+ // Get the attributes of the enum type
+ TYPEATTR *typeattr = nullptr;
+ enuminfo->GetTypeAttr(&typeattr);
+ if (typeattr == nullptr) {
+ enuminfo->Release();
+ return result;
+ }
+
+ // Get all values of the enumeration
+ result.reserve(typeattr->cVars);
+ for (UINT vd = 0; vd < typeattr->cVars; ++vd) {
+ VARDESC *vardesc = nullptr;
+ enuminfo->GetVarDesc(vd, &vardesc);
+ if (vardesc != nullptr) {
+ if (vardesc->varkind == VAR_CONST) {
+ const int value = vardesc->lpvarValue->lVal;
+ QByteArray valueName = qaxTypeInfoName(enuminfo, vardesc->memid);
+ result.append({valueName, value});
+ }
+ enuminfo->ReleaseVarDesc(vardesc);
+ }
+ }
+ enuminfo->ReleaseTypeAttr(typeattr);
+ enuminfo->Release();
+ return result;
+}
+
+// Format enum values into a string v1=1, v2=2,...
+static QByteArray enumValueString(ITypeLib *typelib, UINT index)
+{
+ QByteArray result;
+ const auto enumValues = qax_readEnumValues(typelib, index);
+ const auto last = enumValues.size() - 1;
+ for (qsizetype i = 0; i <= last; ++i) {
+ const auto &enumValue = enumValues.at(i);
+ result += " " + enumValue.first + '='
+ + QByteArray::number(enumValue.second);
+ if (i < last)
+ result += ',';
+ result += '\n';
+ }
+ return result;
+}
QByteArray MetaObjectGenerator::usertypeToString(const TYPEDESC &tdesc, ITypeInfo *info, const QByteArray &function)
{
@@ -1856,8 +1870,11 @@ QByteArray MetaObjectGenerator::usertypeToString(const TYPEDESC &tdesc, ITypeInf
}
break;
case TKIND_ENUM:
- if (typeLibName != current_typelib)
+ if (typeLibName != current_typelib) {
userTypeName.prepend(typeLibName + "::");
+ // For dumpcpp
+ qax_enum_values.insert(userTypeName, enumValueString(usertypelib, index));
+ }
if (!qax_qualified_usertypes.contains("enum " + userTypeName))
qax_qualified_usertypes << "enum " + userTypeName;
break;
@@ -2092,7 +2109,7 @@ void MetaObjectGenerator::readClassInfo()
if (dispInfo && !typelib)
dispInfo->GetContainingTypeLib(&typelib, &index);
- if (!typelib) {
+ if (!typelib && !that->control().isEmpty()) {
QSettings controls(QLatin1String("HKEY_LOCAL_MACHINE\\Software"), QSettings::NativeFormat);
QString tlid = controls.value(QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/TypeLib/.")).toString();
QString tlfile;
@@ -2159,8 +2176,11 @@ void MetaObjectGenerator::readClassInfo()
}
}
- if (!d || !dispInfo || !cacheKey.isEmpty() || !d->tryCache)
+ if (!d || !dispInfo || !cacheKey.isEmpty() || !d->tryCache) {
+ if (disp && !dispInfo)
+ qWarning("%s: IDispatch %p does not provide interface information", Q_FUNC_INFO, disp);
return;
+ }
TYPEATTR *typeattr = nullptr;
dispInfo->GetTypeAttr(&typeattr);
@@ -2207,10 +2227,9 @@ void MetaObjectGenerator::readEnumInfo()
TYPEKIND typekind;
typelib->GetTypeInfoType(i, &typekind);
if (typekind == TKIND_ENUM) {
- // Get the type information for the enum
- ITypeInfo *enuminfo = nullptr;
- typelib->GetTypeInfo(i, &enuminfo);
- if (!enuminfo)
+ // Get the values of the enum
+ const auto values = qax_readEnumValues(typelib, i);
+ if (values.isEmpty())
continue;
// Get the name of the enumeration
@@ -2224,31 +2243,15 @@ void MetaObjectGenerator::readEnumInfo()
}
// Get the attributes of the enum type
- TYPEATTR *typeattr = nullptr;
- enuminfo->GetTypeAttr(&typeattr);
- if (typeattr) {
- // Get all values of the enumeration
- for (UINT vd = 0; vd < typeattr->cVars; ++vd) {
- VARDESC *vardesc = nullptr;
- enuminfo->GetVarDesc(vd, &vardesc);
- if (vardesc && vardesc->varkind == VAR_CONST) {
- int value = vardesc->lpvarValue->lVal;
- int memid = vardesc->memid;
- // Get the name of the value
- QByteArray valueName = qaxTypeInfoName(enuminfo, memid);
- if (valueName.isEmpty())
- valueName = "value" + QByteArray::number(valueindex++);
- if (clashCheck.contains(QString::fromLatin1(valueName)))
- valueName += QByteArray::number(++clashIndex);
-
- clashCheck.insert(QString::fromLatin1(valueName));
- addEnumValue(enumName, valueName, value);
- }
- enuminfo->ReleaseVarDesc(vardesc);
- }
+ for (const auto &value : values) {
+ QByteArray valueName = value.first;
+ if (valueName.isEmpty())
+ valueName = "value" + QByteArray::number(valueindex++);
+ if (clashCheck.contains(QString::fromLatin1(valueName)))
+ valueName += QByteArray::number(++clashIndex);
+ clashCheck.insert(QString::fromLatin1(valueName));
+ addEnumValue(enumName, valueName, value.second);
}
- enuminfo->ReleaseTypeAttr(typeattr);
- enuminfo->Release();
}
}
@@ -2282,7 +2285,7 @@ void MetaObjectGenerator::addSetterSlot(const QByteArray &property)
if (isupper(prototype.at(0))) {
prototype.insert(0, "Set");
} else {
- prototype[0] = char(toupper(prototype[0]));
+ prototype[0] = QtMiscUtils::toAsciiUpper(prototype[0]);
prototype.insert(0, "set");
}
const QByteArray type = propertyType(property);
@@ -2315,8 +2318,8 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
if (funcdesc->invkind == INVOKE_FUNC && type == hresult)
type = nullptr;
- int p;
- for (p = 1; p < names.count(); ++p) {
+ qsizetype p;
+ for (p = 1; p < names.size(); ++p) {
// parameter
QByteArray paramName = names.at(p);
bool optional = p > (funcdesc->cParams - funcdesc->cParamsOpt);
@@ -2415,7 +2418,7 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
if (funcdesc->cParams - funcdesc->cParamsOpt <= 1) {
bool dontBreak = false;
// getter with non-default-parameters -> fall through to function handling
- if (funcdesc->invkind == INVOKE_PROPERTYGET && parameters.count() && funcdesc->cParams - funcdesc->cParamsOpt) {
+ if (funcdesc->invkind == INVOKE_PROPERTYGET && !parameters.isEmpty() && funcdesc->cParams - funcdesc->cParamsOpt) {
dontBreak = true;
} else {
uint flags = Readable;
@@ -2480,7 +2483,7 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
set = "Set";
} else {
set = "set";
- prototype[0] = char(toupper(prototype[0]));
+ prototype[0] = QtMiscUtils::toAsciiUpper(prototype[0]);
}
prototype = set + prototype;
@@ -2492,9 +2495,9 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
bool defargs;
do {
QByteArray pnames;
- for (int p = 0; p < parameters.count(); ++p) {
+ for (qsizetype p = 0; p < parameters.size(); ++p) {
pnames += parameters.at(p);
- if (p < parameters.count() - 1)
+ if (p < parameters.size() - 1)
pnames += ',';
}
defargs = pnames.contains("=0");
@@ -2506,7 +2509,7 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
if (defargs) {
parameters.takeLast();
- int lastParam = prototype.lastIndexOf(',');
+ qsizetype lastParam = prototype.lastIndexOf(',');
if (lastParam == -1)
lastParam = prototype.indexOf('(') + 1;
prototype.truncate(lastParam);
@@ -2719,9 +2722,9 @@ void MetaObjectGenerator::readEventInterface(ITypeInfo *eventinfo, IConnectionPo
prototype = createPrototype(/*in*/ funcdesc, eventinfo, names, /*out*/type, parameters);
if (!hasSignal(prototype)) {
QByteArray pnames;
- for (int p = 0; p < parameters.count(); ++p) {
+ for (qsizetype p = 0; p < parameters.size(); ++p) {
pnames += parameters.at(p);
- if (p < parameters.count() - 1)
+ if (p < parameters.size() - 1)
pnames += ',';
}
addSignal(prototype, pnames);
@@ -2942,6 +2945,7 @@ void MetaObjectGenerator::buildMethods(const QMap<QByteArray, Method> &map,
QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, const QByteArray &className)
{
+ QSignalBlocker blockSignals(that ? that->qObject() : nullptr);
if (that) {
readClassInfo();
if (typelib) {
@@ -2992,7 +2996,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
// each enum in form name\0
for (auto it = enum_list.cbegin(), end = enum_list.cend(); it != end; ++it) {
QMetaEnumBuilder enumBuilder = builder.addEnumerator(it.key());
- for (auto v : it.value())
+ for (const auto &v : it.value())
enumBuilder.addKey(v.first, v.second);
}
@@ -3065,7 +3069,7 @@ const QMetaObject *QAxBase::axBaseMetaObject() const
*/
void QAxBase::connectNotify()
{
- if (d->eventSink.count()) // already listening
+ if (!d->eventSink.isEmpty()) // already listening
return;
IEnumConnectionPoints *epoints = nullptr;
@@ -3112,7 +3116,7 @@ void QAxBase::connectNotify()
IID conniid;
cpoint->GetConnectionInterface(&conniid);
// workaround for typelibrary bug of Word.Application
- QString connuuid(QUuid(conniid).toString());
+ const QUuid connuuid(conniid);
if (d->eventSink.contains(connuuid))
break;
@@ -3162,8 +3166,8 @@ void QAxBase::connectNotify()
typelib->Release();
// make sure we don't try again
- if (!d->eventSink.count())
- d->eventSink.insert(QString(), 0);
+ if (d->eventSink.isEmpty())
+ d->eventSink.insert(QUuid{}, nullptr);
}
/*!
@@ -3259,7 +3263,7 @@ bool QAxBasePrivate::checkHRESULT(HRESULT hres, EXCEPINFO *exc, const QString &n
*/
int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
{
- const QMetaObject *mo = axBaseMetaObject();
+ const QMetaObject *mo = qObject()->metaObject();
const QMetaProperty prop = mo->property(index + mo->propertyOffset());
QByteArray propname = prop.name();
@@ -3298,11 +3302,12 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &params, &arg, &excepinfo, nullptr);
// map result VARIANTARG to void*
- uint type = QVariant::Int;
+ int type = QMetaType::Int;
if (!prop.isEnumType())
- type = prop.type();
+ type = prop.metaType().id();
QVariantToVoidStar(VARIANTToQVariant(arg, proptype, type), *v, proptype, type);
- if ((arg.vt != VT_DISPATCH && arg.vt != VT_UNKNOWN) || type == QVariant::Pixmap || type == QVariant::Font)
+ if ((arg.vt != VT_DISPATCH && arg.vt != VT_UNKNOWN)
+ || type == QMetaType::QPixmap || type == QMetaType::QFont)
clearVARIANT(&arg);
}
break;
@@ -3329,7 +3334,7 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
qvar = *reinterpret_cast<const QVariant *>(v[0]);
proptype = nullptr;
} else {
- qvar = QVariant(typeId, v[0]);
+ qvar = QVariant(prop.metaType(), v[0]);
if (typeId < QMetaType::User)
proptype = moExtra.propertyType(propname);
}
@@ -3363,7 +3368,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
if (!disp)
return index;
- const QMetaObject *mo = axBaseMetaObject();
+ const QMetaObject *mo = qObject()->metaObject();
// get the slot information
const QMetaMethod slot = mo->method(index + mo->methodOffset());
Q_ASSERT(slot.methodType() == QMetaMethod::Slot);
@@ -3409,11 +3414,11 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
int p;
for (p = 0; p < int(params.cArgs); ++p) {
bool out;
- QByteArray type = moExtra.paramType(signature, p, &out);
- QVariant::Type vt = QVariant::nameToType(type);
+ const QByteArray type = moExtra.paramType(signature, p, &out);
+ const QMetaType metaType = QMetaType::fromName(type);
QVariant qvar;
- if (vt != QVariant::UserType && vt != int(QMetaType::QVariant))
- qvar = QVariant(vt, v[p + 1]);
+ if (metaType.id() != QMetaType::User && metaType.id() != QMetaType::QVariant)
+ qvar = QVariant(metaType, v[p + 1]);
if (!qvar.isValid()) {
if (type == "IDispatch*") {
@@ -3428,7 +3433,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
} else if (mo->indexOfEnumerator(type) != -1) {
qvar = *reinterpret_cast<const int *>(v[p + 1]);
} else {
- qvar = QVariant(QMetaType::type(type), v[p + 1]);
+ qvar = QVariant(metaType, v[p + 1]);
}
}
@@ -3448,7 +3453,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
// get return value
if (hres == S_OK && ret.vt != VT_EMPTY) {
- QVariantToVoidStar(VARIANTToQVariant(ret, slot.typeName()), v[0], slot.typeName());
+ QVariantToVoidStar(VARIANTToQVariant(ret, slot.typeName(), slot.returnType()), v[0], slot.typeName());
if (ret.vt != VT_DISPATCH)
clearVARIANT(&ret);
else
@@ -3481,7 +3486,7 @@ int QAxBasePrivate::qtStaticMetaCall(QAxBase *_t, QMetaObject::Call _c, int _id,
if (_c != QMetaObject::InvokeMetaMethod)
return 0;
Q_ASSERT(_t != nullptr);
- const QMetaObject *mo = _t->axBaseMetaObject();
+ const QMetaObject *mo = _t->qObject()->metaObject();
switch (mo->method(_id + mo->methodOffset()).methodType()) {
case QMetaMethod::Signal:
QMetaObject::activate(_t->qObject(), mo, _id, _a);
@@ -3497,7 +3502,7 @@ int QAxBasePrivate::qtStaticMetaCall(QAxBase *_t, QMetaObject::Call _c, int _id,
int QAxBasePrivate::qtMetaCall(QMetaObject::Call call, int id, void **v)
{
- const QMetaObject *mo = q->axBaseMetaObject();
+ const QMetaObject *mo = q->qObject()->metaObject();
if (q->isNull() && mo->property(id + mo->propertyOffset()).name() != QByteArray("control")) {
qWarning("QAxBase::qt_metacall: Object is not initialized, or initialization failed");
return id;
@@ -3522,7 +3527,7 @@ int QAxBasePrivate::qtMetaCall(QMetaObject::Call call, int id, void **v)
#ifdef QT_CHECK_STATE
static void qax_noSuchFunction(int disptype, const QByteArray &name, const QByteArray &function, const QAxBase *that)
{
- const QMetaObject *metaObject = that->axBaseMetaObject();
+ const QMetaObject *metaObject = that->qObject()->metaObject();
const char *coclass = metaObject->classInfo(metaObject->indexOfClassInfo("CoClass")).value();
if (disptype == DISPATCH_METHOD) {
@@ -3570,11 +3575,11 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
return false;
}
- const QMetaObject *mo = axBaseMetaObject();
+ const QMetaObject *mo = qObject()->metaObject();
Q_ASSERT(d->metaobj);
const QMetaObjectExtra &moExtra = moextra_cache.value(d->metaobj);
- int varc = vars.count();
+ qsizetype varc = vars.size();
QByteArray normFunction = QMetaObject::normalizedSignature(name);
QByteArray function(normFunction);
@@ -3684,7 +3689,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
curArg += cc;
}
- varc = vars.count();
+ varc = vars.size();
}
} else {
if (d->useMetaObject)
@@ -3706,7 +3711,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
varc = qMin(varc, moExtra.numParameter(normFunction));
arg = varc <= QAX_NUM_PARAMS ? staticarg : new VARIANT[varc];
outArgs = QBitArray(varc);
- for (int i = 0; i < varc; ++i) {
+ for (qsizetype i = 0; i < varc; ++i) {
const QVariant &var = vars.at(i);
VariantInit(arg + (varc - i - 1));
bool out = false;
@@ -3718,7 +3723,9 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
else
paramType = moExtra.paramType(normFunction, i, &out);
- if ((!parse && d->useMetaObject && var.type() == QVariant::String) || var.type() == QVariant::ByteArray) {
+ const int vType = var.metaType().id();
+ if ((!parse && d->useMetaObject && vType == QMetaType::QString)
+ || vType == QMetaType::QByteArray) {
int enumIndex =mo->indexOfEnumerator(paramType);
if (enumIndex != -1) {
QMetaEnum metaEnum =mo->enumerator(enumIndex);
@@ -3765,14 +3772,14 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, disptype, &params, nullptr, &excepinfo, &argerr);
}
- if (disptype == (DISPATCH_METHOD|DISPATCH_PROPERTYGET) && hres == S_OK && varc) {
- for (int i = 0; i < varc; ++i)
+ if ((disptype & (DISPATCH_METHOD|DISPATCH_PROPERTYGET)) && hres == S_OK && varc) {
+ for (qsizetype i = 0; i < varc; ++i)
if ((arg[varc-i-1].vt & VT_BYREF) || outArgs[i]) // update out-parameters
vars[i] = VARIANTToQVariant(arg[varc-i-1], vars.at(i).typeName());
}
// clean up
- for (int i = 0; i < varc; ++i)
+ for (qsizetype i = 0; i < varc; ++i)
clearVARIANT(params.rgvarg+i);
if (arg && arg != staticarg)
delete[] arg;
@@ -3900,8 +3907,11 @@ QVariant QAxBase::dynamicCall(const char *function, QList<QVariant> &vars, unsig
return QVariant();
QVariant qvar = VARIANTToQVariant(res, rettype);
- if ((res.vt != VT_DISPATCH && res.vt != VT_UNKNOWN) || qvar.type() == QVariant::Pixmap || qvar.type() == QVariant::Font)
+ const int vType = qvar.metaType().id();
+ if ((res.vt != VT_DISPATCH && res.vt != VT_UNKNOWN)
+ || vType == QMetaType::QPixmap || vType == QMetaType::QFont) {
clearVARIANT(&res);
+ }
return qvar;
}
@@ -3980,7 +3990,7 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
if (res.pdispVal) {
if (rettype.isEmpty() || rettype == "IDispatch*" || rettype == "QVariant") {
object = new QAxObject(res.pdispVal, qObject());
- } else if (QMetaType::type(rettype)) {
+ } else if (QMetaType::fromName(rettype).id() != QMetaType::UnknownType) {
QVariant qvar = VARIANTToQVariant(res, rettype, 0);
object = *static_cast<QAxObject**>(qvar.data());
// qVariantGet(qvar, object, rettype);
@@ -3994,7 +4004,7 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
if (res.punkVal) {
if (rettype.isEmpty() || rettype == "IUnknown*") {
object = new QAxObject(res.punkVal, qObject());
- } else if (QMetaType::type(rettype)) {
+ } else if (QMetaType::fromName(rettype).id() != QMetaType::UnknownType) {
QVariant qvar = VARIANTToQVariant(res, rettype, 0);
object = *static_cast<QAxObject**>(qvar.data());
// qVariantGet(qvar, object, rettype);
@@ -4007,7 +4017,7 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
case VT_EMPTY:
#ifdef QT_CHECK_STATE
{
- auto mo = axBaseMetaObject();
+ auto mo = qObject()->metaObject();
const char *coclass = mo->classInfo(mo->indexOfClassInfo("CoClass")).value();
qWarning("QAxBase::querySubObject: %s: Error calling function or property in %s (%s)"
, name, control().toLatin1().data(), coclass ? coclass: "unknown");
@@ -4017,7 +4027,7 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
default:
#ifdef QT_CHECK_STATE
{
- auto mo = axBaseMetaObject();
+ auto mo = qObject()->metaObject();
const char *coclass = mo->classInfo(mo->indexOfClassInfo("CoClass")).value();
qWarning("QAxBase::querySubObject: %s: Method or property is not of interface type in %s (%s)"
, name, control().toLatin1().data(), coclass ? coclass: "unknown");
@@ -4124,7 +4134,7 @@ QAxBase::PropertyBag QAxBase::propertyBag() const
persist->Release();
return result;
}
- const QMetaObject *mo = axBaseMetaObject();
+ const QMetaObject *mo = qObject()->metaObject();
for (int p = mo->propertyOffset(); p < mo->propertyCount(); ++p) {
const QMetaProperty property = mo->property(p);
QVariant var = qObject()->property(property.name());
@@ -4164,7 +4174,7 @@ void QAxBase::setPropertyBag(const PropertyBag &bag)
pbag->Release();
persist->Release();
} else {
- const QMetaObject *mo = axBaseMetaObject();
+ const QMetaObject *mo = qObject()->metaObject();
for (int p = mo->propertyOffset(); p < mo->propertyCount(); ++p) {
const QMetaProperty property = mo->property(p);
QVariant var = bag.value(QLatin1String(property.name()));
@@ -4237,10 +4247,10 @@ QVariant QAxBase::asVariant() const
cn.remove(0, cn.lastIndexOf(':') + 1);
cn += '*';
QObject *object = qObject();
- int typeId = QMetaType::type(cn);
- if (typeId == QMetaType::UnknownType)
- typeId = qRegisterMetaType<QObject *>(cn);
- qvar = QVariant(typeId, &object);
+ QMetaType metaType = QMetaType::fromName(cn);
+ if (metaType.id() == QMetaType::UnknownType)
+ metaType = QMetaType(qRegisterMetaType<QObject *>(cn));
+ qvar = QVariant(metaType, &object);
}
return qvar;
@@ -4253,7 +4263,7 @@ void *qax_createObjectWrapper(int metaType, IUnknown *iface)
if (!iface)
return nullptr;
- void *object = QMetaType::create(metaType, nullptr);
+ void *object = QMetaType(metaType).create(nullptr);
QAxBasePrivate *d = reinterpret_cast<const QAxObject *>(object)->d;
d->ptr = iface;
diff --git a/src/activeqt/container/qaxbase.h b/src/activeqt/container/qaxbase.h
index 51e1e5f..1703fa3 100644
--- a/src/activeqt/container/qaxbase.h
+++ b/src/activeqt/container/qaxbase.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXBASE_H
#define QAXBASE_H
@@ -127,7 +80,7 @@ public:
void setClassContext(ulong classContext);
protected:
- explicit QAxBase();
+ QAxBase();
virtual bool initialize(IUnknown** ptr);
bool initializeRemote(IUnknown** ptr);
diff --git a/src/activeqt/container/qaxbase_p.h b/src/activeqt/container/qaxbase_p.h
index c7b11f2..2fd4901 100644
--- a/src/activeqt/container/qaxbase_p.h
+++ b/src/activeqt/container/qaxbase_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXBASE_P_H
#define QAXBASE_P_H
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp
index 98be9b6..5623e43 100644
--- a/src/activeqt/container/qaxdump.cpp
+++ b/src/activeqt/container/qaxdump.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxbase.h"
@@ -56,6 +9,8 @@
#include <quuid.h>
#include <qt_windows.h>
#include <qtextstream.h>
+#include <qiodevicebase.h>
+#include <private/qtools_p.h>
#include <ctype.h>
@@ -101,15 +56,15 @@ static inline QString docuFromName(ITypeInfo *typeInfo, const QString &name)
static QByteArray namedPrototype(const QByteArrayList &parameterTypes, const QByteArrayList &parameterNames, int numDefArgs = 0)
{
QByteArray prototype("(");
- for (int p = 0; p < parameterTypes.count(); ++p) {
+ for (qsizetype p = 0; p < parameterTypes.size(); ++p) {
prototype += parameterTypes.at(p);
- if (p < parameterNames.count())
+ if (p < parameterNames.size())
prototype += ' ' + parameterNames.at(p);
- if (numDefArgs >= parameterTypes.count() - p)
+ if (numDefArgs >= parameterTypes.size() - p)
prototype += " = 0";
- if (p < parameterTypes.count() - 1)
+ if (p < parameterTypes.size() - 1)
prototype += ", ";
}
prototype += ')';
@@ -119,14 +74,12 @@ static QByteArray namedPrototype(const QByteArrayList &parameterTypes, const QBy
static QByteArray toType(const QByteArray &t)
{
- QByteArray type = t;
- int vartype = QVariant::nameToType(type);
- if (vartype == QVariant::Invalid)
- type = "int";
+ QByteArray type = QMetaType::fromName(t).id() != QMetaType::UnknownType
+ ? t : QByteArrayLiteral("int");
if (type.at(0) == 'Q')
type.remove(0, 1);
- type[0] = toupper(type.at(0));
+ type[0] = QtMiscUtils::toAsciiLower(type.at(0));
if (type == "VariantList")
type = "List";
else if (type == "Map<QVariant,QVariant>")
@@ -151,7 +104,7 @@ QString qax_generateDocumentation(QAxBase *that)
dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
QString docu;
- QTextStream stream(&docu, QIODevice::WriteOnly);
+ QTextStream stream(&docu, QIODeviceBase::WriteOnly);
const QMetaObject *mo = that->axBaseMetaObject();
QString coClass = QLatin1String(mo->classInfo(mo->indexOfClassInfo("CoClass")).value());
@@ -224,7 +177,7 @@ QString qax_generateDocumentation(QAxBase *that)
detail += QLatin1String("<p>Or call the function directly:<pre>\n");
- bool hasParams = slot.parameterTypes().count() != 0;
+ const bool hasParams = !slot.parameterTypes().isEmpty();
if (hasParams)
detail += QLatin1String("\tQVariantList params = ...\n");
detail += QLatin1String("\t");
@@ -325,14 +278,14 @@ QString qax_generateDocumentation(QAxBase *that)
QLatin1String(type.constData()) +
QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
detail += docuFromName(typeInfo, QString::fromLatin1(name));
- QVariant::Type vartype = QVariant::nameToType(type);
if (!prop.isReadable())
continue;
- if (prop.isEnumType())
- vartype = QVariant::Int;
+ const int vartype = prop.isEnumType()
+ ? int(QMetaType::Int)
+ : QMetaType::fromName(type).id();
- if (vartype != QVariant::Invalid) {
+ if (vartype != QMetaType::UnknownType) {
detail += QLatin1String("<p>Read this property's value using QObject::property:<pre>\n");
if (prop.isEnumType())
detail += QLatin1String("\tint val = ");
@@ -364,7 +317,7 @@ QString qax_generateDocumentation(QAxBase *that)
setterSlot = "Set" + name;
} else {
QByteArray nameUp = name;
- nameUp[0] = char(toupper(nameUp.at(0)));
+ nameUp[0] = QtMiscUtils::toAsciiUpper(nameUp.at(0));
setterSlot = "set" + nameUp;
}
detail += QLatin1String("<a href=\"#") + QString::fromLatin1(setterSlot) + QLatin1String("\">") +
@@ -393,14 +346,14 @@ QString qax_generateDocumentation(QAxBase *that)
stream << "</ul>" << Qt::endl;
}
}
- if (methodDetails.count()) {
+ if (!methodDetails.isEmpty()) {
stream << "<hr><h2>Member Function Documentation</h2>" << Qt::endl;
- for (int i = 0; i < methodDetails.count(); ++i)
+ for (qsizetype i = 0; i < methodDetails.size(); ++i)
stream << methodDetails.at(i) << Qt::endl;
}
- if (propDetails.count()) {
+ if (!propDetails.isEmpty()) {
stream << "<hr><h2>Property Documentation</h2>" << Qt::endl;
- for (int i = 0; i < propDetails.count(); ++i)
+ for (qsizetype i = 0; i < propDetails.size(); ++i)
stream << propDetails.at(i) << Qt::endl;
}
diff --git a/src/activeqt/container/qaxobject.cpp b/src/activeqt/container/qaxobject.cpp
index adce2a2..5a4a1cc 100644
--- a/src/activeqt/container/qaxobject.cpp
+++ b/src/activeqt/container/qaxobject.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxobject.h"
#include "qaxobject_p.h"
@@ -60,6 +13,8 @@
QT_BEGIN_NAMESPACE
+QAxObjectInterface::~QAxObjectInterface() = default;
+
QAxBaseObject::QAxBaseObject(QObjectPrivate &d, QObject *parent)
: QObject(d, parent)
{
@@ -185,6 +140,8 @@ void QAxObjectPrivate::emitSignal(const QString &name, int argc, void *argv)
/*!
Creates an empty COM object and propagates \a parent to the
QObject constructor. To initialize the object, call setControl().
+
+ \sa {control}{setControl()}
*/
QAxObject::QAxObject(QObject *parent)
: QAxBaseObject(*new QAxObjectPrivate, parent)
@@ -197,7 +154,7 @@ QAxObject::QAxObject(QObject *parent)
Creates a QAxObject that wraps the COM object \a c. \a parent is
propagated to the QObject constructor.
- \sa setControl()
+ \sa {control}{setControl()}
*/
QAxObject::QAxObject(const QString &c, QObject *parent)
: QAxBaseObject(*new QAxObjectPrivate, parent)
diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h
index ceeb2c4..d01a02c 100644
--- a/src/activeqt/container/qaxobject.h
+++ b/src/activeqt/container/qaxobject.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXOBJECT_H
#define QAXOBJECT_H
diff --git a/src/activeqt/container/qaxobject_p.h b/src/activeqt/container/qaxobject_p.h
index f910887..19c830c 100644
--- a/src/activeqt/container/qaxobject_p.h
+++ b/src/activeqt/container/qaxobject_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXOBJECT_P_H
#define QAXOBJECT_P_H
diff --git a/src/activeqt/container/qaxobjectinterface.h b/src/activeqt/container/qaxobjectinterface.h
index 566befa..a25611e 100644
--- a/src/activeqt/container/qaxobjectinterface.h
+++ b/src/activeqt/container/qaxobjectinterface.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXOBJECTINTERFACE_H
#define QAXOBJECTINTERFACE_H
@@ -60,7 +13,7 @@ class QString;
class QAxObjectInterface
{
public:
- virtual ~QAxObjectInterface() = default;
+ virtual ~QAxObjectInterface();
virtual ulong classContext() const = 0;
virtual void setClassContext(ulong classContext) = 0;
diff --git a/src/activeqt/container/qaxobjectinterface.qdoc b/src/activeqt/container/qaxobjectinterface.qdoc
index bca7ab4..474f4f1 100644
--- a/src/activeqt/container/qaxobjectinterface.qdoc
+++ b/src/activeqt/container/qaxobjectinterface.qdoc
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
/*!
\class QAxObjectInterface
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index 4052fe2..cc5da7d 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxscript.h"
#include <QtAxBase/private/qaxutils_p.h>
@@ -82,6 +35,9 @@ static QList<QAxEngineDescriptor> engines;
class QAxScriptManagerPrivate
{
public:
+ void updateScript(QAxScript*);
+ QAxScript *scriptForFunction(QString &function) const;
+
QHash<QString, QAxScript*> scriptDict;
QHash<QString, QAxBase*> objectDict;
};
@@ -688,8 +644,11 @@ script_engine(nullptr)
{
if (manager) {
manager->d->scriptDict.insert(name, this);
- connect(this, SIGNAL(error(int,QString,int,QString)),
- manager, SLOT(scriptError(int,QString,int,QString)));
+
+ connect(this, &QAxScript::error, script_manager,
+ [this](int code, const QString &description, int sourcePosition, const QString &sourceText){
+ emit script_manager->error(this, code, description, sourcePosition, sourceText);
+ });
}
#ifndef QT_NO_QAXSCRIPT
@@ -741,7 +700,7 @@ bool QAxScript::load(const QString &code, const QString &language)
if (code.contains(QLatin1String("End Sub"), Qt::CaseInsensitive))
lang = QLatin1String("VBScript");
- for (const QAxEngineDescriptor &engine : qAsConst(engines)) {
+ for (const QAxEngineDescriptor &engine : std::as_const(engines)) {
if (!engine.code.isEmpty() && code.contains(engine.code)) {
lang = engine.name;
break;
@@ -842,7 +801,7 @@ void QAxScript::updateObjects()
if (!script_manager)
return;
- script_manager->updateScript(this);
+ script_manager->d->updateScript(this);
}
/*! \internal
@@ -1024,7 +983,9 @@ void QAxScriptManager::addObject(QAxBase *object)
return;
d->objectDict.insert(name, object);
- connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)));
+ QObject::connect(obj, &QObject::destroyed, this, [this](QObject *o){
+ d->objectDict.take(o->objectName());
+ });
}
/*! \fn void QAxScriptManager::addObject(QObject *object)
@@ -1103,7 +1064,7 @@ QAxScript *QAxScriptManager::load(const QString &file, const QString &name)
if (file.endsWith(QLatin1String(".js"))) {
language = QLatin1String("JScript");
} else {
- for (const QAxEngineDescriptor &engine : qAsConst(engines)) {
+ for (const QAxEngineDescriptor &engine : std::as_const(engines)) {
if (!engine.extension.isEmpty() && file.endsWith(engine.extension)) {
language = engine.name;
break;
@@ -1159,16 +1120,8 @@ QVariant QAxScriptManager::call(const QString &function, const QVariant &var1,
const QVariant &var7,
const QVariant &var8)
{
- QAxScript *s = script(function);
- if (!s) {
-#ifdef QT_CHECK_STATE
- qWarning("QAxScriptManager::call: No script provides function %s, or this function\n"
- "\tis provided through an engine that does not support introspection", function.latin1());
-#endif
- return QVariant();
- }
-
- return s->call(function, var1, var2, var3, var4, var5, var6, var7, var8);
+ QList<QVariant> list{var1, var2, var3, var4, var5, var6, var7, var8};
+ return call(function, list);
}
/*!
@@ -1180,17 +1133,19 @@ QVariant QAxScriptManager::call(const QString &function, const QVariant &var1,
*/
QVariant QAxScriptManager::call(const QString &function, QList<QVariant> &arguments)
{
- QAxScript *s = script(function);
+ QString signature = function;
+ QAxScript *s = d->scriptForFunction(signature);
if (!s) {
#ifdef QT_CHECK_STATE
qWarning("QAxScriptManager::call: No script provides function %s, or this function\n"
- "\tis provided through an engine that does not support introspection", function.latin1());
+ "\tis provided through an engine that does not support introspection",
+ qPrintable(function));
#endif
return QVariant();
}
QVariantList args(arguments);
- return s->call(function, args);
+ return s->call(signature, args);
}
/*!
@@ -1233,7 +1188,7 @@ QString QAxScriptManager::scriptFileFilter()
QString specialFiles = QLatin1String(";;VBScript Files (*.vbs *.dsm)"
";;JavaScript Files (*.js)");
- for (const QAxEngineDescriptor &engine : qAsConst(engines)) {
+ for (const QAxEngineDescriptor &engine : std::as_const(engines)) {
if (!engine.extension.isEmpty()) {
allFiles += QLatin1String(" *") + engine.extension;
specialFiles += QLatin1String(";;") + engine.name
@@ -1260,59 +1215,51 @@ QString QAxScriptManager::scriptFileFilter()
*/
/*!
- \fn QAxScript *QAxScriptManager::scriptForFunction(const QString &function) const
\internal
Returns a pointer to the first QAxScript that knows
- about \a function, or 0 if this function is unknown.
+ about \a function, or nullptr if this function is unknown. \a function
+ is changed to the callable signature.
*/
-QAxScript *QAxScriptManager::scriptForFunction(const QString &function) const
+QAxScript *QAxScriptManagerPrivate::scriptForFunction(QString &function) const
{
- // check full prototypes if included
- if (function.contains(QLatin1Char('('))) {
- for (auto it = d->scriptDict.cbegin(), end = d->scriptDict.cend(); it != end; ++it) {
- if (it.value()->functions(QAxScript::FunctionSignatures).contains(function))
- return it.value();
+ const auto startPrototype = function.indexOf(u'(');
+
+ for (const auto &script : scriptDict) {
+ const QMetaObject *mo = script->scriptEngine()->metaObject();
+ for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
+ const QMetaMethod slot(mo->method(i));
+ if (slot.methodType() != QMetaMethod::Slot || slot.access() != QMetaMethod::Public)
+ continue;
+ const QString slotname = QString::fromLatin1(slot.methodSignature());
+ if (slotname.contains(u'_'))
+ continue;
+
+ // finding script for prototype
+ if (startPrototype != -1) {
+ if (slotname == function)
+ return script;
+ } else if (slotname.length() > function.length()
+ && slotname.at(function.length()) == u'('
+ && slotname.startsWith(function)) {
+ function = slotname;
+ return script;
+ }
}
}
- QString funcName = function;
- funcName.truncate(funcName.indexOf(QLatin1Char('(')));
- // second try, checking only names, not prototypes
- for (auto it = d->scriptDict.cbegin(), end = d->scriptDict.cend(); it != end; ++it) {
- if (it.value()->functions(QAxScript::FunctionNames).contains(funcName))
- return it.value();
- }
-
return nullptr;
}
/*!
\internal
*/
-void QAxScriptManager::updateScript(QAxScript *script)
+void QAxScriptManagerPrivate::updateScript(QAxScript *script)
{
if (QAxScriptEngine *engine = script->scriptEngine()) {
- for (auto it = d->objectDict.constBegin(), end = d->objectDict.constEnd(); it != end; ++it)
+ for (auto it = objectDict.constBegin(), end = objectDict.constEnd(); it != end; ++it)
engine->addItem(it.key());
}
}
-/*!
- \internal
-*/
-void QAxScriptManager::objectDestroyed(QObject *o)
-{
- d->objectDict.take(o->objectName());
-}
-
-/*!
- \internal
-*/
-void QAxScriptManager::scriptError(int code, const QString &desc, int spos, const QString &stext)
-{
- QAxScript *source = qobject_cast<QAxScript*>(sender());
- emit error(source, code, desc, spos, stext);
-}
-
QT_END_NAMESPACE
diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h
index 3997d9d..f40262d 100644
--- a/src/activeqt/container/qaxscript.h
+++ b/src/activeqt/container/qaxscript.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXSCRIPT_H
#define QAXSCRIPT_H
@@ -188,16 +141,9 @@ public:
Q_SIGNALS:
void error(QAxScript *script, int code, const QString &description, int sourcePosition, const QString &sourceText);
-private Q_SLOTS:
- void objectDestroyed(QObject *o);
- void scriptError(int code, const QString &description, int sourcePosition, const QString &sourceText);
-
private:
friend class QAxScript;
QAxScriptManagerPrivate *d;
-
- void updateScript(QAxScript*);
- QAxScript *scriptForFunction(const QString &function) const;
};
diff --git a/src/activeqt/container/qaxscriptwrapper.cpp b/src/activeqt/container/qaxscriptwrapper.cpp
index e548880..912ac27 100644
--- a/src/activeqt/container/qaxscriptwrapper.cpp
+++ b/src/activeqt/container/qaxscriptwrapper.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxobject.h"
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp
index 2c87b9c..20bf72d 100644
--- a/src/activeqt/container/qaxselect.cpp
+++ b/src/activeqt/container/qaxselect.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxselect.h"
@@ -77,6 +30,8 @@ QT_BEGIN_NAMESPACE
\value SandboxingNone No specific sandboxing desired
\value SandboxingProcess Run ActiveX control in a separate process
\value SandboxingLowIntegrity Run ActiveX control in a separate low-integrity process
+ \value SandboxingAppContainer [since 6.5] Run ActiveX control in a separate
+ AppContainer-isolated process
Sandboxing requires that the ActiveX is either built as an EXE, or as a DLL with AppID "DllSurrogate" enabled.
*/
@@ -277,7 +232,7 @@ public:
std::sort(m_controls.begin(), m_controls.end());
}
- int rowCount(const QModelIndex & = QModelIndex()) const override { return m_controls.count(); }
+ int rowCount(const QModelIndex & = QModelIndex()) const override { return m_controls.size(); }
QVariant data(const QModelIndex &index, int role) const override ;
Qt::ItemFlags flags(const QModelIndex &index) const override ;
@@ -374,7 +329,8 @@ QAxSelect::QAxSelect(QWidget *parent, Qt::WindowFlags flags)
d->filterModel->setSourceModel(new ControlList(this));
d->selectUi.ActiveXList->setModel(d->filterModel);
- QStringList sandboxingOptions = { QLatin1String("None"), QLatin1String("Process isolation"), QLatin1String("Low integrity process") };
+ QStringList sandboxingOptions = { QLatin1String("None"), QLatin1String("Process isolation"),
+ QLatin1String("Low integrity process"), QLatin1String("AppContainer process") };
d->selectUi.SandboxingCombo->addItems(sandboxingOptions);
connect(d->selectUi.ActiveXList->selectionModel(), &QItemSelectionModel::currentChanged,
@@ -420,6 +376,8 @@ QAxSelect::SandboxingLevel QAxSelect::sandboxingLevel() const
return SandboxingProcess;
case 2:
return SandboxingLowIntegrity;
+ case 3:
+ return SandboxingAppContainer;
default:
break;
}
diff --git a/src/activeqt/container/qaxselect.h b/src/activeqt/container/qaxselect.h
index 960abd9..5146d5e 100644
--- a/src/activeqt/container/qaxselect.h
+++ b/src/activeqt/container/qaxselect.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXSELECT_H
#define QAXSELECT_H
@@ -65,6 +18,7 @@ public:
SandboxingNone = 0,
SandboxingProcess,
SandboxingLowIntegrity,
+ SandboxingAppContainer,
};
explicit QAxSelect(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
diff --git a/src/activeqt/container/qaxselect.ui b/src/activeqt/container/qaxselect.ui
index 4fb7741..b1b2eef 100644
--- a/src/activeqt/container/qaxselect.ui
+++ b/src/activeqt/container/qaxselect.ui
@@ -1,54 +1,8 @@
<ui version="4.0" stdsetdef="1" >
- <class>QAxSelect</class>
- <comment>*********************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+</comment>
<class>QAxSelect</class>
<widget class="QDialog" name="QAxSelect">
<property name="windowTitle">
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index c7f2609..76ac6d9 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxwidget.h"
#include "qaxwidget_p.h"
@@ -72,6 +25,7 @@
#include <quuid.h>
#include <qwhatsthis.h>
#include <qabstractnativeeventfilter.h>
+#include <private/qpixmap_win_p.h>
#include <windowsx.h>
#include <ocidl.h>
@@ -238,7 +192,7 @@ public:
// IUnknown
unsigned long WINAPI AddRef() override;
unsigned long WINAPI Release() override;
- STDMETHOD(QueryInterface)(REFIID iid, void **iface);
+ STDMETHOD(QueryInterface)(REFIID iid, void **iface) override;
// IDispatch
HRESULT __stdcall GetTypeInfoCount(unsigned int *) override
@@ -255,149 +209,149 @@ public:
void emitAmbientPropertyChange(DISPID dispid);
// IOleClientSite
- STDMETHOD(SaveObject)();
- STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk);
- STDMETHOD(GetContainer)(LPOLECONTAINER FAR* ppContainer);
- STDMETHOD(ShowObject)();
- STDMETHOD(OnShowWindow)(BOOL fShow);
- STDMETHOD(RequestNewObjectLayout)();
+ STDMETHOD(SaveObject)() override;
+ STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) override;
+ STDMETHOD(GetContainer)(LPOLECONTAINER FAR* ppContainer) override;
+ STDMETHOD(ShowObject)() override;
+ STDMETHOD(OnShowWindow)(BOOL fShow) override;
+ STDMETHOD(RequestNewObjectLayout)() override;
// IOleControlSite
- STDMETHOD(OnControlInfoChanged)();
- STDMETHOD(LockInPlaceActive)(BOOL fLock);
- STDMETHOD(GetExtendedControl)(IDispatch** ppDisp);
- STDMETHOD(TransformCoords)(POINTL* pPtlHimetric, POINTF* pPtfContainer, DWORD dwFlags);
- STDMETHOD(TranslateAccelerator)(LPMSG lpMsg, DWORD grfModifiers);
- STDMETHOD(OnFocus)(BOOL fGotFocus);
- STDMETHOD(ShowPropertyFrame)();
+ STDMETHOD(OnControlInfoChanged)() override;
+ STDMETHOD(LockInPlaceActive)(BOOL fLock) override;
+ STDMETHOD(GetExtendedControl)(IDispatch** ppDisp) override;
+ STDMETHOD(TransformCoords)(POINTL* pPtlHimetric, POINTF* pPtfContainer, DWORD dwFlags) override;
+ STDMETHOD(TranslateAccelerator)(LPMSG lpMsg, DWORD grfModifiers) override;
+ STDMETHOD(OnFocus)(BOOL fGotFocus) override;
+ STDMETHOD(ShowPropertyFrame)() override;
// IOleWindow
- STDMETHOD(GetWindow)(HWND *phwnd);
- STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
+ STDMETHOD(GetWindow)(HWND *phwnd) override;
+ STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override;
// IOleInPlaceSite
- STDMETHOD(CanInPlaceActivate)();
- STDMETHOD(OnInPlaceActivate)();
- STDMETHOD(OnUIActivate)();
- STDMETHOD(GetWindowContext)(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo);
- STDMETHOD(Scroll)(SIZE scrollExtant);
- STDMETHOD(OnUIDeactivate)(BOOL fUndoable);
- STDMETHOD(OnInPlaceDeactivate)();
- STDMETHOD(DiscardUndoState)();
- STDMETHOD(DeactivateAndUndo)();
- STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect);
+ STDMETHOD(CanInPlaceActivate)() override;
+ STDMETHOD(OnInPlaceActivate)() override;
+ STDMETHOD(OnUIActivate)() override;
+ STDMETHOD(GetWindowContext)(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) override;
+ STDMETHOD(Scroll)(SIZE scrollExtant) override;
+ STDMETHOD(OnUIDeactivate)(BOOL fUndoable) override;
+ STDMETHOD(OnInPlaceDeactivate)() override;
+ STDMETHOD(DiscardUndoState)() override;
+ STDMETHOD(DeactivateAndUndo)() override;
+ STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect) override;
#ifdef QAX_SUPPORT_WINDOWLESS
// IOleInPlaceSiteEx ###
- STDMETHOD(OnInPlaceActivateEx)(BOOL* /*pfNoRedraw*/, DWORD /*dwFlags*/)
+ STDMETHOD(OnInPlaceActivateEx)(BOOL* /*pfNoRedraw*/, DWORD /*dwFlags*/) override
{
return S_OK;
}
- STDMETHOD(OnInPlaceDeactivateEx)(BOOL /*fNoRedraw*/)
+ STDMETHOD(OnInPlaceDeactivateEx)(BOOL /*fNoRedraw*/) override
{
return S_OK;
}
- STDMETHOD(RequestUIActivate)()
+ STDMETHOD(RequestUIActivate)() override
{
return S_OK;
}
// IOleInPlaceSiteWindowless ###
- STDMETHOD(CanWindowlessActivate)()
+ STDMETHOD(CanWindowlessActivate)() override
{
return S_OK;
}
- STDMETHOD(GetCapture)()
+ STDMETHOD(GetCapture)() override
{
return S_FALSE;
}
- STDMETHOD(SetCapture)(BOOL /*fCapture*/)
+ STDMETHOD(SetCapture)(BOOL /*fCapture*/) override
{
return S_FALSE;
}
- STDMETHOD(GetFocus)()
+ STDMETHOD(GetFocus)() override
{
return S_FALSE;
}
- STDMETHOD(SetFocus)(BOOL /*fCapture*/)
+ STDMETHOD(SetFocus)(BOOL /*fCapture*/) override
{
return S_FALSE;
}
- STDMETHOD(GetDC)(LPCRECT /*pRect*/, DWORD /*grfFlags*/, HDC *phDC)
+ STDMETHOD(GetDC)(LPCRECT /*pRect*/, DWORD /*grfFlags*/, HDC *phDC) override
{
*phDC = 0;
return S_OK;
}
- STDMETHOD(ReleaseDC)(HDC hDC)
+ STDMETHOD(ReleaseDC)(HDC hDC) override
{
::ReleaseDC((HWND)widget->winId(), hDC);
return S_OK;
}
- STDMETHOD(InvalidateRect)(LPCRECT pRect, BOOL fErase)
+ STDMETHOD(InvalidateRect)(LPCRECT pRect, BOOL fErase) override
{
::InvalidateRect((HWND)host->winId(), pRect, fErase);
return S_OK;
}
- STDMETHOD(InvalidateRgn)(HRGN hRGN, BOOL fErase)
+ STDMETHOD(InvalidateRgn)(HRGN hRGN, BOOL fErase) override
{
::InvalidateRgn((HWND)host->winId(), hRGN, fErase);
return S_OK;
}
- STDMETHOD(ScrollRect)(int /*dx*/, int /*dy*/, LPCRECT /*pRectScroll*/, LPCRECT /*pRectClip*/)
+ STDMETHOD(ScrollRect)(int /*dx*/, int /*dy*/, LPCRECT /*pRectScroll*/, LPCRECT /*pRectClip*/) override
{
return S_OK;
}
- STDMETHOD(AdjustRect)(LPRECT /*prc*/)
+ STDMETHOD(AdjustRect)(LPRECT /*prc*/) override
{
return S_OK;
}
#ifdef Q_CC_GNU // signature incorrect in win32api
- STDMETHOD(AdjustRect)(LPCRECT /*prc*/)
+ STDMETHOD(AdjustRect)(LPCRECT /*prc*/) override
{
RECT rect;
return AdjustRect(&rect);
}
#endif
- STDMETHOD(OnDefWindowMessage)(UINT /*msg*/, WPARAM /*wPara*/, LPARAM /*lParam*/, LRESULT* /*plResult*/)
+ STDMETHOD(OnDefWindowMessage)(UINT /*msg*/, WPARAM /*wPara*/, LPARAM /*lParam*/, LRESULT* /*plResult*/) override
{
return S_FALSE;
}
#endif
// IOleInPlaceFrame
- STDMETHOD(InsertMenus(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths));
- STDMETHOD(SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject));
- STDMETHOD(RemoveMenus(HMENU hmenuShared));
- STDMETHOD(SetStatusText(LPCOLESTR pszStatusText));
- STDMETHOD(EnableModeless(BOOL fEnable));
- STDMETHOD(TranslateAccelerator(LPMSG lpMsg, WORD grfModifiers));
+ STDMETHOD(InsertMenus(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)) override;
+ STDMETHOD(SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)) override;
+ STDMETHOD(RemoveMenus(HMENU hmenuShared)) override;
+ STDMETHOD(SetStatusText(LPCOLESTR pszStatusText)) override;
+ STDMETHOD(EnableModeless(BOOL fEnable)) override;
+ STDMETHOD(TranslateAccelerator(LPMSG lpMsg, WORD grfModifiers)) override;
// IOleInPlaceUIWindow
- STDMETHOD(GetBorder(LPRECT lprectBorder));
- STDMETHOD(RequestBorderSpace(LPCBORDERWIDTHS pborderwidths));
- STDMETHOD(SetBorderSpace(LPCBORDERWIDTHS pborderwidths));
- STDMETHOD(SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName));
+ STDMETHOD(GetBorder(LPRECT lprectBorder)) override;
+ STDMETHOD(RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)) override;
+ STDMETHOD(SetBorderSpace(LPCBORDERWIDTHS pborderwidths)) override;
+ STDMETHOD(SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)) override;
// IOleDocumentSite
- STDMETHOD(ActivateMe(IOleDocumentView *pViewToActivate));
+ STDMETHOD(ActivateMe(IOleDocumentView *pViewToActivate)) override;
// IAdviseSink
- STDMETHOD_(void, OnDataChange)(FORMATETC* /*pFormatetc*/, STGMEDIUM* /*pStgmed*/)
+ STDMETHOD_(void, OnDataChange)(FORMATETC* /*pFormatetc*/, STGMEDIUM* /*pStgmed*/) override
{
AX_DEBUG(QAxClientSite::OnDataChange);
}
- STDMETHOD_(void, OnViewChange)(DWORD /*dwAspect*/, LONG /*lindex*/)
+ STDMETHOD_(void, OnViewChange)(DWORD /*dwAspect*/, LONG /*lindex*/) override
{
AX_DEBUG(QAxClientSite::OnViewChange);
}
- STDMETHOD_(void, OnRename)(IMoniker* /*pmk*/)
+ STDMETHOD_(void, OnRename)(IMoniker* /*pmk*/) override
{
}
- STDMETHOD_(void, OnSave)()
+ STDMETHOD_(void, OnSave)() override
{
}
- STDMETHOD_(void, OnClose)()
+ STDMETHOD_(void, OnClose)() override
{
}
@@ -462,9 +416,9 @@ static const ushort mouseTbl[] = {
WM_RBUTTONDOWN, QEvent::MouseButtonPress, Qt::RightButton,
WM_RBUTTONUP, QEvent::MouseButtonRelease, Qt::RightButton,
WM_RBUTTONDBLCLK, QEvent::MouseButtonDblClick, Qt::RightButton,
- WM_MBUTTONDOWN, QEvent::MouseButtonPress, Qt::MidButton,
- WM_MBUTTONUP, QEvent::MouseButtonRelease, Qt::MidButton,
- WM_MBUTTONDBLCLK, QEvent::MouseButtonDblClick, Qt::MidButton,
+ WM_MBUTTONDOWN, QEvent::MouseButtonPress, Qt::MiddleButton,
+ WM_MBUTTONUP, QEvent::MouseButtonRelease, Qt::MiddleButton,
+ WM_MBUTTONDBLCLK, QEvent::MouseButtonDblClick, Qt::MiddleButton,
0, 0, 0
};
@@ -474,7 +428,7 @@ static Qt::MouseButtons translateMouseButtonState(int s)
if (s & MK_LBUTTON)
bst |= Qt::LeftButton;
if (s & MK_MBUTTON)
- bst |= Qt::MidButton;
+ bst |= Qt::MiddleButton;
if (s & MK_RBUTTON)
bst |= Qt::RightButton;
@@ -1238,11 +1192,11 @@ HRESULT WINAPI QAxClientSite::InsertMenus(HMENU /*hmenuShared*/, LPOLEMENUGROUPW
}
}
if (fileMenu)
- lpMenuWidths->width[0] = fileMenu->actions().count();
+ lpMenuWidths->width[0] = fileMenu->actions().size();
if (viewMenu)
- lpMenuWidths->width[2] = viewMenu->actions().count();
+ lpMenuWidths->width[2] = viewMenu->actions().size();
if (windowMenu)
- lpMenuWidths->width[4] = windowMenu->actions().count();
+ lpMenuWidths->width[4] = windowMenu->actions().size();
return S_OK;
}
@@ -1847,9 +1801,6 @@ void QAxHostWidget::focusOutEvent(QFocusEvent *e)
axhost->m_spInPlaceObject->UIDeactivate();
}
-Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
-Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
-
void QAxHostWidget::paintEvent(QPaintEvent*)
{
// QWidget having redirected paint device indicates non-regular paint, which implies
@@ -1883,7 +1834,7 @@ void QAxHostWidget::paintEvent(QPaintEvent*)
QPainter painter(this);
QPixmap pixmap = qt_pixmapFromWinHBITMAP(hBmp);
- pixmap.setDevicePixelRatio(devicePixelRatioF());
+ pixmap.setDevicePixelRatio(devicePixelRatio());
painter.drawPixmap(0, 0, pixmap);
SelectObject(hBmp_hdc, old_hBmp);
diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h
index ca5327a..325d4b5 100644
--- a/src/activeqt/container/qaxwidget.h
+++ b/src/activeqt/container/qaxwidget.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXWIDGET_H
#define QAXWIDGET_H
diff --git a/src/activeqt/container/qaxwidget_p.h b/src/activeqt/container/qaxwidget_p.h
index b327bed..93ae73f 100644
--- a/src/activeqt/container/qaxwidget_p.h
+++ b/src/activeqt/container/qaxwidget_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXWIDGET_P_H
#define QAXWIDGET_P_H
diff --git a/src/activeqt/control/CMakeLists.txt b/src/activeqt/control/CMakeLists.txt
index c33411d..74e4fb7 100644
--- a/src/activeqt/control/CMakeLists.txt
+++ b/src/activeqt/control/CMakeLists.txt
@@ -1,10 +1,11 @@
-# Generated from control.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## AxServer Module:
#####################################################################
-qt_add_module(AxServer
+qt_internal_add_module(AxServer
STATIC
QMAKE_MODULE_CONFIG idcidl force_import_plugins
SOURCES
@@ -32,16 +33,17 @@ qt_add_module(AxServer
Qt::Gui
Qt::Widgets
shell32
+ NO_GENERATE_CPP_EXPORTS
)
-#### Keys ignored in scope 1:.:.:control.pro:<TRUE>:
-# MODULE = "axserver"
-# MODULE_CONFIG = "idcidl" "force_import_plugins"
+set_source_files_properties(qaxservermain.cpp # define main()
+ qaxmain.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
## Scopes:
#####################################################################
-qt_extend_target(AxServer CONDITION MINGW
+qt_internal_extend_target(AxServer CONDITION MINGW
DEFINES
QT_NEEDS_QMAIN
)
diff --git a/src/activeqt/control/Qt6AxServerMacros.cmake b/src/activeqt/control/Qt6AxServerMacros.cmake
new file mode 100644
index 0000000..38bccf0
--- /dev/null
+++ b/src/activeqt/control/Qt6AxServerMacros.cmake
@@ -0,0 +1,134 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Adds an ActiveX server executable, generates an IDL file and links the produced .tbl to the
+# executable.
+# Arguments: See qt6_target_idl
+#
+# This function is currently in Technical Preview.
+# Its signature and behavior might change.
+function(qt6_add_axserver_executable target)
+ cmake_parse_arguments(arg "NO_AX_SERVER_REGISTRATION" "" "" ${ARGN})
+ if(arg_NO_AX_SERVER_REGISTRATION)
+ set(arg_NO_AX_SERVER_REGISTRATION "NO_AX_SERVER_REGISTRATION")
+ else()
+ unset(arg_NO_AX_SERVER_REGISTRATION)
+ endif()
+ qt_add_executable(${target} ${arg_UNPARSED_ARGUMENTS})
+ set_target_properties(${target} PROPERTIES WIN32_EXECUTABLE TRUE)
+ target_link_libraries(${target} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::AxServer)
+ qt6_target_idl(${target} ${arg_NO_AX_SERVER_REGISTRATION})
+endfunction()
+
+# Adds an ActiveX server library, generates an IDL file and links the produced .tbl to the
+# dll.
+# Arguments: See qt6_target_idl
+#
+# This function is currently in Technical Preview.
+# Its signature and behavior might change.
+function(qt6_add_axserver_library target)
+ cmake_parse_arguments(arg "NO_AX_SERVER_REGISTRATION" "" "" ${ARGN})
+ if(arg_NO_AX_SERVER_REGISTRATION)
+ set(arg_NO_AX_SERVER_REGISTRATION "NO_AX_SERVER_REGISTRATION")
+ else()
+ unset(arg_NO_AX_SERVER_REGISTRATION)
+ endif()
+ add_library(${target} SHARED ${arg_UNPARSED_ARGUMENTS})
+ target_link_libraries(${target} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::AxServer)
+ qt6_target_idl(${target} ${arg_NO_AX_SERVER_REGISTRATION})
+endfunction()
+
+# Adds post-build rules to generate and link IDC/MIDL artifacts to the library or executable.
+# Arguments:
+# NO_AX_SERVER_REGISTRATION skips the ActiveX server registration.
+# Note: You may also use the QT_NO_AX_SERVER_REGISTRATION variable to globally skip
+# the ActiveX server registrations.
+#
+# This function is currently in Technical Preview.
+# Its signature and behavior might change.
+function(qt6_target_idl target)
+ cmake_parse_arguments(arg "NO_AX_SERVER_REGISTRATION" "" "" ${ARGN})
+ if(NOT WIN32)
+ return()
+ endif()
+
+ set(output_idl "${CMAKE_CURRENT_BINARY_DIR}/${target}$<CONFIG>.idl")
+ set(output_tlb "${CMAKE_CURRENT_BINARY_DIR}/${target}$<CONFIG>.tlb")
+
+ _qt_internal_get_tool_wrapper_script_path(tool_wrapper)
+ set(tlb_command_list "")
+
+ # Wrap tool paths in $<COMMAND_CONFIG> to ensure we use the release tool when building debug
+ # targets in a multi-config build, because the debug tool is usually not built by default.
+ if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
+ set(cmb "$<COMMAND_CONFIG:")
+ set(cme ">")
+ else()
+ set(cmb "")
+ set(cme "")
+ endif()
+
+ set(idc_target "${QT_CMAKE_EXPORT_NAMESPACE}::idc")
+ set(idc_target_file "$<TARGET_FILE:${idc_target}>")
+ set(idc_target_file_command_config_wrapped "${cmb}${idc_target_file}${cme}")
+
+ list(APPEND tlb_command_list
+ COMMAND
+ "${tool_wrapper}"
+ "${idc_target_file_command_config_wrapped}"
+ "$<TARGET_FILE:${target}>"
+ /idl "${output_idl}" -version 1.0
+ )
+
+ list(APPEND tlb_command_list
+ COMMAND
+ "${tool_wrapper}" midl "${output_idl}" /nologo /tlb "${output_tlb}"
+ )
+
+ set(rc_files "$<FILTER:$<TARGET_PROPERTY:${target},SOURCES>,INCLUDE,\\.rc$>")
+ set(have_rc_files "$<NOT:$<BOOL:$<STREQUAL:${rc_files},>>>")
+
+ set(no_rc_cmd "echo$<SEMICOLON>No rc-file linked into project. The type library of the \
+${target} target will be a separate file.")
+
+ set(idc_args
+ "$<SEMICOLON>$<TARGET_FILE:${target}>$<SEMICOLON>/tlb$<SEMICOLON>${output_tlb}")
+
+ # Split command into two parts, so that COMMAND_CONFIG can be applied only to the idc tool path,
+ # but not the target and tlb files.
+ set(cmd_part1 "${cmb}$<IF:${have_rc_files},${idc_target_file},${no_rc_cmd}>${cme}")
+ set(cmd_part2 "$<${have_rc_files}:${idc_args}>")
+
+ list(APPEND tlb_command_list
+ COMMAND
+ "${tool_wrapper}" "${cmd_part1}" "${cmd_part2}"
+ )
+
+ if(NOT arg_NO_AX_SERVER_REGISTRATION AND NOT QT_NO_AX_SERVER_REGISTRATION)
+ list(APPEND tlb_command_list
+ COMMAND
+ "${tool_wrapper}"
+ "${idc_target_file_command_config_wrapped}"
+ "$<TARGET_FILE:${target}>" /regserver
+ )
+ endif()
+ add_custom_command(TARGET ${target} POST_BUILD
+ ${tlb_command_list}
+ DEPENDS
+ "${idc_target}"
+ VERBATIM
+ COMMAND_EXPAND_LISTS
+ )
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_add_axserver_executable)
+ qt6_add_axserver_executable(${ARGV})
+ endfunction()
+ function(qt_add_axserver_library)
+ qt6_add_axserver_library(${ARGV})
+ endfunction()
+ function(qt_target_idl)
+ qt6_target_idl(${ARGV})
+ endfunction()
+endif()
diff --git a/src/activeqt/control/control.pro b/src/activeqt/control/control.pro
deleted file mode 100644
index e5f251e..0000000
--- a/src/activeqt/control/control.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET = QtAxServer
-
-QT += widgets
-QT_PRIVATE += core-private gui-private widgets-private axbase-private
-CONFIG += static
-
-DEFINES += QAX_SERVER
-
-mingw: DEFINES += QT_NEEDS_QMAIN
-
-HEADERS = qaxaggregated.h \
- qaxbindable.h \
- qaxfactory.h \
- qclassfactory_p.h \
- ../shared/qaxtypes_p.h
-
-SOURCES = qaxaggregated.cpp \
- qaxserver.cpp \
- qaxserverbase.cpp \
- qaxbindable.cpp \
- qaxfactory.cpp \
- qaxservermain.cpp \
- qaxserverdll.cpp \
- qaxmain.cpp \
- ../shared/qaxtypes.cpp
-
-LIBS += -lshell32
-
-MODULE = axserver
-MODULE_DEFINES = QAXSERVER
-MODULE_CONFIG = idcidl force_import_plugins
-load(qt_module)
diff --git a/src/activeqt/control/qaxaggregated.cpp b/src/activeqt/control/qaxaggregated.cpp
index 0e95308..a4e0991 100644
--- a/src/activeqt/control/qaxaggregated.cpp
+++ b/src/activeqt/control/qaxaggregated.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxaggregated.h"
diff --git a/src/activeqt/control/qaxaggregated.h b/src/activeqt/control/qaxaggregated.h
index 01938be..a3b6a34 100644
--- a/src/activeqt/control/qaxaggregated.h
+++ b/src/activeqt/control/qaxaggregated.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXAGGREGATED_H
#define QAXAGGREGATED_H
diff --git a/src/activeqt/control/qaxbindable.cpp b/src/activeqt/control/qaxbindable.cpp
index 96a34cd..5922559 100644
--- a/src/activeqt/control/qaxbindable.cpp
+++ b/src/activeqt/control/qaxbindable.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxbindable.h"
@@ -87,9 +40,6 @@ QT_BEGIN_NAMESPACE
control, reimplement createAggregate() to return a new object of a
QAxAggregated subclass.
- The ActiveQt \l{activeqt/opengl}{OpenGL} example shows how to use
- QAxBindable to implement additional COM interfaces.
-
\sa QAxAggregated, QAxFactory, {ActiveQt Framework}
*/
diff --git a/src/activeqt/control/qaxbindable.h b/src/activeqt/control/qaxbindable.h
index 5bbc463..c9c38f6 100644
--- a/src/activeqt/control/qaxbindable.h
+++ b/src/activeqt/control/qaxbindable.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXBINDABLE_H
#define QAXBINDABLE_H
diff --git a/src/activeqt/control/qaxfactory.cpp b/src/activeqt/control/qaxfactory.cpp
index ba8a566..ed3ee2c 100644
--- a/src/activeqt/control/qaxfactory.cpp
+++ b/src/activeqt/control/qaxfactory.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxfactory.h"
diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h
index ce2fcbd..b43c298 100644
--- a/src/activeqt/control/qaxfactory.h
+++ b/src/activeqt/control/qaxfactory.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXFACTORY_H
#define QAXFACTORY_H
@@ -198,7 +151,7 @@ class QAxClass : public QAxFactory
{
public:
explicit QAxClass(const QString &libId, const QString &appId)
- : QAxFactory(libId, appId)
+ : QAxFactory(QUuid(libId), QUuid(appId))
{}
const QMetaObject *metaObject(const QString &) const override { return &T::staticMetaObject; }
@@ -257,7 +210,7 @@ private:
QHash<QString, bool> creatable; \
public: \
QAxFactoryList() \
- : QAxFactory(IDTypeLib, IDApp) \
+ : QAxFactory(QUuid(IDTypeLib), QUuid(IDApp)) \
{ \
QAxFactory *factory = nullptr; \
QStringList keys; \
@@ -266,7 +219,7 @@ private:
factory = new QAxClass<Class>(typeLibID().toString(), appID().toString()); \
qRegisterMetaType<Class*>(#Class"*"); \
keys = factory->featureList(); \
- for (const QString &key : qAsConst(keys)) { \
+ for (const QString &key : std::as_const(keys)) { \
factoryKeys += key; \
factories.insert(key, factory); \
creatable.insert(key, true); \
@@ -276,7 +229,7 @@ private:
factory = new QAxClass<Class>(typeLibID().toString(), appID().toString()); \
qRegisterMetaType<Class*>(#Class"*"); \
keys = factory->featureList(); \
- for (const QString &key : qAsConst(keys)) { \
+ for (const QString &key : std::as_const(keys)) { \
factoryKeys += key; \
factories.insert(key, factory); \
creatable.insert(key, false); \
diff --git a/src/activeqt/control/qaxmain.cpp b/src/activeqt/control/qaxmain.cpp
index f563e40..d1b2d9a 100644
--- a/src/activeqt/control/qaxmain.cpp
+++ b/src/activeqt/control/qaxmain.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <qapplication.h>
#include <qaxfactory.h>
diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp
index a103290..aa4b951 100644
--- a/src/activeqt/control/qaxserver.cpp
+++ b/src/activeqt/control/qaxserver.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qaxbindable.h"
#include "qaxfactory.h"
@@ -104,9 +57,9 @@ QAxFactory *qAxFactory()
// register all types with metatype system as pointers
QStringList keys(qax_factory->featureList());
- for (int i = 0; i < keys.count(); ++i) {
+ for (int i = 0; i < keys.size(); ++i) {
QByteArray pointerType = keys.at(i).toLatin1() + '*';
- if (!QMetaType::type(pointerType.constData()))
+ if (QMetaType::fromName(pointerType).id() == QMetaType::UnknownType)
qRegisterMetaType<void *>(pointerType);
}
}
@@ -307,7 +260,7 @@ static void UpdateRegistryKeys(bool bRegister, const QString keyPath, QScopedPoi
QString mime = QLatin1String(mo->classInfo(mo->indexOfClassInfo("MIME")).value());
if (!mime.isEmpty()) {
QStringList mimeTypes = mime.split(QLatin1Char(';'));
- for (int m = 0; m < mimeTypes.count(); ++m) {
+ for (qsizetype m = 0; m < mimeTypes.size(); ++m) {
mime = mimeTypes.at(m);
if (mime.isEmpty())
continue;
@@ -397,7 +350,7 @@ static void UpdateRegistryKeys(bool bRegister, const QString keyPath, QScopedPoi
QString mime = QLatin1String(mo->classInfo(mo->indexOfClassInfo("MIME")).value());
if (!mime.isEmpty()) {
QStringList mimeTypes = mime.split(QLatin1Char(';'));
- for (int m = 0; m < mimeTypes.count(); ++m) {
+ for (qsizetype m = 0; m < mimeTypes.size(); ++m) {
mime = mimeTypes.at(m);
if (mime.isEmpty())
continue;
@@ -485,8 +438,7 @@ HRESULT UpdateRegistry(bool bRegister, bool perUser)
// we try to create the ActiveX widgets later on...
bool delete_qApp = false;
if (!qApp) {
- static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame
- (void)new QApplication(argc, nullptr);
+ (void)new QApplication(__argc, __argv);
delete_qApp = true;
}
@@ -764,7 +716,7 @@ static QByteArray prototype(const QByteArrayList &parameterTypes, const QByteArr
{
QByteArray prototype;
- for (int p = 0; p < parameterTypes.count() && *ok; ++p) {
+ for (qsizetype p = 0; p < parameterTypes.size() && *ok; ++p) {
bool out = false;
QByteArray type(parameterTypes.at(p));
const QByteArray &name = parameterNames.at(p);
@@ -795,7 +747,7 @@ static QByteArray prototype(const QByteArrayList &parameterTypes, const QByteArr
else
prototype += "p_" + replaceKeyword(name);
- if (p < parameterTypes.count() - 1)
+ if (p < parameterTypes.size() - 1)
prototype += ", ";
}
@@ -819,7 +771,8 @@ static QByteArray addDefaultArguments(const QByteArray &prototype, int numDefArg
type += ' ' + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
if (type == "struct")
type += ' ' + ptype.mid(in + 7, ptype.indexOf(' ', in + 7) - in - 7);
- ptype.replace(in, type.length(), QByteArray("VARIANT /*was: ") + type + "*/");
+ const QByteArray replacement = QByteArray("VARIANT /*was: ") + type + "*/";
+ ptype.replace(in, type.length(), replacement);
--numDefArgs;
}
@@ -1191,8 +1144,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
// dummy application to create widgets
bool delete_qApp = false;
if (!qApp) {
- static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame
- (void)new QApplication(argc, nullptr);
+ (void)new QApplication(__argc, __argv);
delete_qApp = true;
}
@@ -1258,11 +1210,11 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
QByteArray cleanType = qax_clean_type(className, mo).toLatin1();
out << "\tcoclass " << cleanType << ';' << Qt::endl;
subtypes.append(cleanType);
- if (!QMetaType::type(cleanType))
+ if (QMetaType::fromName(cleanType).id() == QMetaType::UnknownType)
qRegisterMetaType<void *>(cleanType);
cleanType += '*';
subtypes.append(cleanType);
- if (!QMetaType::type(cleanType))
+ if (QMetaType::fromName(cleanType).id() == QMetaType::UnknownType)
qRegisterMetaType<void *>(cleanType);
}
}
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index a4c10f9..d92b9b1 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -1,54 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#define NOMINMAX
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <qabstracteventdispatcher.h>
#include <qapplication.h>
@@ -66,17 +17,19 @@
#include <qmetaobject.h>
#include <qpixmap.h>
#include <qregularexpression.h>
+#include <qsizegrip.h>
#include <qstatusbar.h>
#include <qwhatsthis.h>
#include <ocidl.h>
#include <olectl.h>
#include <private/qcoreapplication_p.h>
#include <qwindow.h>
+#include <private/qpixmap_win_p.h>
#include <qpa/qplatformnativeinterface.h>
#include <qabstractnativeeventfilter.h>
-#include <qcoreapplication.h>
#include <qlist.h>
+#include <private/qguiapplication_p.h>
#include <private/qthread_p.h>
#include "qaxfactory.h"
@@ -233,125 +186,124 @@ public:
}
// IDispatch
- STDMETHOD(GetTypeInfoCount)(UINT* pctinfo);
- STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
- STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
+ STDMETHOD(GetTypeInfoCount)(UINT* pctinfo) override;
+ STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo) override;
+ STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid) override;
STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
- EXCEPINFO* pexcepinfo, UINT* puArgErr);
+ EXCEPINFO* pexcepinfo, UINT* puArgErr) override;
// IProvideClassInfo
- STDMETHOD(GetClassInfo)(ITypeInfo** pptinfo);
+ STDMETHOD(GetClassInfo)(ITypeInfo** pptinfo) override;
// IProvideClassInfo2
- STDMETHOD(GetGUID)(DWORD dwGuidKind, GUID* pGUID);
+ STDMETHOD(GetGUID)(DWORD dwGuidKind, GUID* pGUID) override;
// IOleObject
- STDMETHOD(Advise)(IAdviseSink* pAdvSink, DWORD* pdwConnection);
- STDMETHOD(Close)(DWORD dwSaveOption);
- STDMETHOD(DoVerb)(LONG iVerb, LPMSG lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect);
- STDMETHOD(EnumAdvise)(IEnumSTATDATA** ppenumAdvise);
- STDMETHOD(EnumVerbs)(IEnumOLEVERB** ppEnumOleVerb);
- STDMETHOD(GetClientSite)(IOleClientSite** ppClientSite);
- STDMETHOD(GetClipboardData)(DWORD dwReserved, IDataObject** ppDataObject);
- STDMETHOD(GetExtent)(DWORD dwDrawAspect, SIZEL* psizel);
- STDMETHOD(GetMiscStatus)(DWORD dwAspect, DWORD *pdwStatus);
- STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk);
- STDMETHOD(GetUserClassID)(CLSID* pClsid);
- STDMETHOD(GetUserType)(DWORD dwFormOfType, LPOLESTR *pszUserType);
- STDMETHOD(InitFromData)(IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved);
- STDMETHOD(IsUpToDate)();
- STDMETHOD(SetClientSite)(IOleClientSite* pClientSite);
- STDMETHOD(SetColorScheme)(LOGPALETTE* pLogPal);
- STDMETHOD(SetExtent)(DWORD dwDrawAspect, SIZEL* psizel);
- STDMETHOD(SetHostNames)(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj);
- STDMETHOD(SetMoniker)(DWORD dwWhichMoniker, IMoniker* ppmk);
- STDMETHOD(Unadvise)(DWORD dwConnection);
- STDMETHOD(Update)();
+ STDMETHOD(Advise)(IAdviseSink* pAdvSink, DWORD* pdwConnection) override;
+ STDMETHOD(Close)(DWORD dwSaveOption) override;
+ STDMETHOD(DoVerb)(LONG iVerb, LPMSG lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) override;
+ STDMETHOD(EnumAdvise)(IEnumSTATDATA** ppenumAdvise) override;
+ STDMETHOD(EnumVerbs)(IEnumOLEVERB** ppEnumOleVerb) override;
+ STDMETHOD(GetClientSite)(IOleClientSite** ppClientSite) override;
+ STDMETHOD(GetClipboardData)(DWORD dwReserved, IDataObject** ppDataObject) override;
+ STDMETHOD(GetExtent)(DWORD dwDrawAspect, SIZEL* psizel) override;
+ STDMETHOD(GetMiscStatus)(DWORD dwAspect, DWORD *pdwStatus) override;
+ STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk) override;
+ STDMETHOD(GetUserClassID)(CLSID* pClsid) override;
+ STDMETHOD(GetUserType)(DWORD dwFormOfType, LPOLESTR *pszUserType) override;
+ STDMETHOD(InitFromData)(IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved) override;
+ STDMETHOD(IsUpToDate)() override;
+ STDMETHOD(SetClientSite)(IOleClientSite* pClientSite) override;
+ STDMETHOD(SetColorScheme)(LOGPALETTE* pLogPal) override;
+ STDMETHOD(SetExtent)(DWORD dwDrawAspect, SIZEL* psizel) override;
+ STDMETHOD(SetHostNames)(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) override;
+ STDMETHOD(SetMoniker)(DWORD dwWhichMoniker, IMoniker* ppmk) override;
+ STDMETHOD(Unadvise)(DWORD dwConnection) override;
+ STDMETHOD(Update)() override;
// IViewObject
STDMETHOD(Draw)(DWORD dwAspect, LONG lIndex, void *pvAspect, DVTARGETDEVICE *ptd,
HDC hicTargetDevice, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
- BOOL(__stdcall*pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue);
+ BOOL(__stdcall*pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue) override;
STDMETHOD(GetColorSet)(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd,
- HDC hicTargetDev, LOGPALETTE **ppColorSet);
- STDMETHOD(Freeze)(DWORD dwAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze);
- STDMETHOD(Unfreeze)(DWORD dwFreeze);
- STDMETHOD(SetAdvise)(DWORD aspects, DWORD advf, IAdviseSink *pAdvSink);
- STDMETHOD(GetAdvise)(DWORD *aspects, DWORD *advf, IAdviseSink **pAdvSink);
+ HDC hicTargetDev, LOGPALETTE **ppColorSet) override;
+ STDMETHOD(Freeze)(DWORD dwAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze) override;
+ STDMETHOD(Unfreeze)(DWORD dwFreeze) override;
+ STDMETHOD(SetAdvise)(DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) override;
+ STDMETHOD(GetAdvise)(DWORD *aspects, DWORD *advf, IAdviseSink **pAdvSink) override;
// IViewObject2
- STDMETHOD(GetExtent)(DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel);
+ STDMETHOD(GetExtent)(DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel) override;
// IOleControl
- STDMETHOD(FreezeEvents)(BOOL);
- STDMETHOD(GetControlInfo)(LPCONTROLINFO);
- STDMETHOD(OnAmbientPropertyChange)(DISPID);
- STDMETHOD(OnMnemonic)(LPMSG);
+ STDMETHOD(FreezeEvents)(BOOL) override;
+ STDMETHOD(GetControlInfo)(LPCONTROLINFO) override;
+ STDMETHOD(OnAmbientPropertyChange)(DISPID) override;
+ STDMETHOD(OnMnemonic)(LPMSG) override;
// IOleWindow
- STDMETHOD(GetWindow)(HWND *pHwnd);
- STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
+ STDMETHOD(GetWindow)(HWND *pHwnd) override;
+ STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override;
// IOleInPlaceObject
- STDMETHOD(InPlaceDeactivate)();
- STDMETHOD(UIDeactivate)();
- STDMETHOD(SetObjectRects)(LPCRECT lprcPosRect, LPCRECT lprcClipRect);
- STDMETHOD(ReactivateAndUndo)();
+ STDMETHOD(InPlaceDeactivate)() override;
+ STDMETHOD(UIDeactivate)() override;
+ STDMETHOD(SetObjectRects)(LPCRECT lprcPosRect, LPCRECT lprcClipRect) override;
+ STDMETHOD(ReactivateAndUndo)() override;
// IOleInPlaceActiveObject
- STDMETHOD(TranslateAcceleratorW)(MSG *pMsg);
- STDMETHOD(TranslateAcceleratorA)(MSG *pMsg);
- STDMETHOD(OnFrameWindowActivate)(BOOL);
- STDMETHOD(OnDocWindowActivate)(BOOL fActivate);
- STDMETHOD(ResizeBorder)(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow);
- STDMETHOD(EnableModeless)(BOOL);
+ STDMETHOD(TranslateAccelerator)(MSG *pMsg) override;
+ STDMETHOD(OnFrameWindowActivate)(BOOL) override;
+ STDMETHOD(OnDocWindowActivate)(BOOL fActivate) override;
+ STDMETHOD(ResizeBorder)(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) override;
+ STDMETHOD(EnableModeless)(BOOL) override;
// IConnectionPointContainer
- STDMETHOD(EnumConnectionPoints)(IEnumConnectionPoints**);
- STDMETHOD(FindConnectionPoint)(REFIID, IConnectionPoint**);
+ STDMETHOD(EnumConnectionPoints)(IEnumConnectionPoints**) override;
+ STDMETHOD(FindConnectionPoint)(REFIID, IConnectionPoint**) override;
// IPersist
- STDMETHOD(GetClassID)(GUID*clsid)
+ STDMETHOD(GetClassID)(GUID*clsid) override
{
*clsid = qAxFactory()->classID(class_name);
return S_OK;
}
// IPersistStreamInit
- STDMETHOD(InitNew)(VOID);
- STDMETHOD(IsDirty)();
- STDMETHOD(Load)(IStream *pStm);
- STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty);
- STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize);
+ STDMETHOD(InitNew)(VOID) override;
+ STDMETHOD(IsDirty)() override;
+ STDMETHOD(Load)(IStream *pStm) override;
+ STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty) override;
+ STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize) override;
// IPersistPropertyBag
- STDMETHOD(Load)(IPropertyBag *, IErrorLog *);
- STDMETHOD(Save)(IPropertyBag *, BOOL, BOOL);
+ STDMETHOD(Load)(IPropertyBag *, IErrorLog *) override;
+ STDMETHOD(Save)(IPropertyBag *, BOOL, BOOL) override;
// IPersistStorage
- STDMETHOD(InitNew)(IStorage *pStg);
- STDMETHOD(Load)(IStorage *pStg);
- STDMETHOD(Save)(IStorage *pStg, BOOL fSameAsLoad);
- STDMETHOD(SaveCompleted)(IStorage *pStgNew);
- STDMETHOD(HandsOffStorage)();
+ STDMETHOD(InitNew)(IStorage *pStg) override;
+ STDMETHOD(Load)(IStorage *pStg) override;
+ STDMETHOD(Save)(IStorage *pStg, BOOL fSameAsLoad) override;
+ STDMETHOD(SaveCompleted)(IStorage *pStgNew) override;
+ STDMETHOD(HandsOffStorage)() override;
// IPersistFile
- STDMETHOD(SaveCompleted)(LPCOLESTR fileName);
- STDMETHOD(GetCurFile)(LPOLESTR *currentFile);
- STDMETHOD(Load)(LPCOLESTR fileName, DWORD mode);
- STDMETHOD(Save)(LPCOLESTR fileName, BOOL fRemember);
+ STDMETHOD(SaveCompleted)(LPCOLESTR fileName) override;
+ STDMETHOD(GetCurFile)(LPOLESTR *currentFile) override;
+ STDMETHOD(Load)(LPCOLESTR fileName, DWORD mode) override;
+ STDMETHOD(Save)(LPCOLESTR fileName, BOOL fRemember) override;
// IDataObject
- STDMETHOD(GetData)(FORMATETC *pformatetcIn, STGMEDIUM *pmedium);
- STDMETHOD(GetDataHere)(FORMATETC* /* pformatetc */, STGMEDIUM* /* pmedium */);
- STDMETHOD(QueryGetData)(FORMATETC* /* pformatetc */);
- STDMETHOD(GetCanonicalFormatEtc)(FORMATETC* /* pformatectIn */,FORMATETC* /* pformatetcOut */);
- STDMETHOD(SetData)(FORMATETC* /* pformatetc */, STGMEDIUM* /* pmedium */, BOOL /* fRelease */);
- STDMETHOD(EnumFormatEtc)(DWORD /* dwDirection */, IEnumFORMATETC** /* ppenumFormatEtc */);
- STDMETHOD(DAdvise)(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
- STDMETHOD(DUnadvise)(DWORD dwConnection);
- STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise);
+ STDMETHOD(GetData)(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) override;
+ STDMETHOD(GetDataHere)(FORMATETC* /* pformatetc */, STGMEDIUM* /* pmedium */) override;
+ STDMETHOD(QueryGetData)(FORMATETC* /* pformatetc */) override;
+ STDMETHOD(GetCanonicalFormatEtc)(FORMATETC* /* pformatectIn */,FORMATETC* /* pformatetcOut */) override;
+ STDMETHOD(SetData)(FORMATETC* /* pformatetc */, STGMEDIUM* /* pmedium */, BOOL /* fRelease */) override;
+ STDMETHOD(EnumFormatEtc)(DWORD /* dwDirection */, IEnumFORMATETC** /* ppenumFormatEtc */) override;
+ STDMETHOD(DAdvise)(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection) override;
+ STDMETHOD(DUnadvise)(DWORD dwConnection) override;
+ STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise) override;
// QObject
int qt_metacall(QMetaObject::Call, int index, void **argv) override;
@@ -524,9 +476,8 @@ public:
: cpoints(points.values())
{
InitializeCriticalSection(&refCountSection);
- const int count = cpoints.count();
- for (int i = 0; i < count; ++i)
- cpoints.at(i)->AddRef();
+ for (const auto &point : std::as_const(cpoints))
+ point->AddRef();
}
QAxSignalVec(const QAxSignalVec &old)
: cpoints(old.cpoints)
@@ -534,15 +485,13 @@ public:
{
InitializeCriticalSection(&refCountSection);
ref = 0;
- const int count = cpoints.count();
- for (int i = 0; i < count; ++i)
- cpoints.at(i)->AddRef();
+ for (const auto &point : std::as_const(cpoints))
+ point->AddRef();
}
virtual ~QAxSignalVec()
{
- const int count = cpoints.count();
- for (int i = 0; i < count; ++i)
- cpoints.at(i)->Release();
+ for (const auto &point : std::as_const(cpoints))
+ point->Release();
DeleteCriticalSection(&refCountSection);
}
@@ -559,7 +508,7 @@ public:
return refCount;
}
- STDMETHOD(QueryInterface)(REFIID iid, void **iface)
+ STDMETHOD(QueryInterface)(REFIID iid, void **iface) override
{
if (!iface)
return E_POINTER;
@@ -574,7 +523,7 @@ public:
AddRef();
return S_OK;
}
- STDMETHOD(Next)(ULONG cConnections, IConnectionPoint **cpoint, ULONG *pcFetched)
+ STDMETHOD(Next)(ULONG cConnections, IConnectionPoint **cpoint, ULONG *pcFetched) override
{
if (!cpoint)
return E_POINTER;
@@ -582,7 +531,7 @@ public:
if (!pcFetched && cConnections > 1)
return E_POINTER;
- const int count = cpoints.count();
+ const qsizetype count = cpoints.size();
unsigned long i;
for (i = 0; i < cConnections; i++) {
if (current==count)
@@ -596,9 +545,9 @@ public:
*pcFetched = i;
return i == cConnections ? S_OK : S_FALSE;
}
- STDMETHOD(Skip)(ULONG cConnections)
+ STDMETHOD(Skip)(ULONG cConnections) override
{
- const int count = cpoints.count();
+ const qsizetype count = cpoints.size();
while (cConnections) {
if (current == count)
return S_FALSE;
@@ -607,12 +556,12 @@ public:
}
return S_OK;
}
- STDMETHOD(Reset)()
+ STDMETHOD(Reset)() override
{
current = 0;
return S_OK;
}
- STDMETHOD(Clone)(IEnumConnectionPoints **ppEnum)
+ STDMETHOD(Clone)(IEnumConnectionPoints **ppEnum) override
{
if (!ppEnum)
return E_POINTER;
@@ -657,7 +606,7 @@ public:
connections = old.connections;
that = old.that;
iid = old.iid;
- for (const CONNECTDATA &connection : qAsConst(connections))
+ for (const CONNECTDATA &connection : std::as_const(connections))
connection.pUnk->AddRef();
}
virtual ~QAxConnection()
@@ -677,7 +626,7 @@ public:
return refCount;
}
- STDMETHOD(QueryInterface)(REFIID iid, void **iface)
+ STDMETHOD(QueryInterface)(REFIID iid, void **iface) override
{
if (!iface)
return E_POINTER;
@@ -694,18 +643,18 @@ public:
AddRef();
return S_OK;
}
- STDMETHOD(GetConnectionInterface)(IID *pIID)
+ STDMETHOD(GetConnectionInterface)(IID *pIID) override
{
if (!pIID)
return E_POINTER;
*pIID = iid;
return S_OK;
}
- STDMETHOD(GetConnectionPointContainer)(IConnectionPointContainer **ppCPC)
+ STDMETHOD(GetConnectionPointContainer)(IConnectionPointContainer **ppCPC) override
{
return that->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(ppCPC));
}
- STDMETHOD(Advise)(IUnknown*pUnk, DWORD *pdwCookie)
+ STDMETHOD(Advise)(IUnknown*pUnk, DWORD *pdwCookie) override
{
if (!pUnk || !pdwCookie)
return E_POINTER;
@@ -719,17 +668,17 @@ public:
}
CONNECTDATA cd;
- cd.dwCookie = connections.count()+1;
+ cd.dwCookie = connections.size() + 1;
cd.pUnk = pUnk;
cd.pUnk->AddRef();
connections.append(cd);
*pdwCookie = cd.dwCookie;
return S_OK;
}
- STDMETHOD(Unadvise)(DWORD dwCookie)
+ STDMETHOD(Unadvise)(DWORD dwCookie) override
{
- const int count = connections.count();
- for (int i = 0; i < count; ++i) {
+ const qsizetype count = connections.size();
+ for (qsizetype i = 0; i < count; ++i) {
if (connections.at(i).dwCookie == dwCookie) {
connections.at(i).pUnk->Release();
connections.removeAt(i);
@@ -740,7 +689,7 @@ public:
}
return CONNECT_E_NOCONNECTION;
}
- STDMETHOD(EnumConnections)(IEnumConnections **ppEnum)
+ STDMETHOD(EnumConnections)(IEnumConnections **ppEnum) override
{
if (!ppEnum)
return E_POINTER;
@@ -749,7 +698,7 @@ public:
return S_OK;
}
- STDMETHOD(Next)(ULONG cConnections, CONNECTDATA *cd, ULONG *pcFetched)
+ STDMETHOD(Next)(ULONG cConnections, CONNECTDATA *cd, ULONG *pcFetched) override
{
if (!cd)
return E_POINTER;
@@ -757,7 +706,7 @@ public:
if (!pcFetched && cConnections > 1)
return E_POINTER;
- const int count = connections.count();
+ const qsizetype count = connections.size();
unsigned long i;
for (i = 0; i < cConnections; i++) {
@@ -771,9 +720,9 @@ public:
*pcFetched = i;
return i == cConnections ? S_OK : S_FALSE;
}
- STDMETHOD(Skip)(ULONG cConnections)
+ STDMETHOD(Skip)(ULONG cConnections) override
{
- const int count = connections.count();
+ const qsizetype count = connections.size();
while (cConnections) {
if (current == count)
return S_FALSE;
@@ -782,12 +731,12 @@ public:
}
return S_OK;
}
- STDMETHOD(Reset)()
+ STDMETHOD(Reset)() override
{
current = 0;
return S_OK;
}
- STDMETHOD(Clone)(IEnumConnections **ppEnum)
+ STDMETHOD(Clone)(IEnumConnections **ppEnum) override
{
if (!ppEnum)
return E_POINTER;
@@ -930,15 +879,14 @@ HRESULT QClassFactory::CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, voi
// Make sure a QApplication instance is present (inprocess case)
if (!qApp) {
qax_ownQApp = true;
- static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame
- new QApplication(argc, nullptr);
+ new QApplication(__argc, __argv);
}
QGuiApplication::setQuitOnLastWindowClosed(false);
if (qAxOutProcServer)
QAbstractEventDispatcher::instance()->installNativeEventFilter(qax_winEventFilter());
else
- QApplication::instance()->d_func()->in_exec = true;
+ QGuiApplicationPrivate::instance()->in_exec = true;
// hook into eventloop; this allows a server to create his own QApplication object
if (!qax_hhook && qax_ownQApp) {
@@ -1031,7 +979,8 @@ HRESULT QClassFactory::CreateInstanceLic(IUnknown *pUnkOuter, IUnknown * /* pUnk
void QClassFactory::cleanupCreatedApplication(QCoreApplication &app)
{
// Cleanup similar to QCoreApplication::exec()
- app.d_func()->execCleanup();
+ QCoreApplicationPrivate *priv = static_cast<QCoreApplicationPrivate *>(QObjectPrivate::get(&app));
+ priv->execCleanup();
}
@@ -1145,7 +1094,7 @@ QAxServerBase::~QAxServerBase()
if (m_spAdviseSink) m_spAdviseSink->Release();
m_spAdviseSink = nullptr;
- for (int i = 0; i < adviseSinks.count(); ++i) {
+ for (qsizetype i = 0; i < adviseSinks.size(); ++i) {
adviseSinks.at(i).pAdvSink->Release();
}
if (m_spClientSite) m_spClientSite->Release();
@@ -1833,7 +1782,7 @@ void QAxServerBase::update()
m_spInPlaceSiteWindowless->InvalidateRect(nullptr, true);
} else if (m_spAdviseSink) {
m_spAdviseSink->OnViewChange(DVASPECT_CONTENT, -1);
- for (int i = 0; i < adviseSinks.count(); ++i) {
+ for (qsizetype i = 0; i < adviseSinks.size(); ++i) {
adviseSinks.at(i).pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
}
}
@@ -1962,7 +1911,7 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv)
const QMetaObject *mo = qt.object->metaObject();
QMetaMethod signal;
DISPID eventId = index;
- int pcount = 0;
+ qsizetype pcount = 0;
QByteArray type;
QByteArrayList ptypes;
@@ -2015,12 +1964,12 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv)
if (!signature.isEmpty())
ptypes = signature.split(',');
- pcount = ptypes.count();
+ pcount = ptypes.size();
}
break;
}
if (pcount && !argv) {
- qWarning("QAxServerBase::qt_metacall: Missing %d arguments", pcount);
+ qWarning("QAxServerBase::qt_metacall: Missing %d arguments", int(pcount));
return false;
}
if (eventId == -1)
@@ -2049,7 +1998,7 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv)
if (pcount) // Use malloc/free for eval package compatibility
dispParams.rgvarg = static_cast<VARIANTARG *>(malloc(size_t(pcount) * sizeof(VARIANTARG)));
- int p = 0;
+ qsizetype p = 0;
for (p = 0; p < pcount; ++p) {
VARIANT *arg = dispParams.rgvarg + (pcount - p - 1);
VariantInit(arg);
@@ -2061,17 +2010,15 @@ int QAxServerBase::qt_metacall(QMetaObject::Call call, int index, void **argv)
// convert enum values to int
variant = QVariant(*reinterpret_cast<int *>(argv[p+1]));
} else {
- QVariant::Type vt = QVariant::nameToType(ptype);
- if (vt == QVariant::UserType) {
+ const QMetaType metaType = QMetaType::fromName(ptype);
+ if (metaType.id() == QMetaType::User) {
if (ptype.endsWith('*')) {
- variant = QVariant(QMetaType::type(ptype), reinterpret_cast<void **>(argv[p+1]));
- // variant.setValue(*(void**)(argv[p + 1]), ptype);
+ variant = QVariant(metaType, reinterpret_cast<void **>(argv[p+1]));
} else {
- variant = QVariant(QMetaType::type(ptype), argv[p+1]);
- // variant.setValue(argv[p + 1], ptype);
+ variant = QVariant(metaType, argv[p+1]);
}
} else {
- variant = QVariant(vt, argv[p + 1]);
+ variant = QVariant(metaType, argv[p + 1]);
}
}
@@ -2343,6 +2290,13 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
if (isWidget)
oldSizeHint = qt.widget->sizeHint();
+ if (wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD)
+ && !pvarResult && (pDispParams->cArgs || pDispParams->cNamedArgs)) {
+ // some client language might allow "value = object.bar = 'newvalue'", and
+ // call us with a get|method but without pvarResult set? QTBUG-106024
+ wFlags |= DISPATCH_PROPERTYPUT;
+ }
+
switch (wFlags) {
case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
case DISPATCH_PROPERTYGET:
@@ -2401,8 +2355,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
if (index == -1) {
QRegularExpression regexp(QLatin1String("_([0-9])\\("));
QRegularExpressionMatch rmatch;
- QString::fromLatin1(name.constData()).lastIndexOf(regexp, -1, &rmatch);
- if (rmatch.hasMatch()) {
+ if (QString::fromLatin1(name.constData()).lastIndexOf(regexp, -1, &rmatch) != -1) {
name.chop(rmatch.capturedLength(0));
name += '(';
int overload = rmatch.capturedView(1).toInt() + 1;
@@ -2436,7 +2389,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
QByteArrayList ptypes;
if (!prototype.isEmpty())
ptypes = prototype.split(',');
- UINT pcount = UINT(ptypes.count());
+ UINT pcount = UINT(ptypes.size());
// verify parameter count
if (pcount > pDispParams->cArgs) {
@@ -2493,7 +2446,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
varp[p + 1] = VARIANTToQVariant(pDispParams->rgvarg[pcount - p - 1], ptype);
argv_pointer[p + 1] = nullptr;
if (varp[p + 1].isValid()) {
- if (varp[p + 1].type() == QVariant::UserType) {
+ if (varp[p + 1].metaType().id() >= QMetaType::User) {
argv[p + 1] = varp[p + 1].data();
} else if (ptype == "QVariant") {
argv[p + 1] = varp + p + 1;
@@ -2515,16 +2468,16 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
// return value
if (!type.isEmpty() && type != "void") {
- QVariant::Type vt = QVariant::nameToType(type);
- if (vt == int(QMetaType::QVariant)) {
+ int vt = QMetaType::fromName(type).id();
+ if (vt == QMetaType::QVariant) {
argv[0] = varp;
} else {
- if (vt == QVariant::UserType)
- vt = QVariant::Invalid;
- else if (vt == QVariant::Invalid && mo->indexOfEnumerator(slot.typeName()) != -1)
- vt = QVariant::Int;
- varp[0] = QVariant(vt);
- if (varp[0].type() == QVariant::Invalid)
+ if (vt == QMetaType::User)
+ vt = QMetaType::UnknownType;
+ else if (vt == QMetaType::UnknownType && mo->indexOfEnumerator(slot.typeName()) != -1)
+ vt = QMetaType::Int;
+ varp[0] = QVariant(QMetaType(vt));
+ if (varp[0].metaType().id() == QMetaType::UnknownType)
argv[0] = nullptr;
else
argv[0] = const_cast<void*>(varp[0].constData());
@@ -2552,9 +2505,8 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
}
if (!type.isEmpty() && type != "void" && pvarResult) {
- if (!varp[0].isValid() && type != "QVariant")
- varp[0] = QVariant(QMetaType::type(type), argv_pointer);
-// varp[0].setValue(argv_pointer[0], type);
+ if (argv[0] == argv_pointer && type != "QVariant")
+ varp[0] = QVariant(QMetaType::fromName(type), argv_pointer);
ok = QVariantToVARIANT(varp[0], *pvarResult, type);
}
}
@@ -2572,6 +2524,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
break;
case DISPATCH_PROPERTYPUT:
case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF:
+ case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYGET|DISPATCH_METHOD:
{
if (index == -1) {
index = mo->indexOfProperty(name);
@@ -2586,12 +2539,14 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
return DISP_E_MEMBERNOTFOUND;
if (!pDispParams->cArgs)
return DISP_E_PARAMNOTOPTIONAL;
- if (pDispParams->cArgs != 1 ||
- pDispParams->cNamedArgs != 1 ||
- *pDispParams->rgdispidNamedArgs != DISPID_PROPERTYPUT)
- return DISP_E_BADPARAMCOUNT;
+ if (wFlags != (DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYGET|DISPATCH_METHOD)
+ && (pDispParams->cArgs != 1 || pDispParams->cNamedArgs != 1
+ || *pDispParams->rgdispidNamedArgs != DISPID_PROPERTYPUT)) {
+ return DISP_E_BADPARAMCOUNT;
+ }
- QVariant var = VARIANTToQVariant(*pDispParams->rgvarg, property.typeName(), property.type());
+ QVariant var = VARIANTToQVariant(*pDispParams->rgvarg,
+ property.typeName(), property.metaType().id());
if (!var.isValid()) {
if (puArgErr)
*puArgErr = 0;
@@ -2616,7 +2571,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
case DISPATCH_METHOD:
case DISPATCH_PROPERTYPUT:
case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF:
- if (m_spAdviseSink || adviseSinks.count()) {
+ if (m_spAdviseSink || !adviseSinks.isEmpty()) {
FORMATETC fmt;
fmt.cfFormat = 0;
fmt.ptd = nullptr;
@@ -2633,7 +2588,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
m_spAdviseSink->OnViewChange(DVASPECT_CONTENT, -1);
m_spAdviseSink->OnDataChange(&fmt, &stg);
}
- for (int i = 0; i < adviseSinks.count(); ++i) {
+ for (qsizetype i = 0; i < adviseSinks.size(); ++i) {
adviseSinks.at(i).pAdvSink->OnDataChange(&fmt, &stg);
}
}
@@ -2661,7 +2616,7 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
unsigned contextID = 0;
const int br = context.indexOf(QLatin1Char('[')); // "error[42]"
if (br != -1) {
- contextID = context.midRef(br + 1, context.size() - br - 2).toUInt();
+ contextID = context.mid(br + 1, context.size() - br - 2).toUInt();
context.truncate(br-1);
}
pexcepinfo->bstrHelpFile = QStringToBSTR(context);
@@ -2976,8 +2931,11 @@ HRESULT WINAPI QAxServerBase::Load(IPropertyBag *bag, IErrorLog * /*log*/)
var.vt = VT_EMPTY;
HRESULT res = bag->Read(bstr, &var, nullptr);
if (property.isWritable() && var.vt != VT_EMPTY) {
- if (res != S_OK || !qt.object->setProperty(pname, VARIANTToQVariant(var, property.typeName(), property.type())))
+ if (res != S_OK
+ || !qt.object->setProperty(pname, VARIANTToQVariant(var, property.typeName(),
+ property.metaType().id()))) {
error = true;
+ }
}
SysFreeString(bstr);
}
@@ -3072,7 +3030,7 @@ HRESULT WINAPI QAxServerBase::Load(LPCOLESTR fileName, DWORD /* mode */)
QString mimeType = QLatin1String(mo->classInfo(mimeIndex).value());
QStringList mimeTypes = mimeType.split(QLatin1Char(';'));
- for (int m = 0; m < mimeTypes.count(); ++m) {
+ for (qsizetype m = 0; m < mimeTypes.size(); ++m) {
const QString &mime = mimeTypes.at(m);
if (mime.count(QLatin1Char(':')) != 2) {
qWarning() << class_name << ": Invalid syntax in Q_CLASSINFO for MIME";
@@ -3117,7 +3075,7 @@ HRESULT WINAPI QAxServerBase::Save(LPCOLESTR fileName, BOOL fRemember)
QString mimeType = QLatin1String(mo->classInfo(mimeIndex).value());
QStringList mimeTypes = mimeType.split(QLatin1Char(';'));
- for (int m = 0; m < mimeTypes.count(); ++m) {
+ for (qsizetype m = 0; m < mimeTypes.size(); ++m) {
const QString &mime = mimeTypes.at(m);
if (mime.count(QLatin1Char(':')) != 2) {
qWarning() << class_name << ": Invalid syntax in Q_CLASSINFO for MIME";
@@ -3141,8 +3099,6 @@ HRESULT WINAPI QAxServerBase::Save(LPCOLESTR fileName, BOOL fRemember)
return E_FAIL;
}
-Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
-
//**** IViewObject
/*
Draws the widget into the provided device context.
@@ -3340,7 +3296,7 @@ HRESULT WINAPI QAxServerBase::OnAmbientPropertyChange(DISPID dispID)
if (var.vt != VT_DISPATCH || !isWidget)
break;
{
- QVariant qvar = VARIANTToQVariant(var, "QFont", QVariant::Font);
+ QVariant qvar = VARIANTToQVariant(var, "QFont", QMetaType::QFont);
QFont qfont = qvariant_cast<QFont>(qvar);
qt.widget->setFont(qfont);
}
@@ -3657,11 +3613,6 @@ HRESULT WINAPI QAxServerBase::TranslateAcceleratorW(MSG *pMsg)
return hres;
}
-HRESULT WINAPI QAxServerBase::TranslateAcceleratorA(MSG *pMsg)
-{
- return TranslateAcceleratorW(pMsg);
-}
-
HRESULT WINAPI QAxServerBase::OnFrameWindowActivate(BOOL fActivate)
{
if (fActivate) {
@@ -3744,7 +3695,7 @@ HRESULT WINAPI QAxServerBase::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus)
*/
HRESULT WINAPI QAxServerBase::Advise(IAdviseSink* pAdvSink, DWORD* pdwConnection)
{
- *pdwConnection = DWORD(adviseSinks.count()) + 1;
+ *pdwConnection = DWORD(adviseSinks.size()) + 1;
STATDATA data = { {0, nullptr, DVASPECT_CONTENT, -1, TYMED_NULL} , 0, pAdvSink, *pdwConnection };
adviseSinks.append(data);
pAdvSink->AddRef();
@@ -3779,7 +3730,7 @@ HRESULT WINAPI QAxServerBase::Close(DWORD dwSaveOption)
if (m_spAdviseSink)
m_spAdviseSink->OnClose();
- for (int i = 0; i < adviseSinks.count(); ++i) {
+ for (qsizetype i = 0; i < adviseSinks.size(); ++i) {
adviseSinks.at(i).pAdvSink->OnClose();
}
@@ -3788,6 +3739,25 @@ HRESULT WINAPI QAxServerBase::Close(DWORD dwSaveOption)
bool qax_disable_inplaceframe = true;
+// Find a status bar to hook into, hide and redirect its messages to
+// IOleInPlaceFrame if and only if the user did not explicitly show it or
+// added some widgets (QTBUG-99294).
+static QStatusBar *findStatusBar(QWidget *w)
+{
+ if (w == nullptr)
+ return nullptr;
+ QStatusBar *result = w->findChild<QStatusBar*>();
+ if (result == nullptr)
+ return nullptr;
+ if (result->isVisible() && result->testAttribute(Qt::WA_WState_ExplicitShowHide))
+ return nullptr;
+ for (auto child : result->children()) {
+ if (child->isWidgetType() && qobject_cast<QSizeGrip *>(child) == nullptr)
+ return nullptr;
+ }
+ return result;
+}
+
/*
Executes the steps to activate the control.
*/
@@ -3870,8 +3840,7 @@ HRESULT QAxServerBase::internalActivate()
menuBar->hide();
menuBar->installEventFilter(this);
}
- statusBar = qt.widget ? qt.widget->findChild<QStatusBar*>() : nullptr;
- if (statusBar && !statusBar->isVisible()) {
+ if (auto *statusBar = findStatusBar(qt.widget)) {
const int index = statusBar->metaObject()->indexOfSignal("messageChanged(QString)");
QMetaObject::connect(statusBar, index, this, STATUSBAR_MESSAGE_CHANGED_SLOT_INDEX);
statusBar->hide();
@@ -4115,7 +4084,7 @@ HRESULT WINAPI QAxServerBase::SetMoniker(DWORD, IMoniker*)
*/
HRESULT WINAPI QAxServerBase::Unadvise(DWORD dwConnection)
{
- for (int i = 0; i < adviseSinks.count(); ++i) {
+ for (qsizetype i = 0; i < adviseSinks.size(); ++i) {
STATDATA entry = adviseSinks.at(i);
if (entry.dwConnection == dwConnection) {
entry.pAdvSink->Release();
@@ -4212,7 +4181,7 @@ HRESULT WINAPI QAxServerBase::DAdvise(FORMATETC *pformatetc, DWORD advf,
if (pformatetc->dwAspect != DVASPECT_CONTENT)
return E_FAIL;
- *pdwConnection = adviseSinks.count() + 1;
+ *pdwConnection = adviseSinks.size() + 1;
STATDATA data = {
{pformatetc->cfFormat,pformatetc->ptd,pformatetc->dwAspect,pformatetc->lindex,pformatetc->tymed},
advf, pAdvSink, *pdwConnection
diff --git a/src/activeqt/control/qaxserverdll.cpp b/src/activeqt/control/qaxserverdll.cpp
index c1e6767..38169db 100644
--- a/src/activeqt/control/qaxserverdll.cpp
+++ b/src/activeqt/control/qaxserverdll.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <qapplication.h>
#include <private/qcoreapplication_p.h>
@@ -126,8 +79,8 @@ STDAPI DllCanUnloadNow()
// check if qApp still runs widgets (in other DLLs)
QWidgetList widgets = QApplication::allWidgets();
- int count = widgets.count();
- for (int w = 0; w < widgets.count(); ++w) {
+ qsizetype count = widgets.size();
+ for (qsizetype w = 0; w < widgets.size(); ++w) {
// remove all Qt generated widgets
QWidget *widget = widgets.at(w);
if (widget->windowType() == Qt::Desktop || widget->objectName() == QLatin1String("Qt internal tablet widget"))
diff --git a/src/activeqt/control/qaxservermain.cpp b/src/activeqt/control/qaxservermain.cpp
index 74739a2..30be5b0 100644
--- a/src/activeqt/control/qaxservermain.cpp
+++ b/src/activeqt/control/qaxservermain.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <qstringlist.h>
#include <qlist.h>
@@ -134,7 +87,7 @@ bool qax_startServer(QAxFactory::ServerType type)
return true;
const QStringList keys = qAxFactory()->featureList();
- const int keyCount = keys.count();
+ const qsizetype keyCount = keys.size();
if (!keyCount)
return false;
@@ -142,7 +95,7 @@ bool qax_startServer(QAxFactory::ServerType type)
StartMonitor();
classRegistration = new DWORD[keyCount];
- int object = 0;
+ qsizetype object = 0;
for (object = 0; object < keyCount; ++object) {
IUnknown* p = nullptr;
CLSID clsid = qAxFactory()->classID(keys.at(object));
@@ -209,7 +162,7 @@ static inline QStringList commandLineArguments()
static inline bool matchesOption(const QString &arg, const char *option)
{
return (arg.startsWith(QLatin1Char('/')) || arg.startsWith(QLatin1Char('-')))
- && arg.rightRef(arg.size() - 1).compare(QLatin1String(option), Qt::CaseInsensitive) == 0;
+ && arg.right(arg.size() - 1).compare(QLatin1String(option), Qt::CaseInsensitive) == 0;
}
namespace {
@@ -247,7 +200,7 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
int nRet = 0;
bool run = true;
bool runServer = false;
- for (int i = 0; i < cmds.count(); ++i) {
+ for (qsizetype i = 0; i < cmds.size(); ++i) {
const QString &cmd = cmds.at(i);
if (matchesOption(cmd, "activex") || matchesOption(cmd, "embedding")) {
runServer = true;
@@ -269,13 +222,13 @@ EXTERN_C int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
break;
} else if (matchesOption(cmd, "dumpidl")) {
++i;
- if (i < cmds.count()) {
+ if (i < cmds.size()) {
const QString &outfile = cmds.at(i);
++i;
QString version;
- if (i < cmds.count() && matchesOption(cmds.at(i), "version")) {
+ if (i < cmds.size() && matchesOption(cmds.at(i), "version")) {
++i;
- if (i < cmds.count())
+ if (i < cmds.size())
version = cmds.at(i);
else
version = QStringLiteral("1.0");
diff --git a/src/activeqt/control/qclassfactory_p.h b/src/activeqt/control/qclassfactory_p.h
index 7133dfc..a92976b 100644
--- a/src/activeqt/control/qclassfactory_p.h
+++ b/src/activeqt/control/qclassfactory_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QCLASSFACTORY_P_H
#define QCLASSFACTORY_P_H
diff --git a/src/activeqt/doc/ActiveQtDoc b/src/activeqt/doc/ActiveQtDoc
index 4a2b06b..4b5e674 100644
--- a/src/activeqt/doc/ActiveQtDoc
+++ b/src/activeqt/doc/ActiveQtDoc
@@ -7,9 +7,14 @@
#include "qaxbindable.h"
#include "qaxfactory.h"
#include "qaxobject.h"
+#include "qaxobjectinterface.h"
#include "qaxscript.h"
#include "qaxselect.h"
#include "qaxtypefunctions.h"
#include "qaxtypes.h"
#include "qaxwidget.h"
#include "qaxutils_p.h"
+
+#ifndef WINAPI
+#define WINAPI
+#endif
diff --git a/src/activeqt/doc/CMakeLists.txt b/src/activeqt/doc/CMakeLists.txt
new file mode 100644
index 0000000..c9ff536
--- /dev/null
+++ b/src/activeqt/doc/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_library(ActiveQt INTERFACE)
+target_link_libraries(ActiveQt INTERFACE Qt::Core)
+qt_internal_add_docs(ActiveQt activeqt.qdocconf)
diff --git a/src/activeqt/doc/activeqt.qdocconf b/src/activeqt/doc/activeqt.qdocconf
index c84e712..2a077ce 100644
--- a/src/activeqt/doc/activeqt.qdocconf
+++ b/src/activeqt/doc/activeqt.qdocconf
@@ -20,10 +20,6 @@ qhp.ActiveQt.virtualFolder = activeqt
qhp.ActiveQt.indexTitle = Active Qt
qhp.ActiveQt.indexRoot =
-qhp.ActiveQt.filterAttributes = activeqt $QT_VERSION qtrefdoc
-qhp.ActiveQt.customFilters.Qt.name = ActiveQt $QT_VERSION
-qhp.ActiveQt.customFilters.Qt.filterAttributes = activeqt $QT_VERSION
-
qhp.ActiveQt.subprojects = qaxcontainerclasses qaxserverclasses
qhp.ActiveQt.subprojects.qaxcontainerclasses.title = QAxContainer C++ Classes
qhp.ActiveQt.subprojects.qaxcontainerclasses.indexTitle = QAxContainer C++ Classes
@@ -37,7 +33,7 @@ qhp.ActiveQt.subprojects.qaxserverclasses.sortPages = true
tagfile = ../../../doc/activeqt/activeqt.tags
-depends += qtcore qtdesigner qtdoc qtopengl qtscript qtwidgets qtgui
+depends += qtcore qtdesigner qtdoc qtopengl qtwidgets qtgui qtcmake
headerdirs += ..
diff --git a/src/activeqt/doc/snippets/doc_src_activeqt-dumpcpp.cpp b/src/activeqt/doc/snippets/doc_src_activeqt-dumpcpp.cpp
index 71c700c..25b26ca 100644
--- a/src/activeqt/doc/snippets/doc_src_activeqt-dumpcpp.cpp
+++ b/src/activeqt/doc/snippets/doc_src_activeqt-dumpcpp.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
Outlook::Application *outlook = new Outlook::Application;
diff --git a/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc b/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc
deleted file mode 100644
index 910075d..0000000
--- a/src/activeqt/doc/snippets/doc_src_examples_activeqt_dotnet.qdoc
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-' VB is case insensitive, but our C++ controls are not.
-' Me.resetButton.enabled = True
-//! [0]
diff --git a/src/activeqt/doc/snippets/doc_src_qaxcontainer.pro b/src/activeqt/doc/snippets/doc_src_qaxcontainer.pro
index 74883af..14dc383 100644
--- a/src/activeqt/doc/snippets/doc_src_qaxcontainer.pro
+++ b/src/activeqt/doc/snippets/doc_src_qaxcontainer.pro
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#! [0]
QT += axcontainer
diff --git a/src/activeqt/doc/snippets/doc_src_qaxserver.cpp b/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
index daa764d..decfca2 100644
--- a/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
+++ b/src/activeqt/doc/snippets/doc_src_qaxserver.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [3]
#include <QWidget>
diff --git a/src/activeqt/doc/snippets/doc_src_qaxserver.pro b/src/activeqt/doc/snippets/doc_src_qaxserver.pro
index 3bf2275..adf8fd5 100644
--- a/src/activeqt/doc/snippets/doc_src_qaxserver.pro
+++ b/src/activeqt/doc/snippets/doc_src_qaxserver.pro
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#! [0]
TEMPLATE = app
diff --git a/src/activeqt/doc/snippets/doc_src_qaxserver.qdoc b/src/activeqt/doc/snippets/doc_src_qaxserver.qdoc
index 6d42a45..fe6c12b 100644
--- a/src/activeqt/doc/snippets/doc_src_qaxserver.qdoc
+++ b/src/activeqt/doc/snippets/doc_src_qaxserver.qdoc
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [12]
cabarc N simpleax.cab simpleax.exe simple.inf
diff --git a/src/activeqt/doc/snippets/qtactive-module-use.qdocinc b/src/activeqt/doc/snippets/qtactive-module-use.qdocinc
new file mode 100644
index 0000000..5758dc5
--- /dev/null
+++ b/src/activeqt/doc/snippets/qtactive-module-use.qdocinc
@@ -0,0 +1,23 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+//! [building with cmake]
+ Use the \c {find_package()} command to locate the needed module components
+ in the \c {Qt6} package:
+
+ \code
+ find_package(Qt6 REQUIRED COMPONENTS \1 \2)
+ target_link_libraries(mytarget PRIVATE Qt6::\1 Qt6::\2)
+ \endcode
+
+ For more details, see the \l {Build with CMake} overview.
+//! [building with cmake]
+
+//! [building_with_qmake]
+ To configure the modules for building with qmake, add the module as a value
+ of the \c QT variable in the project's .pro file:
+
+ \code
+ QT += \1 \2
+ \endcode
+//! [building_with_qmake]
diff --git a/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp b/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
index b8ab34b..455c030 100644
--- a/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_container_qaxbase.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
connect(buttonBack, SIGNAL(clicked()), webBrowser, SLOT(GoBack()));
diff --git a/src/activeqt/doc/snippets/src_activeqt_container_qaxscript.cpp b/src/activeqt/doc/snippets/src_activeqt_container_qaxscript.cpp
index 9ec9cc2..9b7c7a5 100644
--- a/src/activeqt/doc/snippets/src_activeqt_container_qaxscript.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_container_qaxscript.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
function setNumber(number)
diff --git a/src/activeqt/doc/snippets/src_activeqt_container_qaxselect.cpp b/src/activeqt/doc/snippets/src_activeqt_container_qaxselect.cpp
index 720aba6..34ee59c 100644
--- a/src/activeqt/doc/snippets/src_activeqt_container_qaxselect.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_container_qaxselect.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
QAxSelect select;
diff --git a/src/activeqt/doc/snippets/src_activeqt_control_qaxbindable.cpp b/src/activeqt/doc/snippets/src_activeqt_control_qaxbindable.cpp
index b532c60..171ff3f 100644
--- a/src/activeqt/doc/snippets/src_activeqt_control_qaxbindable.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_control_qaxbindable.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
class MyActiveX : public QWidget, public QAxBindable
diff --git a/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp b/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
index 73748e0..15288ae 100644
--- a/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
+++ b/src/activeqt/doc/snippets/src_activeqt_control_qaxfactory.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
QStringList ActiveQtFactory::featureList() const
diff --git a/src/activeqt/doc/src/activeqt-dumpcpp.qdoc b/src/activeqt/doc/src/activeqt-dumpcpp.qdoc
index ee37f51..8e685f4 100644
--- a/src/activeqt/doc/src/activeqt-dumpcpp.qdoc
+++ b/src/activeqt/doc/src/activeqt-dumpcpp.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page activeqt-dumpcpp.html
@@ -63,6 +39,9 @@
\li -compat
\li Generate namespace with dynamicCall-compatible API
\row
+ \li -controlname
+ \li Use the control class name instead of the UUID in setControl()
+ \row
\li -v
\li Print version information
\row
diff --git a/src/activeqt/doc/src/activeqt-dumpdoc.qdoc b/src/activeqt/doc/src/activeqt-dumpdoc.qdoc
index 348c06a..70d46ca 100644
--- a/src/activeqt/doc/src/activeqt-dumpdoc.qdoc
+++ b/src/activeqt/doc/src/activeqt-dumpdoc.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page activeqt-dumpdoc.html
diff --git a/src/activeqt/doc/src/activeqt-index.qdoc b/src/activeqt/doc/src/activeqt-index.qdoc
index ff4f404..6a5d503 100644
--- a/src/activeqt/doc/src/activeqt-index.qdoc
+++ b/src/activeqt/doc/src/activeqt-index.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\group activeqt-tools
@@ -36,6 +12,15 @@
*/
/*!
+ \group activeqt-examples
+ \title ActiveQt Examples and Tutorials
+ \brief List of ActiveQt examples and tutorials.
+ \ingroup groups
+
+ This page lists ActiveQt examples and tutorials:
+*/
+
+/*!
\page activeqt-index.html
\ingroup qt-activex
\keyword ActiveQt
@@ -43,14 +28,14 @@
\title Active Qt
\brief Provides ActiveX and COM integration on Windows
- Qt's ActiveX and COM support allows Qt for Windows developers to:
+ Qt's ActiveX and COM support enables Qt for Windows developers to:
\list
- \li Access and use ActiveX controls and COM objects provided by any
- ActiveX server in their Qt applications.
- \li Make their Qt applications available as COM servers, with
- any number of Qt objects and widgets as COM objects and ActiveX
- controls.
+ \li Access and use ActiveX controls and COM objects provided by any
+ ActiveX server in their Qt applications.
+ \li Make their Qt applications available as COM servers, with
+ any number of Qt objects and widgets as COM objects and ActiveX
+ controls.
\endlist
For more information about using ActiveX with Qt, see
@@ -59,93 +44,63 @@
The ActiveQt framework consists of two modules:
\list
- \li The \l{Using ActiveX controls and COM in Qt}{QAxContainer}
- module is a static library implementing QObject and QWidget subclasses,
- QAxObject and QAxWidget, that act as containers for COM objects and
- ActiveX controls.
- \li The \l{Building ActiveX servers in Qt}{QAxServer}
- module is a static library that implements
- functionality for in-process and executable COM servers. This
- module provides the QAxAggregated, QAxBindable and QAxFactory
- classes.
+ \li The \l{Using ActiveX controls and COM in Qt}{QAxContainer}
+ module is a static library that implements a QObject subclass,
+ QAxObject, and a QWidget subclass, QAxWidget, which act as containers
+ for COM objects and ActiveX controls.
+ \li The \l{Building ActiveX servers in Qt}{QAxServer}
+ module is a static library that implements functionality for in-process
+ and executable COM servers. This module provides the QAxAggregated,
+ QAxBindable, and QAxFactory classes.
\endlist
A set of \l{Tools for ActiveQt}{tools} is provided to simplify the
developing and building of Qt projects that use ActiveX.
- To build the static libraries, change into the \c activeqt directory
- (usually \c QTDIR/src/activeqt), and run \c qmake and your make
- tool in both the \c container and the \c control subdirectory.
- The \c qaxcontainer and \c qaxserver libraries will be linked
- into \c QTDIR/lib.
+ \section1 Using the Module
- If you are using a shared configuration of Qt enter the \c plugin
- subdirectory and run \c qmake and your make tool to build a
- plugin that integrates the QAxContainer module into \l{Qt
- Designer}.
+ \include {module-use.qdocinc} {using the c++ api}
- \section1 Articles and Guides
- \list
- \li \l{Tools for ActiveQt}
- \li \l{Using ActiveX controls and COM in Qt}
- \li \l{Building ActiveX servers in Qt}
- \endlist
+ \section2 Building with CMake
- \section1 Licenses and Attributions
+ \include {qtactive-module-use.qdocinc} {building with cmake}
+ {AxContainer} {AxServer}
- The QAxContainer and QAxServer modules are available under
- commercial licenses from \l{The Qt Company}. In addition, they
- are available under the \l{BSD 3-clause "New" or "Revised" License}:
+ \section2 Building with qmake
- \badcode
- Copyright (C) 2017 The Qt Company Ltd.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- * Neither the name of The Qt Company Ltd nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- \endcode
+ \include {qtactive-module-use.qdocinc} {building_with_qmake}
+ {axcontainer} {axserver}
- See \l{Qt Licensing} for further details.
-
- \section1 Reference
+ \section1 Articles and Guides
\list
- \li \l{QAxContainer C++ Classes}
- \li \l{QAxServer C++ Classes}
+ \li \l{Tools for ActiveQt}
+ \li \l{Using ActiveX controls and COM in Qt}
+ \li \l{Building ActiveX servers in Qt}
\endlist
+ \target ActiveQt Examples
\section1 Examples
+
\list
- \li \l{Multiple Example (ActiveQt)}
- \li \l{Qutlook Example (ActiveQt)}
- \li \l{COM App Example (ActiveQt)}
- \li \l{Dot Net Example (ActiveQt)}
- \li \l{OpenGL Example (ActiveQt)}
- \li \l{Hierarchy Example (ActiveQt)}
- \li \l{Media Player Example (ActiveQt)}
- \li \l{Menus Example (ActiveQt)}
- \li \l{Wrapper Example (ActiveQt)}
- \li \l{Simple Example (ActiveQt)}
+ \li \l{Qutlook Example (ActiveQt)}
+ \li \l{COM App Example (ActiveQt)}
+ \li \l{Wrapper Example (ActiveQt)}
+ \li \l{Simple Example (ActiveQt)}
\endlist
+
+ \section1 Reference
+
+ \list
+ \li \l{QAxContainer C++ Classes}
+ \li \l{QAxServer C++ Classes}
+ \endlist
+
+ \section1 Licenses and Attributions
+
+ The QAxContainer and QAxServer modules are available under
+ commercial licenses from \l{The Qt Company}. In addition, they
+ are available under the \l{BSD 3-clause "New" or "Revised" License}:
+
+ See \l{Qt Licensing} for further details.
*/
diff --git a/src/activeqt/doc/src/examples/dotnet.qdoc b/src/activeqt/doc/src/examples/dotnet.qdoc
deleted file mode 100644
index 5fe1466..0000000
--- a/src/activeqt/doc/src/examples/dotnet.qdoc
+++ /dev/null
@@ -1,334 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page activeqt-dotnet.html
- \title Dot Net Example (ActiveQt)
-
- \brief The Dot Net example demonstrates how Qt objects can be used in a
- .NET environment, and how .NET objects can be used in a Qt
- environment.
-
- Contents:
-
- \tableofcontents
-
- \section1 Qt vs. .NET
-
- Qt is a C++ library and is compiled into traditional, native
- binaries that make full use of the performance provided by the
- runtime environment.
-
- One of the key concepts of .NET is the idea of "intermediate language
- code" - the source code is compiled into a bytecode format, and at
- runtime, that bytecode is executed in a virtual machine - the \e
- {Common Language Runtime} (CLR).
-
- Another key concept is that of \e {managed code}. This is essentially
- intermediate language code written in such a way that the CLR can take
- care of the memory management, i.e. the CLR will do automatic garbage
- collection, so the application code does not need to explicitly free
- the memory for unused objects.
-
- The MS compilers for C# and VB.NET will only produce managed
- code. Such programs cannot directly call normal, native functions
- or classes. \footnote The .NET framework provides Platform Invocation
- Services - P/Invoke - that enable managed code to call native C (not
- C++) functions located in DLLs directly. The resulting application
- then becomes partially unmanaged.\endfootnote
-
- The MS C++ compiler for .NET on the other hand, can produce both
- normal and managed code. To write a C++ class that can be compiled
- into managed code, the developer must flag the class as managed using
- the \c __gc keyword, and restrict the code to only use the subset of
- C++ known as "Managed Extensions for C++", or MC++ for short. The
- advantage is that MC++ code can freely call and use normal C++
- functions and classes. And it also works the other way around: normal
- C++ code can call managed functions and use managed classes (e.g. the
- entire .NET framework class library), including managed functions and
- classes implemented in C# or VB.NET. This feature of mixing managed
- and normal C++ code immensely eases the interoperability with .NET,
- and is by Microsoft referred to as the "It Just Works" (IJW) feature.
-
- This document demonstrates two different ways of integrating normal
- C++ code (that uses Qt) with managed .NET code. First, the manual way
- is presented, which includes using a thin MC++ wrapper class around
- the normal Qt/C++ class. Then, the automated way is presented, which
- utilizes the ActiveQt framework as a generic bridge. The advantage of
- the first method is that it gives the application developer full
- control, while the second method requires less coding and relieves the
- developer of dealing with the conversion between managed and normal
- data objects.
-
- The impatient reader, who right away wants to see a QPushButton
- and a custom Qt widget (\l{activeqt/multiple}{QAxWidget2}) run in
- a .NET GUI application is referred to the example directory of
- ActiveQt. It contains the result of this walkthrough using both
- C# and VB.NET, created with Visual Studio .NET (not 2003).
- Load \c {examples/dotnet/walkthrough/csharp.csproj},
- \c {examples/dotnet/walkthrough/vb.vbproj}
- or \c {examples/dotnet/wrapper/wrapper.sln} into the IDE and run
- the solution.
-
- \b{Remark:} You will notice that in the generated code the following line is
- commented out:
-
- \snippet doc_src_examples_activeqt_dotnet.qdoc 0
-
- This line is regenerated without comment whenever you change the
- dialog, in which case you have to comment it out again to be able
- to run the project. This is a bug in the original version of
- Visual Studio.NET, and is fixed in the 2003 edition.
-
- \section1 Walkthrough: .NET Interop with MC++ and IJW
-
- Normal C++ classes and functions can be used from managed .NET code by
- providing thin wrapper classes written in MC++. The wrapper class will
- take care of forwarding the calls to the normal C++ functions or
- methods, and converting parameter data as necessary. Since the wrapper
- class is a managed class, it can be used without further ado in any
- managed .NET application, whether written in C#, VB.NET, MC++ or other
- managed programming language.
-
- \snippet activeqt/dotnet/wrapper/lib/worker.h 0
-
- The Qt class has nothing unusual for Qt users, and as even the Qt
- specialities like \c Q_PROPERTY, \c slots and \c signals are
- implemented with straight C++ they don't cause any trouble when
- compiling this class with any C++ compiler.
-
- \snippet activeqt/dotnet/wrapper/lib/networker.h 0
-
- The .NET wrapper class uses keywords that are part of MC++ to indicate
- that the class is managed/garbage collected (\c {__gc}), and that \c
- StatusString should be accessible as a property in languages that
- support this concept (\c {__property}). We also declare an event
- function \c statusStringChanged(String*) (\c {__event}), the
- equivalent of the respective signal in the Qt class.
-
- Before we can start implementing the wrapper class we need a way to
- convert Qt's datatypes (and potentionally your own) into .NET
- datatypes, e.g. \c QString objects need to be converted into objects
- of type \c {String*}.
-
- When operating on managed objects in normal C++ code, a little extra
- care must be taken because of the CLR's garbage collection. A normal
- pointer variable should not \footnote Indeed, the compiler will in
- many cases disallow it. \endfootnote be used to refer to a managed
- object. The reason is that the garbage collection can kick in at any
- time and move the object to another place on the heap, leaving you
- with an invalid pointer.
-
- However, two methods are provided that solves this problem easily. The
- first is to use a \e pinned pointer, i.e. declare the pointer variable
- with the \c __pin keyword. This guarantees that the object pointed to
- will not be moved by the garbage collector. It is recommended that
- this method not be used to keep a references to managed objects for a
- long time, since it will decrease the efficiency of the garbage
- collector. The second way is to use the \c gcroot smartpointer
- template type. This lets you create safe pointers to managed
- objects. E.g. a variable of type \c gcroot<String> will always point
- to the String object, even if it has been moved by the garbage
- collector, and it can be used just like a normal pointer.
-
- \snippet activeqt/dotnet/wrapper/lib/tools.cpp 0
- \codeline
- \snippet activeqt/dotnet/wrapper/lib/tools.cpp 1
-
- The convertor functions can then be used in the wrapper class
- implementation to call the functions in the native C++ class.
-
- \snippet activeqt/dotnet/wrapper/lib/networker.cpp 0
- \codeline
- \snippet activeqt/dotnet/wrapper/lib/networker.cpp 1
-
- The constructor and destructor simply create and destroy the Qt
- object wrapped using the C++ operators \c new and \c delete.
-
- \snippet activeqt/dotnet/wrapper/lib/networker.cpp 2
-
- The netWorker class delegates calls from the .NET code to the native
- code. Although the transition between those two worlds implies a small
- performance hit for each function call, and for the type conversion,
- this should be negligible since we are anyway going to run within the
- CLR.
-
- \snippet activeqt/dotnet/wrapper/lib/networker.cpp 3
-
- The property setter calls the native Qt class before firing the
- event using the \c __raise keyword.
-
- This wrapper class can now be used in .NET code, e.g. using C++, C#,
- Visual Basic or any other programming language available for .NET.
-
- \snippet activeqt/dotnet/wrapper/main.cs 0
- \snippet activeqt/dotnet/wrapper/main.cs 1
- \snippet activeqt/dotnet/wrapper/main.cs 2
- \snippet activeqt/dotnet/wrapper/main.cs 3
-
- \section1 Walkthrough: .NET/COM Interop with ActiveQt
-
- Fortunately .NET provides a generic wrapper for COM objects, the
- \e {Runtime Callable Wrapper} (RCW). This RCW is a proxy for the
- COM object and is generated by the CLR when a .NET Framework client
- activates a COM object. This provides a generic way to reuse COM
- objects in a .NET Framework project.
-
- Making a QObject class into a COM object is easily achieved with
- ActiveQt and demonstrated in the QAxServer examples (e.g., the
- \l{activeqt/simple}{Simple} example). The walkthrough will use
- the Qt classes implemented in those examples, so the first thing
- to do is to make sure that those examples have been built
- correctly, e.g. by opening the
- \l{qaxserver-demo-multiple.html}{demonstration pages} in Internet
- Explorer to verify that the controls are functional.
-
- \section2 Starting a Project
-
- Start Visual Studio.NET, and create a new C# project for writing a
- Windows application. This will present you with an empty form in
- Visual Studio's dialog editor. You should see the toolbox, which
- presents you with a number of available controls and objects in
- different categories. If you right-click on the toolbox it allows
- you to add new tabs. We will add the tab "Qt".
-
- \section2 Importing Qt Widgets
-
- The category only has a pointer tool by default, and we have to add
- the Qt objects we want to use in our form. Right-click on the empty
- space, and select "Customize". This opens a dialog that has two
- tabs, "COM Components" and ".NET Framework Components". We used
- ActiveQt to wrap \l {QWidget}s into COM objects, so we select the "COM
- Components" page, and look for the classes we want to use, e.g.
- "QPushButton" and "QAxWidget2".
-
- When we select those widgets and close the dialog the two widgets
- will now be available from the toolbox as grey squares with their
- name next to it \footnote Icons could be added by modifying the
- way the controls register themselves. \endfootnote.
-
- \section2 Using Qt Widgets
-
- We can now add an instance of QAxWidget2 and a QPushButton to
- the form. Visual Studio will automatically generate the RCW for the
- object servers. The QAxWidget2 instance takes most of the upper
- part of the form, with the QPushButton in the lower right corner.
-
- In the property editor of Visual Studio we can modify the properties
- of our controls - QPushButton exposes the \c QWidget API and has many
- properties, while QAxWidget2 has only the Visual Studio standard
- properties in addition to its own property "lineWidth" in the
- "Miscellaneous" category. The objects are named "axQPushButton1" and
- "axQAxWidget21", and since especially the last name is a bit
- confusing we rename the objects to "resetButton" and "circleWidget".
-
- We can also change the Qt properties, e.g. set the "text" property
- of the \c resetButton to "Reset", and the "lineWidth" property of the
- \c circleWidget to 5. We can also put those objects into the layout
- system that Visual Studio's dialog editor provides, e.g. by setting
- the anchors of the \c circleWidget to "Left, Top, Right, Bottom", and
- the anchors of the \c resetButton to "Bottom, Right".
-
- Now we can compile and start the project, which will open a user
- interface with our two Qt widgets. If we can resize the dialog,
- the widgets will resize appropriately.
-
- \section2 Handling Qt Signals
-
- We will now implement event handlers for the widgets. Select the
- \c circleWidget and select the "Events" page in the property
- editor. The widget exposes events because the QAxWidget2 class has
- the "StockEvents" attribute set in its class definition. We implement
- the event handler \c circleClicked for the \c ClickEvent to increase
- the line width by one for every click:
-
- \snippet activeqt/dotnet/walkthrough/Form1.cs 0
-
- In general we can implement a default event handler by double
- clicking on the widget in the form, but the default events for
- our widgets are right now not defined.
-
- We will also implement an event handler for the \c clicked signal
- emitted by QPushButton. Add the event handler \c resetLineWidth to
- the \c clicked event, and implement the generated function:
-
- \snippet activeqt/dotnet/walkthrough/Form1.cs 1
-
- We reset the property to 1, and also call the \c setFocus() slot
- to simulate the user style on Windows, where a button grabs focus
- when you click it (so that you can click it again with the spacebar).
-
- If we now compile and run the project we can click on the circle
- widget to increase its line width, and press the reset button to
- set the line width back to 1.
-
- \section1 Summary
-
- Using ActiveQt as a universal interoperability bridge between the
- .NET world and the native world of Qt is very easy, and makes it
- often unnecessary to implement a lot of handwritten wrapper classes.
- Instead, the QAxFactory implementation in the otherwise completely
- cross-platform Qt project provides the glue that .NET needs to to
- generate the RCW.
-
- If this is not sufficient we can implement our own wrapper classes
- thanks to the C++ extensions provided by Microsoft.
-
- \section2 Limitations
-
- All the limitations when using ActiveQt are implied when using this
- technique to interoperate with .NET, e.g. the datatypes we can use
- in the APIs can only be those supported by ActiveQt and COM. However,
- since this includes subclasses of QObject and QWidget we can wrap
- any of our datatypes into a QObject subclass to make its API
- available to .NET. This has the positive side effect that the same
- API is automatically available when using \l {Qt Script} to automate
- Qt applications and to COM clients in general.
-
- When using the "IJW" method, in principle the only limitation is the
- time required to write the wrapper classes and data type conversion
- functions.
-
- \section2 Performance Considerations
-
- Every call from CLR bytecode to native code implies a small
- performance hit, and necessary type conversions introduce an
- additional delay with every layer that exists between the two
- frameworks. Consequently every approach to mix .NET and native
- code should try to minimize the communication necessary between
- the different worlds.
-
- As ActiveQt introduces three layers at once - the RCW, COM and finally
- ActiveQt itself - the performance penalty when using the generic
- Qt/ActiveQt/COM/RCW/.NET bridge is larger than when using a
- hand-crafted IJW-wrapper class. The execution speed however is still
- sufficient for connecting to and modifying interactive elements in a
- user interface, and as soon as the benefit of using Qt and C++ to
- implement and compile performance critical algorithms into native code
- kicks in, ActiveQt becomes a valid choice for making even non-visual
- parts of your application accessible to .NET.
-*/
diff --git a/src/activeqt/doc/src/qtaxcontainer.qdoc b/src/activeqt/doc/src/qtaxcontainer.qdoc
index 83a6249..b139a81 100644
--- a/src/activeqt/doc/src/qtaxcontainer.qdoc
+++ b/src/activeqt/doc/src/qtaxcontainer.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QAxContainer
\title QAxContainer C++ Classes
@@ -160,8 +136,6 @@
object and its subobjects; note that not all of the COM object's APIs
might be available.
- See the \l{activeqt/mediaplayer}{Media Player} example for more information.
-
\section2 Calling Function Through a Script Engine
A Qt application can host any ActiveScript engine installed on the system.
diff --git a/src/activeqt/doc/src/qtaxserver.qdoc b/src/activeqt/doc/src/qtaxserver.qdoc
index c9ba9d9..c7fa1ff 100644
--- a/src/activeqt/doc/src/qtaxserver.qdoc
+++ b/src/activeqt/doc/src/qtaxserver.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\module QAxServer
@@ -97,7 +73,9 @@
compiler installation)
\li Attach the resulting type library as a binary resource to the server
binary (again using the \l idc tool)
- \li Register the server
+ \li Register the server. This step may require administrative privileges
+ and can be skipped by setting the \c qaxserver_no_register
+ configuration.
\endlist
To skip the post-processing step, also set the \c qaxserver_no_postlink
@@ -417,8 +395,8 @@
\li [in, out] struct QPoint (user defined)
\endtable
- Also supported are exported enums and flags (see Q_ENUMS() and
- Q_FLAGS()). The in-parameter types are also supported as
+ Also supported are exported enums and flags (see Q_ENUM() and
+ Q_FLAG()). The in-parameter types are also supported as
return values.
Properties and signals/slots that have parameters using any other
@@ -680,6 +658,24 @@
If the server runs, see the following section for information on
debugging your server.
+ \section3 Crashes when unloading and reloading COM servers
+
+ If ActiveQt COM servers utilize Qt modules beyond those found in Qt Base, it
+ is necessary to activate the COM server as an out-of-process COM server.
+ Attempting to activate an in-process COM server that includes modules such
+ as Qt Quick may result in a crash after unloading the COM server.
+
+ \section3 Crash or unexpected behavior during outgoing COM calls
+
+ Be aware that an out-of-process COM server will be processing its message
+ queue while it is performing an outgoing call to the client. This can lead to
+ unexpected behavior or crash if the client is at the same time calling the
+ server. In this situation, the incoming call will be executed in the server
+ before the outgoing call returns. In particular, if the client closes
+ an ActiveX control while the control is calling back into the client, this
+ can lead to crash. Such reentrancy problems can be mitigated using message
+ filters (IMessageFilter and CoRegisterMessageFilter).
+
\section2 Debugging Runtime Errors
To debug an in-process server in Visual Studio, set the server project
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index 40f5e0a..d9175ea 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -1,54 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#define NOMINMAX
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <ocidl.h>
#include <olectl.h>
@@ -60,6 +11,7 @@
#include <qcursor.h>
#include <qpixmap.h>
#include <qpainter.h>
+#include <private/qpixmap_win_p.h>
#include <qobject.h>
#include <qdebug.h>
#ifdef QAX_SERVER
@@ -139,9 +91,6 @@ static QFont IFontToQFont(IFont *f)
return font;
}
-Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
-Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
-
static IPictureDisp *QPixmapToIPicture(const QPixmap &pixmap)
{
IPictureDisp *pic = nullptr;
@@ -263,26 +212,42 @@ static QByteArray msgOutParameterNotSupported(const QByteArray &type)
} \
}
+static qsizetype columnCount2D(const QVariantList &list)
+{
+ if (!list.isEmpty()) {
+ const auto &firstElement = list.at(0);
+ const auto type = firstElement.typeId();
+ if (type != QMetaType::QString && type != QMetaType::QByteArray
+ && firstElement.canConvert<QVariantList>()) {
+ return firstElement.toList().size();
+ }
+ }
+ return 0;
+}
+
bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
{
QVariant qvar = var;
// "type" is the expected type, so coerce if necessary
- const QVariant::Type proptype = typeName.isEmpty() ? QVariant::Invalid : QVariant::nameToType(typeName);
- if (proptype != QVariant::Invalid
- && proptype != QVariant::UserType
- && proptype != int(QMetaType::QVariant)
- && proptype != qvar.type()) {
- if (qvar.canConvert(proptype))
- qvar.convert(proptype);
+ const int proptype = typeName.isEmpty()
+ ? QMetaType::UnknownType
+ : QMetaType::fromName(typeName).id();
+ if (proptype != QMetaType::UnknownType
+ && proptype != QMetaType::User
+ && proptype != QMetaType::QVariant
+ && proptype != qvar.metaType().id()) {
+ const QMetaType metaType(proptype);
+ if (qvar.canConvert(metaType))
+ qvar.convert(metaType);
else
- qvar = QVariant(proptype);
+ qvar = QVariant(metaType);
}
if (out && arg.vt == (VT_VARIANT|VT_BYREF) && arg.pvarVal) {
return QVariantToVARIANT(var, *arg.pvarVal, typeName, false);
}
- if (out && proptype == QVariant::UserType && typeName == "QVariant") {
+ if (out && proptype == QMetaType::QVariant) {
VARIANT *pVariant = new VARIANT;
QVariantToVARIANT(var, *pVariant, QByteArray(), false);
arg.vt = VT_VARIANT|VT_BYREF;
@@ -290,8 +255,8 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
return true;
}
- switch ((int)qvar.type()) {
- case QVariant::String:
+ switch (qvar.metaType().id()) {
+ case QMetaType::QString:
if (out && arg.vt == (VT_BSTR|VT_BYREF)) {
if (*arg.pbstrVal)
SysFreeString(*arg.pbstrVal);
@@ -323,15 +288,15 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
QVARIANT_TO_VARIANT_POD(ushort, qvariant_cast<ushort>(qvar), out, VT_UI2, uiVal, puiVal)
break;
- case QVariant::Int:
+ case QMetaType::Int:
QVARIANT_TO_VARIANT_POD(long, qvar.toInt(), out, VT_I4, lVal, plVal)
break;
- case QVariant::UInt:
+ case QMetaType::UInt:
QVARIANT_TO_VARIANT_POD(uint, qvar.toUInt(), out, VT_UI4, uintVal, puintVal)
break;
- case QVariant::LongLong:
+ case QMetaType::LongLong:
if (out && arg.vt == (VT_CY|VT_BYREF)) { // VT_CY: Currency
arg.pcyVal->int64 = qvar.toLongLong();
} else {
@@ -339,7 +304,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::ULongLong:
+ case QMetaType::ULongLong:
if (out && arg.vt == (VT_CY|VT_BYREF)) { // VT_CY: Currency
arg.pcyVal->int64 = qvar.toULongLong();
} else {
@@ -347,7 +312,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::Bool:
+ case QMetaType::Bool:
QVARIANT_TO_VARIANT_POD(short, short(qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE),
out, VT_BOOL, boolVal, pboolVal)
break;
@@ -360,19 +325,19 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
QVARIANT_TO_VARIANT_POD(double, qvar.toDouble(), out, VT_R8, dblVal, pdblVal)
break;
- case QVariant::Color:
+ case QMetaType::QColor:
QVARIANT_TO_VARIANT_POD(long, QColorToOLEColor(qvariant_cast<QColor>(qvar)),
out, VT_COLOR, lVal, plVal)
break;
- case QVariant::Date:
- case QVariant::Time:
- case QVariant::DateTime: // DATE = double
+ case QMetaType::QDate:
+ case QMetaType::QTime:
+ case QMetaType::QDateTime: // DATE = double
QVARIANT_TO_VARIANT_POD(DATE, QDateTimeToDATE(qvar.toDateTime()),
out, VT_DATE, date, pdate)
break;
- case QVariant::Font:
+ case QMetaType::QFont:
if (out && arg.vt == (VT_DISPATCH|VT_BYREF)) {
if (*arg.ppdispVal)
(*arg.ppdispVal)->Release();
@@ -387,7 +352,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::Pixmap:
+ case QMetaType::QPixmap:
if (out && arg.vt == (VT_DISPATCH|VT_BYREF)) {
if (*arg.ppdispVal)
(*arg.ppdispVal)->Release();
@@ -402,7 +367,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::Cursor:
+ case QMetaType::QCursor:
{
#ifndef QT_NO_CURSOR
int shape = qvariant_cast<QCursor>(qvar).shape();
@@ -439,37 +404,37 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::List:
+ case QMetaType::QVariantList:
{
const auto list = qvar.toList();
- const int count = list.count();
+ const qsizetype count = list.size();
VARTYPE vt = VT_VARIANT;
- QVariant::Type listType = QVariant::Type(QMetaType::QVariant);
+ int listType = QMetaType::QVariant;
if (!typeName.isEmpty() && typeName.startsWith("QList<")) {
const QByteArray listTypeName = typeName.mid(6, typeName.length() - 7); // QList<int> -> int
- listType = QVariant::nameToType(listTypeName);
+ listType = QMetaType::fromName(listTypeName).id();
}
VARIANT variant;
void *pElement = &variant;
switch(listType) {
- case QVariant::Int:
+ case QMetaType::Int:
vt = VT_I4;
pElement = &variant.lVal;
break;
- case QVariant::Double:
+ case QMetaType::Double:
vt = VT_R8;
pElement = &variant.dblVal;
break;
- case QVariant::DateTime:
+ case QMetaType::QDateTime:
vt = VT_DATE;
pElement = &variant.date;
break;
- case QVariant::Bool:
+ case QMetaType::Bool:
vt = VT_BOOL;
pElement = &variant.boolVal;
break;
- case QVariant::LongLong:
+ case QMetaType::LongLong:
vt = VT_I8;
pElement = &variant.llVal;
break;
@@ -477,41 +442,33 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
break;
}
SAFEARRAY *array = nullptr;
- bool is2D = false;
// If the first element in the array is a list the whole list is
// treated as a 2D array. The column count is taken from the 1st element.
- if (count) {
- QVariantList col = list.at(0).toList();
- int maxColumns = col.count();
- if (maxColumns) {
- is2D = true;
- SAFEARRAYBOUND rgsabound[2] = { {0, 0}, {0, 0} };
- rgsabound[0].cElements = count;
- rgsabound[1].cElements = maxColumns;
- array = SafeArrayCreate(VT_VARIANT, 2, rgsabound);
- LONG rgIndices[2];
- for (LONG i = 0; i < count; ++i) {
- rgIndices[0] = i;
- QVariantList columns = list.at(i).toList();
- int columnCount = qMin(maxColumns, columns.count());
- for (LONG j = 0; j < columnCount; ++j) {
- const QVariant &elem = columns.at(j);
- VariantInit(&variant);
- QVariantToVARIANT(elem, variant, elem.typeName());
- rgIndices[1] = j;
- SafeArrayPutElement(array, rgIndices, pElement);
- clearVARIANT(&variant);
- }
+ if (qsizetype maxColumns = columnCount2D(list)) {
+ SAFEARRAYBOUND rgsabound[2] = { {0, 0}, {0, 0} };
+ rgsabound[0].cElements = count;
+ rgsabound[1].cElements = maxColumns;
+ array = SafeArrayCreate(VT_VARIANT, 2, rgsabound);
+ LONG rgIndices[2];
+ for (LONG i = 0; i < count; ++i) {
+ rgIndices[0] = i;
+ QVariantList columns = list.at(i).toList();
+ qsizetype columnCount = qMin(maxColumns, columns.size());
+ for (LONG j = 0; j < columnCount; ++j) {
+ const QVariant &elem = columns.at(j);
+ VariantInit(&variant);
+ QVariantToVARIANT(elem, variant, elem.typeName());
+ rgIndices[1] = j;
+ SafeArrayPutElement(array, rgIndices, pElement);
+ clearVARIANT(&variant);
}
-
}
- }
- if (!is2D) {
+ } else {
array = SafeArrayCreateVector(vt, 0, count);
for (LONG index = 0; index < count; ++index) {
QVariant elem = list.at(index);
- if (listType != QVariant::Type(QMetaType::QVariant))
- elem.convert(listType);
+ if (listType != QMetaType::QVariant)
+ elem.convert(QMetaType(listType));
VariantInit(&variant);
QVariantToVARIANT(elem, variant, elem.typeName());
SafeArrayPutElement(array, &index, pElement);
@@ -533,10 +490,10 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::StringList:
+ case QMetaType::QStringList:
{
const QStringList list = qvar.toStringList();
- const int count = list.count();
+ const qsizetype count = list.size();
SAFEARRAY *array = SafeArrayCreateVector(VT_BSTR, 0, count);
for (LONG index = 0; index < count; ++index) {
QString elem = list.at(index);
@@ -560,10 +517,10 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
- case QVariant::ByteArray:
+ case QMetaType::QByteArray:
{
const QByteArray bytes = qvar.toByteArray();
- const uint count = bytes.count();
+ const uint count = static_cast<uint>(bytes.size());
SAFEARRAY *array = SafeArrayCreateVector(VT_UI1, 0, count);
if (count) {
const char *data = bytes.constData();
@@ -589,9 +546,9 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
break;
#ifdef QAX_SERVER
- case QVariant::Rect:
- case QVariant::Size:
- case QVariant::Point:
+ case QMetaType::QRect:
+ case QMetaType::QSize:
+ case QMetaType::QPoint:
{
typedef HRESULT(WINAPI* PGetRecordInfoFromTypeInfo)(ITypeInfo *, IRecordInfo **);
static PGetRecordInfoFromTypeInfo pGetRecordInfoFromTypeInfo = 0;
@@ -606,9 +563,10 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
ITypeInfo *typeInfo = 0;
IRecordInfo *recordInfo = 0;
- CLSID clsid = qvar.type() == QVariant::Rect ? CLSID_QRect
- :qvar.type() == QVariant::Size ? CLSID_QSize
- :CLSID_QPoint;
+ const int vType = qvar.metaType().id();
+ CLSID clsid = vType == QMetaType::QRect
+ ? CLSID_QRect
+ : vType == QMetaType::QSize ? CLSID_QSize : CLSID_QPoint;
qAxTypeLibrary->GetTypeInfoOfGuid(clsid, &typeInfo);
if (!typeInfo)
break;
@@ -618,20 +576,20 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
break;
void *record = 0;
- switch (qvar.type()) {
- case QVariant::Rect:
+ switch (qvar.metaType().id()) {
+ case QMetaType::QRect:
{
QRect qrect(qvar.toRect());
recordInfo->RecordCreateCopy(&qrect, &record);
}
break;
- case QVariant::Size:
+ case QMetaType::QSize:
{
QSize qsize(qvar.toSize());
recordInfo->RecordCreateCopy(&qsize, &record);
}
break;
- case QVariant::Point:
+ case QMetaType::QPoint:
{
QPoint qpoint(qvar.toPoint());
recordInfo->RecordCreateCopy(&qpoint, &record);
@@ -653,8 +611,22 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
break;
#endif // QAX_SERVER
- case QVariant::UserType:
- {
+
+ case QMetaType::UnknownType: // default-parameters not set
+ if (out && arg.vt == (VT_ERROR|VT_BYREF)) {
+ *arg.plVal = DISP_E_PARAMNOTFOUND;
+ } else {
+ arg.vt = VT_ERROR;
+ arg.lVal = DISP_E_PARAMNOTFOUND;
+ if (out) {
+ arg.plVal = new long(arg.lVal);
+ arg.vt |= VT_BYREF;
+ }
+ }
+ break;
+
+ default:
+ if (qvar.metaType().id() >= QMetaType::User) {
QByteArray subType = qvar.typeName();
#ifdef QAX_SERVER
if (subType.endsWith('*'))
@@ -704,7 +676,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
qAxFactory()->createObjectWrapper(static_cast<QObject*>(user), &arg.pdispVal);
}
#else
- } else if (QMetaType::type(subType)) {
+ } else if (QMetaType::fromName(subType).id() != QMetaType::UnknownType) {
if (out) {
qWarning().noquote() << msgOutParameterNotSupported("subtype");
arg.vt = VT_EMPTY;
@@ -719,33 +691,42 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
} else {
return false;
}
+ } else { // >= User
+ return false;
}
break;
- case QVariant::Invalid: // default-parameters not set
- if (out && arg.vt == (VT_ERROR|VT_BYREF)) {
- *arg.plVal = DISP_E_PARAMNOTFOUND;
- } else {
- arg.vt = VT_ERROR;
- arg.lVal = DISP_E_PARAMNOTFOUND;
- if (out) {
- arg.plVal = new long(arg.lVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- default:
- return false;
}
Q_ASSERT(!out || (arg.vt & VT_BYREF));
return true;
}
+#ifdef QAX_SERVER
+static QVariant axServer(IUnknown *unknown, const QByteArray &typeName)
+{
+ IAxServerBase *iface = nullptr;
+ if (unknown && typeName != "IDispatch*" && typeName != "IUnknown*")
+ unknown->QueryInterface(IID_IAxServerBase, reinterpret_cast<void**>(&iface));
+ if (iface == nullptr)
+ return {};
+
+ auto *qObj = iface->qObject();
+ iface->Release();
+ QByteArray pointerType = qObj ? QByteArray(qObj->metaObject()->className()) + '*' : typeName;
+ QMetaType pointerMetaType = QMetaType::fromName(pointerType);
+ if (pointerMetaType.id() == QMetaType::UnknownType)
+ pointerMetaType = QMetaType(qRegisterMetaType<QObject *>(pointerType));
+ return QVariant(pointerMetaType, &qObj);
+}
+#endif // QAX_SERVER
+
#undef QVARIANT_TO_VARIANT_POD
/*
- Returns \a arg as a QVariant of type \a type.
+ Returns \a arg as a QVariant of type \a typeName or \a type.
+
+ NOTE: If a \a typeName is specified, value type is assumed. to
+ get/create a pointer type, provide the type id in the \a type argument.
Used by
@@ -762,8 +743,16 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
- QAxBase::dynamicCall(return value)
- IPropertyBag::Write (QtPropertyBag)
*/
-QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type)
+QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, int type)
{
+ int nameTypeId = QMetaType::UnknownType;
+ if (type == QMetaType::UnknownType && !typeName.isEmpty()) {
+ auto name = typeName.endsWith('*')
+ ? QByteArrayView{typeName.constData(), typeName.size() - 1}
+ : QByteArrayView{typeName};
+ nameTypeId = QMetaType::fromName(name).id();
+ }
+
QVariant var;
switch(arg.vt) {
case VT_BSTR:
@@ -781,38 +770,38 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
case VT_I1:
var = arg.cVal;
if (typeName == "char")
- type = QVariant::Int;
+ type = QMetaType::Int;
break;
case VT_I1|VT_BYREF:
var = *arg.pcVal;
if (typeName == "char")
- type = QVariant::Int;
+ type = QMetaType::Int;
break;
case VT_I2:
var = arg.iVal;
if (typeName == "short")
- type = QVariant::Int;
+ type = QMetaType::Int;
break;
case VT_I2|VT_BYREF:
var = *arg.piVal;
if (typeName == "short")
- type = QVariant::Int;
+ type = QMetaType::Int;
break;
case VT_I4:
- if (type == QVariant::Color || (!type && typeName == "QColor"))
+ if (type == QMetaType::QColor || nameTypeId == QMetaType::QColor)
var = QVariant::fromValue(OLEColorToQColor(arg.lVal));
#ifndef QT_NO_CURSOR
- else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*")))
+ else if (type == QMetaType::QCursor || nameTypeId == QMetaType::QCursor)
var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(arg.lVal)));
#endif
else
var = (int)arg.lVal;
break;
case VT_I4|VT_BYREF:
- if (type == QVariant::Color || (!type && typeName == "QColor"))
+ if (type == QMetaType::QColor || nameTypeId == QMetaType::QColor)
var = QVariant::fromValue(OLEColorToQColor((int)*arg.plVal));
#ifndef QT_NO_CURSOR
- else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*")))
+ else if (type == QMetaType::QCursor || nameTypeId == QMetaType::QCursor)
var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(*arg.plVal)));
#endif
else
@@ -837,20 +826,20 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
var = *arg.puiVal;
break;
case VT_UI4:
- if (type == QVariant::Color || (!type && typeName == "QColor"))
+ if (type == QMetaType::QColor || nameTypeId == QMetaType::QColor)
var = QVariant::fromValue(OLEColorToQColor(arg.ulVal));
#ifndef QT_NO_CURSOR
- else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*")))
+ else if (type == QMetaType::QCursor || nameTypeId == QMetaType::QCursor)
var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(arg.ulVal)));
#endif
else
var = (int)arg.ulVal;
break;
case VT_UI4|VT_BYREF:
- if (type == QVariant::Color || (!type && typeName == "QColor"))
+ if (type == QMetaType::QColor || nameTypeId == QMetaType::QColor)
var = QVariant::fromValue(OLEColorToQColor((uint)*arg.pulVal));
#ifndef QT_NO_CURSOR
- else if (type == QVariant::Cursor || (!type && (typeName == "QCursor" || typeName == "QCursor*")))
+ else if (type == QMetaType::QCursor || nameTypeId == QMetaType::QCursor)
var = QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(*arg.pulVal)));
#endif
else
@@ -894,18 +883,18 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
break;
case VT_DATE:
var = DATEToQDateTime(arg.date);
- if (type == QVariant::Date || (!type && (typeName == "QDate" || typeName == "QDate*"))) {
- var.convert(QVariant::Date);
- } else if (type == QVariant::Time || (!type && (typeName == "QTime" || typeName == "QTime*"))) {
- var.convert(QVariant::Time);
+ if (type == QMetaType::QDate || nameTypeId == QMetaType::QDate) {
+ var.convert(QMetaType(QMetaType::QDate));
+ } else if (type == QMetaType::QTime || nameTypeId == QMetaType::QTime) {
+ var.convert(QMetaType(QMetaType::QTime));
}
break;
case VT_DATE|VT_BYREF:
var = DATEToQDateTime(*arg.pdate);
- if (type == QVariant::Date || (!type && (typeName == "QDate" || typeName == "QDate*"))) {
- var.convert(QVariant::Date);
- } else if (type == QVariant::Time || (!type && (typeName == "QTime" || typeName == "QTime*"))) {
- var.convert(QVariant::Time);
+ if (type == QMetaType::QDate || nameTypeId == QMetaType::QDate) {
+ var.convert(QMetaType(QMetaType::QDate));
+ } else if (type == QMetaType::QTime || nameTypeId == QMetaType::QTime) {
+ var.convert(QMetaType(QMetaType::QTime));
}
break;
case VT_VARIANT:
@@ -923,7 +912,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
disp = *arg.ppdispVal;
else
disp = arg.pdispVal;
- if (type == QVariant::Font || (!type && (typeName == "QFont" || typeName == "QFont*"))) {
+ if (type == QMetaType::QFont || nameTypeId == QMetaType::QFont) {
IFont *ifont = nullptr;
if (disp)
disp->QueryInterface(IID_IFont, reinterpret_cast<void**>(&ifont));
@@ -933,7 +922,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
} else {
var = QVariant::fromValue(QFont());
}
- } else if (type == QVariant::Pixmap || (!type && (typeName == "QPixmap" || typeName == "QPixmap*"))) {
+ } else if (type == QMetaType::QPixmap || nameTypeId == QMetaType::QPixmap) {
IPicture *ipic = nullptr;
if (disp)
disp->QueryInterface(IID_IPicture, reinterpret_cast<void**>(&ipic));
@@ -945,40 +934,55 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
}
} else {
#ifdef QAX_SERVER
- IAxServerBase *iface = 0;
- if (disp && typeName != "IDispatch*")
- disp->QueryInterface(IID_IAxServerBase, reinterpret_cast<void**>(&iface));
- if (iface) {
- QObject *qObj = iface->qObject();
- iface->Release();
- QByteArray pointerType = qObj ? QByteArray(qObj->metaObject()->className()) + '*' : typeName;
- int pointerTypeId = QMetaType::type(pointerType);
- if (!pointerTypeId)
- pointerTypeId = qRegisterMetaType<QObject *>(pointerType);
- var = QVariant(pointerTypeId, &qObj);
+ if (auto axs = axServer(disp, typeName); axs.isValid()) {
+ var = axs;
} else
#endif
{
if (!typeName.isEmpty()) {
if (arg.vt & VT_BYREF) {
- var = QVariant(qRegisterMetaType<IDispatch**>("IDispatch**"), &arg.ppdispVal);
+ // When the dispinterface is a return value, just assign it to a QVariant
+ static const int dispatchId = qRegisterMetaType<IDispatch**>("IDispatch**");
+ var = QVariant(QMetaType(dispatchId), &arg.ppdispVal);
} else {
#ifndef QAX_SERVER
if (typeName == "QVariant") {
+ // If a QVariant is requested, wrap the dispinterface in a QAxObject
QAxObject *object = new QAxObject(disp);
var = QVariant::fromValue<QAxObject*>(object);
- } else if (typeName != "IDispatch*" && QMetaType::type(typeName)) {
- QByteArray typeNameStr = QByteArray(typeName);
+ } else if (typeName != "IDispatch*" && QMetaType::fromName(typeName).id() != QMetaType::UnknownType) {
+ // Conversion from IDispatch* to a wrapper type is requested. Here, the requested
+ // wrapper type is constructed around the dispinterface, and then returned as
+ // a QVariant containing a pointer to the wrapper type.
+
+ // Calculate the value type from a potential pointer type
+ QByteArray valueTypeStr = QByteArray(typeName);
int pIndex = typeName.lastIndexOf('*');
if (pIndex != -1)
- typeNameStr = typeName.left(pIndex);
- int metaType = QMetaType::type(typeNameStr);
- Q_ASSERT(metaType != 0);
- auto object = static_cast<QAxObject*>(qax_createObjectWrapper(metaType, disp));
- var = QVariant(QMetaType::type(typeName), &object);
- } else
+ valueTypeStr = typeName.left(pIndex);
+
+ const QMetaType metaValueType = QMetaType::fromName(valueTypeStr);
+ Q_ASSERT(metaValueType.id() != QMetaType::UnknownType);
+
+ auto object = static_cast<QAxObject*>(qax_createObjectWrapper(metaValueType.id(), disp));
+
+ // Return object as the original type
+ const QMetaType returnType = QMetaType::fromName(typeName);
+ Q_ASSERT(metaValueType.id() != QMetaType::UnknownType);
+
+ var = QVariant(returnType, &object);
+
+ // The result must be a pointer to an instance derived from QObject
+ Q_ASSERT((var.metaType().flags() & QMetaType::PointerToQObject) != 0);
+ } else {
+#endif
+ // An IDispatch pointer is requested, no conversion required, just return as QVariant
+ // containing the pointer.
+ static const int dispatchId = qRegisterMetaType<IDispatch*>(typeName.constData());
+ var = QVariant(QMetaType(dispatchId), &disp);
+#ifndef QAX_SERVER
+ }
#endif
- var = QVariant(qRegisterMetaType<IDispatch*>(typeName), &disp);
}
}
}
@@ -994,6 +998,10 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
else
unkn = arg.punkVal;
var.setValue(unkn);
+#ifdef QAX_SERVER
+ if (auto axs = axServer(unkn, typeName); axs.isValid())
+ var = axs;
+#endif
}
break;
case VT_ARRAY|VT_VARIANT:
@@ -1219,22 +1227,23 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
break;
}
- QVariant::Type proptype = (QVariant::Type)type;
- if (proptype == QVariant::Invalid && !typeName.isEmpty()) {
- if (typeName != "QVariant")
- proptype = QVariant::nameToType(typeName);
- }
- if (proptype != QVariant::Type(QMetaType::QVariant) && proptype != QVariant::LastType && proptype != QVariant::Invalid && var.type() != proptype) {
- if (var.canConvert(proptype)) {
+ const int proptype = type != QMetaType::UnknownType || typeName.isEmpty() || typeName == "QVariant"
+ ? type : nameTypeId;
+
+ if (proptype != QMetaType::QVariant && proptype != QMetaType::UnknownType
+ && var.metaType().id() != proptype) {
+ QMetaType propertyMetaType(proptype);
+ if (var.canConvert(propertyMetaType)) {
QVariant oldvar = var;
- if (oldvar.convert(proptype))
+ if (oldvar.convert(propertyMetaType))
var = oldvar;
- } else if (proptype == QVariant::StringList && var.type() == QVariant::List) {
+ } else if (proptype == QMetaType::QStringList
+ && var.metaType().id() == QMetaType::QVariantList) {
bool allStrings = true;
QStringList strings;
const QVariantList list(var.toList());
for (const QVariant &variant : list) {
- if (variant.canConvert(QVariant::String))
+ if (variant.canConvert<QString>())
strings << variant.toString();
else
allStrings = false;
diff --git a/src/activeqt/shared/qaxtypes_p.h b/src/activeqt/shared/qaxtypes_p.h
index 2ce8a3f..13c3728 100644
--- a/src/activeqt/shared/qaxtypes_p.h
+++ b/src/activeqt/shared/qaxtypes_p.h
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the ActiveQt framework of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef QAXTYPES_H
#define QAXTYPES_H
@@ -78,14 +31,16 @@ QT_BEGIN_NAMESPACE
#endif
extern bool QVariantToVARIANTFunc(const QVariant &var, VARIANT &arg, const QByteArray &typeName = QByteArray(), bool out = false);
-extern QVariant VARIANTToQVariantFunc(const VARIANT &arg, const QByteArray &typeName, uint type = 0);
+extern QVariant VARIANTToQVariantFunc(const VARIANT &arg, const QByteArray &typeName,
+ int type = 0);
inline bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName = QByteArray(), bool out = false)
{
return QVariantToVARIANTFunc(var, arg, typeName, out);
}
-inline QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type = 0)
+inline QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName,
+ int type = 0)
{
return VARIANTToQVariantFunc(arg, typeName, type);
}
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644
index f8c9d2c..0000000
--- a/src/src.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = activeqt
-win32: SUBDIRS += tools
-CONFIG += ordered
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 28a5f42..2f6644c 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,3 +1,4 @@
-# Generated from tools.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(idc)
diff --git a/src/tools/idc/CMakeLists.txt b/src/tools/idc/CMakeLists.txt
index 607404f..f1d784e 100644
--- a/src/tools/idc/CMakeLists.txt
+++ b/src/tools/idc/CMakeLists.txt
@@ -1,16 +1,15 @@
-# Generated from idc.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## idc Tool:
#####################################################################
-qt_add_tool(idc
-# BOOTSTRAP # special case
- TOOLS_TARGET AxContainer # special case
+qt_get_tool_target_name(target_name idc)
+qt_internal_add_tool(${target_name}
+ TARGET_DESCRIPTION "Active Qt Interface Description Compiler"
+ TOOLS_TARGET AxServer
SOURCES
main.cpp
)
-
-#### Keys ignored in scope 1:.:.:idc.pro:<TRUE>:
-# QMAKE_TARGET_DESCRIPTION = "Active Qt Interface Description Compiler"
-# _OPTION = "host_build"
+qt_internal_return_unless_building_tools()
diff --git a/src/tools/idc/idc.pro b/src/tools/idc/idc.pro
deleted file mode 100644
index 7f9a8d4..0000000
--- a/src/tools/idc/idc.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-option(host_build)
-CONFIG += force_bootstrap
-SOURCES = main.cpp
-
-QMAKE_TARGET_DESCRIPTION = "Active Qt Interface Description Compiler"
-load(qt_tool)
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp
index 2a50e31..2cf3bd3 100644
--- a/src/tools/idc/main.cpp
+++ b/src/tools/idc/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QDir>
#include <QFile>
@@ -145,7 +120,7 @@ static bool attachTypeLibrary(const QString &applicationName, int resource, cons
return false;
}
if (!UpdateResource(hExe, L"TYPELIB", MAKEINTRESOURCE(resource), 0,
- const_cast<char *>(data.data()), DWORD(data.count()))) {
+ const_cast<char *>(data.data()), DWORD(data.size()))) {
EndUpdateResource(hExe, true);
if (errorMessage)
*errorMessage = QString::fromLatin1("Failed to attach type library to binary %1 - could not update file.").arg(applicationName);
@@ -194,7 +169,8 @@ static bool dllInstall(const QString &input, bool doRegister)
}
typedef HRESULT(__stdcall* DllInstallProc)(BOOL bInstall, PCWSTR pszCmdLine);
- DllInstallProc DllInstall = reinterpret_cast<DllInstallProc>(GetProcAddress(hdll, "DllInstall"));
+ DllInstallProc DllInstall = reinterpret_cast<DllInstallProc>
+ (reinterpret_cast<void *>(GetProcAddress(hdll, "DllInstall")));
if (!DllInstall) {
fprintf(stderr, "Library file %s doesn't appear to be a COM library supporting DllInstall\n", qPrintable(input));
return false;
@@ -219,7 +195,8 @@ static bool registerServer(const QString &input, bool perUser)
}
typedef HRESULT(__stdcall* RegServerProc)();
- RegServerProc DllRegisterServer = reinterpret_cast<RegServerProc>(GetProcAddress(hdll, "DllRegisterServer"));
+ RegServerProc DllRegisterServer = reinterpret_cast<RegServerProc>
+ (reinterpret_cast<void *>(GetProcAddress(hdll, "DllRegisterServer")));
if (!DllRegisterServer) {
fprintf(stderr, "Library file %s doesn't appear to be a COM library\n", qPrintable(input));
return false;
@@ -246,7 +223,8 @@ static bool unregisterServer(const QString &input, bool perUser)
}
typedef HRESULT(__stdcall* RegServerProc)();
- RegServerProc DllUnregisterServer = reinterpret_cast<RegServerProc>(GetProcAddress(hdll, "DllUnregisterServer"));
+ RegServerProc DllUnregisterServer = reinterpret_cast<RegServerProc>
+ (reinterpret_cast<void *>(GetProcAddress(hdll, "DllUnregisterServer")));
if (!DllUnregisterServer) {
fprintf(stderr, "Library file %s doesn't appear to be a COM library\n", qPrintable(input));
return false;
@@ -273,7 +251,8 @@ static HRESULT dumpIdl(const QString &input, const QString &idlfile, const QStri
return 3;
}
typedef HRESULT(__stdcall* DumpIDLProc)(const QString&, const QString&);
- DumpIDLProc DumpIDL = reinterpret_cast<DumpIDLProc>(GetProcAddress(hdll, "DumpIDL"));
+ DumpIDLProc DumpIDL = reinterpret_cast<DumpIDLProc>
+ (reinterpret_cast<void *>(GetProcAddress(hdll, "DumpIDL")));
if (!DumpIDL) {
fprintf(stderr, "Couldn't resolve 'DumpIDL' symbol in %s\n", qPrintable(input));
return 3;
@@ -289,7 +268,7 @@ const char usage[] =
"Usage: idc [options] [input_file]\n"
"Interface Description Compiler " QT_VERSION_STR "\n\n"
"Options:\n"
-" -?, /h, -h, -help Displays this help.\n"
+" /?, -?, /h, -h, /help, -help Displays this help.\n"
" /v, -v Displays version information.\n"
" /version, -version <version> Specify the interface version.\n"
" /idl, -idl <file> Specify the interface definition file.\n"
@@ -343,7 +322,9 @@ int runIdc(int argc, char **argv)
} else if (p == QLatin1String("/v") || p == QLatin1String("-v")) {
fprintf(stdout, "Qt Interface Definition Compiler version 1.0 using Qt %s\n", QT_VERSION_STR);
return 0;
- } else if (p == QLatin1String("/h") || p == QLatin1String("-h") || p == QLatin1String("-?") || p == QLatin1String("/?")) {
+ } else if (p == QLatin1String("/h") || p == QLatin1String("-h")
+ || p == QLatin1String("/?") || p == QLatin1String("-?")
+ || p == QLatin1String("/help") || p == QLatin1String("-help")) {
fprintf(stdout, "%s\n", usage);
return 0;
} else if (p == QLatin1String("/regserver") || p == QLatin1String("-regserver")) {
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
deleted file mode 100644
index 5824cfa..0000000
--- a/src/tools/tools.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += idc
diff --git a/sync.profile b/sync.profile
deleted file mode 100644
index 190bea0..0000000
--- a/sync.profile
+++ /dev/null
@@ -1,10 +0,0 @@
-%modules = ( # path to module name map
- "QtAxBase" => "$basedir/src/activeqt/axbase",
- "QtAxContainer" => "$basedir/src/activeqt/container",
- "QtAxServer" => "$basedir/src/activeqt/control",
- "ActiveQt" => "$basedir/src/activeqt"
-);
-%moduleheaders = ( # restrict the module headers to those found in relative path
-);
-%classnames = (
-);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2214137..05cc44c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from tests.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
if(QT_BUILD_STANDALONE_TESTS)
# Add qt_find_package calls for extra dependencies that need to be found when building
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index 8537f4f..4cba078 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -1,9 +1,11 @@
-# Generated from auto.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(conversion)
add_subdirectory(qaxobject)
-# add_subdirectory(dumpcpp) (needs typelib target) # special case
-#add_subdirectory(cmake) # special case
+add_subdirectory(dumpcpp)
+add_subdirectory(cmake)
if(NOT GCC)
add_subdirectory(qaxscript)
+ add_subdirectory(qaxscriptmanager)
endif()
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
deleted file mode 100644
index 0b43b0d..0000000
--- a/tests/auto/auto.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- conversion \
- qaxobject \
- qaxscript \
- dumpcpp \
- cmake
-
-*g++*: SUBDIRS -= \
- qaxscript \
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 4f15a69..3611659 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -1,12 +1,46 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 2.8)
-project(qmake_cmake_files)
+cmake_minimum_required(VERSION 3.16)
+
+project(qtactivetqt_cmake_tests)
enable_testing()
-find_package(Qt5Core REQUIRED)
+set(required_packages Core)
+set(optional_packages Widgets Gui)
+
+# Setup the test when called as a completely standalone project.
+if(TARGET Qt6::Core)
+ # Tests are built as part of the qtactiveqt build tree.
+ # Setup paths so that the Qt packages are found.
+ qt_internal_set_up_build_dir_package_paths()
+endif()
+
+find_package(Qt6 REQUIRED COMPONENTS ${required_packages})
+find_package(Qt6 OPTIONAL_COMPONENTS ${optional_packages})
+
+# Setup common test variables which were previously set by ctest_testcase_common.prf.
+set(CMAKE_MODULES_UNDER_TEST "${required_packages}" "${optional_packages}")
+
+foreach(qt_package ${CMAKE_MODULES_UNDER_TEST})
+ set(package_name "${QT_CMAKE_EXPORT_NAMESPACE}${qt_package}")
+ if(${package_name}_FOUND)
+ set(CMAKE_${qt_package}_MODULE_MAJOR_VERSION "${${package_name}_VERSION_MAJOR}")
+ set(CMAKE_${qt_package}_MODULE_MINOR_VERSION "${${package_name}_VERSION_MINOR}")
+ set(CMAKE_${qt_package}_MODULE_PATCH_VERSION "${${package_name}_VERSION_PATCH}")
+ endif()
+endforeach()
-include("${_Qt5CTestMacros}")
+include("${_Qt6CTestMacros}")
-expect_pass(test_modules)
+if(TARGET Qt6::Widgets AND TARGET Qt6::Gui)
+ _qt_internal_test_expect_pass(test_target_typelibs)
+ _qt_internal_test_expect_pass(test_target_typelibs_absolute)
+ _qt_internal_test_expect_fail(test_target_typelibs_empty_libs)
+ _qt_internal_test_expect_fail(test_target_typelibs_non_existing_libs)
+ _qt_internal_test_expect_pass(test_target_typelibs_out_dir)
+ _qt_internal_test_expect_pass(test_modules/container)
+ _qt_internal_test_expect_pass(test_modules/server)
+endif()
diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro
deleted file mode 100644
index bf2dbcb..0000000
--- a/tests/auto/cmake/cmake.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-
-# Cause make to do nothing.
-TEMPLATE = subdirs
-
-CONFIG += ctest_testcase
diff --git a/tests/auto/cmake/test_modules/CMakeLists.txt b/tests/auto/cmake/test_modules/CMakeLists.txt
deleted file mode 100644
index 4336ad4..0000000
--- a/tests/auto/cmake/test_modules/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-cmake_minimum_required(VERSION 2.8)
-
-project(test_modules)
-
-add_subdirectory(server)
-add_subdirectory(container)
diff --git a/tests/auto/cmake/test_modules/container/CMakeLists.txt b/tests/auto/cmake/test_modules/container/CMakeLists.txt
index 6d04576..999e241 100644
--- a/tests/auto/cmake/test_modules/container/CMakeLists.txt
+++ b/tests/auto/cmake/test_modules/container/CMakeLists.txt
@@ -1,24 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.16)
project(cmake_axcontainer)
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Gui REQUIRED)
-find_package(Qt5Widgets REQUIRED)
-
-find_package(Qt5AxContainer REQUIRED)
-
-include_directories(
- ${Qt5AxContainer_INCLUDE_DIRS}
-)
-
-add_definitions(${Qt5AxContainer_DEFINITIONS})
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-
+find_package(Qt6 COMPONENTS Core Gui Widgets AxContainer CONFIG REQUIRED)
add_executable(axcontainerapp axcontainer.cpp)
-
-target_link_libraries(axcontainerapp
- ${Qt5AxContainer_LIBRARIES}
-)
+target_link_libraries(axcontainerapp Qt6::Core Qt6::Gui Qt6::Widgets Qt6::AxContainer)
diff --git a/tests/auto/cmake/test_modules/container/axcontainer.cpp b/tests/auto/cmake/test_modules/container/axcontainer.cpp
index e16bddb..c81f881 100644
--- a/tests/auto/cmake/test_modules/container/axcontainer.cpp
+++ b/tests/auto/cmake/test_modules/container/axcontainer.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <qt_windows.h>
#include <QtAxContainer/QAxWidget>
diff --git a/tests/auto/cmake/test_modules/server/CMakeLists.txt b/tests/auto/cmake/test_modules/server/CMakeLists.txt
index f553990..0a8d420 100644
--- a/tests/auto/cmake/test_modules/server/CMakeLists.txt
+++ b/tests/auto/cmake/test_modules/server/CMakeLists.txt
@@ -1,24 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.16)
project(cmake_axserver)
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Gui REQUIRED)
-find_package(Qt5Widgets REQUIRED)
-
-find_package(Qt5AxServer REQUIRED)
-
-include_directories(
- ${Qt5AxServer_INCLUDE_DIRS}
-)
-
-add_definitions(${Qt5AxServer_DEFINITIONS})
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-
+find_package(Qt6 COMPONENTS Core Gui Widgets AxServer CONFIG REQUIRED)
add_executable(axserverapp WIN32 axserver.cpp)
-
-target_link_libraries(axserverapp
- ${Qt5AxServer_LIBRARIES}
-)
+target_link_libraries(axserverapp Qt6::Core Qt6::Gui Qt6::Widgets Qt6::AxServer)
diff --git a/tests/auto/cmake/test_modules/server/axserver.cpp b/tests/auto/cmake/test_modules/server/axserver.cpp
index b31014c..f03ed21 100644
--- a/tests/auto/cmake/test_modules/server/axserver.cpp
+++ b/tests/auto/cmake/test_modules/server/axserver.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <qt_windows.h>
#include <QAxFactory>
diff --git a/tests/auto/cmake/test_target_typelibs/CMakeLists.txt b/tests/auto/cmake/test_target_typelibs/CMakeLists.txt
new file mode 100644
index 0000000..528aa08
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tst_typelibs)
+
+find_package(Qt6 COMPONENTS AxContainer Gui Widgets CONFIG REQUIRED)
+
+add_executable(tst_typelibs main.cpp)
+target_link_libraries(tst_typelibs PRIVATE Qt6::AxContainer Qt6::Gui Qt6::Widgets)
+
+qt6_target_typelibs(tst_typelibs LIBRARIES "ieframe.dll")
diff --git a/tests/auto/cmake/test_target_typelibs/main.cpp b/tests/auto/cmake/test_target_typelibs/main.cpp
new file mode 100644
index 0000000..f8fbf00
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs/main.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "ieframe.h"
+
+int main(int argc, char *argv[])
+{
+ SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ delete webBrowser;
+ return 0;
+}
diff --git a/tests/auto/cmake/test_target_typelibs_absolute/CMakeLists.txt b/tests/auto/cmake/test_target_typelibs_absolute/CMakeLists.txt
new file mode 100644
index 0000000..942fa54
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_absolute/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tst_typelibs)
+
+find_package(Qt6 COMPONENTS AxContainer Gui Widgets CONFIG REQUIRED)
+
+add_executable(tst_typelibs main.cpp)
+target_link_libraries(tst_typelibs PRIVATE Qt6::AxContainer Qt6::Gui Qt6::Widgets)
+
+qt6_target_typelibs(tst_typelibs LIBRARIES "$ENV{SystemRoot}/System32/ieframe.dll")
diff --git a/tests/auto/cmake/test_target_typelibs_absolute/main.cpp b/tests/auto/cmake/test_target_typelibs_absolute/main.cpp
new file mode 100644
index 0000000..f8fbf00
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_absolute/main.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "ieframe.h"
+
+int main(int argc, char *argv[])
+{
+ SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ delete webBrowser;
+ return 0;
+}
diff --git a/tests/auto/cmake/test_target_typelibs_empty_libs/CMakeLists.txt b/tests/auto/cmake/test_target_typelibs_empty_libs/CMakeLists.txt
new file mode 100644
index 0000000..2971c1b
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_empty_libs/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tst_typelibs)
+
+find_package(Qt6 COMPONENTS AxContainer Gui Widgets CONFIG REQUIRED)
+
+add_executable(tst_typelibs main.cpp)
+target_link_libraries(tst_typelibs PRIVATE Qt6::AxContainer Qt6::Gui Qt6::Widgets)
+
+qt6_target_typelibs(tst_typelibs)
diff --git a/tests/auto/cmake/test_target_typelibs_empty_libs/main.cpp b/tests/auto/cmake/test_target_typelibs_empty_libs/main.cpp
new file mode 100644
index 0000000..f8fbf00
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_empty_libs/main.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "ieframe.h"
+
+int main(int argc, char *argv[])
+{
+ SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ delete webBrowser;
+ return 0;
+}
diff --git a/tests/auto/cmake/test_target_typelibs_non_existing_libs/CMakeLists.txt b/tests/auto/cmake/test_target_typelibs_non_existing_libs/CMakeLists.txt
new file mode 100644
index 0000000..aaca1c9
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_non_existing_libs/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tst_typelibs)
+
+find_package(Qt6 COMPONENTS AxContainer Gui Widgets CONFIG REQUIRED)
+
+add_executable(tst_typelibs main.cpp)
+target_link_libraries(tst_typelibs PRIVATE Qt6::AxContainer Qt6::Gui Qt6::Widgets)
+
+qt6_target_typelibs(tst_typelibs LIBRARIES "ieframe.dll" "qt100notexistinglib.dll")
diff --git a/tests/auto/cmake/test_target_typelibs_non_existing_libs/main.cpp b/tests/auto/cmake/test_target_typelibs_non_existing_libs/main.cpp
new file mode 100644
index 0000000..f8fbf00
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_non_existing_libs/main.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "ieframe.h"
+
+int main(int argc, char *argv[])
+{
+ SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ delete webBrowser;
+ return 0;
+}
diff --git a/tests/auto/cmake/test_target_typelibs_out_dir/CMakeLists.txt b/tests/auto/cmake/test_target_typelibs_out_dir/CMakeLists.txt
new file mode 100644
index 0000000..d1c38ae
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_out_dir/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tst_typelibs)
+
+find_package(Qt6 COMPONENTS AxContainer Gui Widgets CONFIG REQUIRED)
+
+add_executable(tst_typelibs main.cpp)
+target_link_libraries(tst_typelibs PRIVATE Qt6::AxContainer Qt6::Gui Qt6::Widgets)
+target_include_directories(tst_typelibs PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
+
+qt6_target_typelibs(tst_typelibs LIBRARIES "ieframe.dll"
+ OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/typelibs"
+)
diff --git a/tests/auto/cmake/test_target_typelibs_out_dir/main.cpp b/tests/auto/cmake/test_target_typelibs_out_dir/main.cpp
new file mode 100644
index 0000000..202b450
--- /dev/null
+++ b/tests/auto/cmake/test_target_typelibs_out_dir/main.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "typelibs/ieframe.h"
+
+int main(int argc, char *argv[])
+{
+ SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ delete webBrowser;
+ return 0;
+}
diff --git a/tests/auto/conversion/CMakeLists.txt b/tests/auto/conversion/CMakeLists.txt
index 4aab821..97e6c7f 100644
--- a/tests/auto/conversion/CMakeLists.txt
+++ b/tests/auto/conversion/CMakeLists.txt
@@ -1,13 +1,23 @@
-# Generated from conversion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## conversion Test:
#####################################################################
-qt_add_test(conversion
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(conversion LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(conversion
SOURCES
tst_conversion.cpp
- PUBLIC_LIBRARIES
+ INCLUDE_DIRECTORIES
+ ../../../src/activeqt/shared/
+ LIBRARIES
Qt::AxContainer
Qt::Gui
+ Qt::AxBasePrivate
)
diff --git a/tests/auto/conversion/comutil_p.h b/tests/auto/conversion/comutil_p.h
new file mode 100644
index 0000000..ac39c91
--- /dev/null
+++ b/tests/auto/conversion/comutil_p.h
@@ -0,0 +1,304 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef COMUTIL_P_H
+#define COMUTIL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QtGlobal>
+#include <comdef.h>
+#include <type_traits>
+#include <oleauto.h>
+#include <wrl/client.h>
+
+using Microsoft::WRL::ComPtr;
+
+template<typename T>
+ComPtr<T> makeComObject()
+{
+ ComPtr<T> ptr;
+ *ptr.GetAddressOf() = new T;
+ return ptr;
+}
+
+class ComBstr
+{
+public:
+ ComBstr() = default;
+
+ ComBstr(decltype(nullptr)) { }
+
+ ~ComBstr() { ::SysFreeString(m_str); }
+
+ explicit ComBstr(const wchar_t *str) noexcept
+ {
+ if (!str)
+ return;
+
+ m_str = ::SysAllocString(str);
+ Q_ASSERT(m_str);
+ }
+
+ ComBstr(const ComBstr &src) noexcept
+ {
+ if (!src.m_str)
+ return;
+
+ m_str = ::SysAllocStringByteLen(reinterpret_cast<char *>(src.m_str),
+ ::SysStringByteLen(m_str));
+ Q_ASSERT(m_str);
+ }
+
+ ComBstr(ComBstr &&src) noexcept : m_str{ src.m_str } { src.m_str = nullptr; }
+
+ ComBstr &operator=(const ComBstr &rhs) noexcept
+ {
+ if (&rhs == this)
+ return *this;
+
+ clear();
+
+ m_str = rhs.copy();
+
+ return *this;
+ }
+
+ ComBstr &operator=(ComBstr &&rhs) noexcept
+ {
+ if (&rhs == this)
+ return *this;
+
+ clear();
+
+ m_str = rhs.m_str;
+ rhs.m_str = nullptr;
+
+ return *this;
+ }
+
+ [[nodiscard]] BSTR copy() const
+ {
+ if (!m_str)
+ return nullptr;
+
+ return ::SysAllocStringByteLen(reinterpret_cast<char *>(m_str), ::SysStringByteLen(m_str));
+ }
+
+private:
+ void clear() { ::SysFreeString(m_str); }
+
+ BSTR m_str = nullptr;
+};
+
+template<typename T>
+constexpr VARTYPE ValueType()
+{
+ using ValueType = std::remove_cv_t<std::remove_pointer_t<T>>;
+
+ constexpr VARTYPE maybeByref = std::is_pointer_v<T> ? VT_BYREF : VT_EMPTY;
+ if constexpr (std::is_same_v<ValueType, bool>)
+ return VT_BOOL | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, char>)
+ return VT_I1 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, unsigned char>)
+ return VT_UI1 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, short>)
+ return VT_I2 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, unsigned short>)
+ return VT_UI2 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, int>)
+ return VT_I4 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, unsigned int>)
+ return VT_UI4 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, long long>)
+ return VT_I8 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, unsigned long long>)
+ return VT_UI8 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, float>)
+ return VT_R4 | maybeByref;
+ else if constexpr (std::is_same_v<ValueType, double>)
+ return VT_R8 | maybeByref;
+ else if constexpr (std::is_same_v<const ValueType *, const wchar_t *>)
+ return VT_BSTR;
+ else if constexpr (std::is_base_of_v<IDispatch, ValueType>)
+ return VT_DISPATCH;
+ else if constexpr (std::is_base_of_v<IUnknown, ValueType>)
+ return VT_UNKNOWN;
+ else
+ return VT_EMPTY;
+};
+
+template<typename T>
+constexpr auto ValueField()
+{
+ using Type = std::remove_const_t<T>;
+ if constexpr (std::is_same_v<Type, bool>)
+ return &VARIANT::boolVal;
+ else if constexpr (std::is_same_v<Type, bool *>)
+ return &VARIANT::pboolVal;
+ else if constexpr (std::is_same_v<Type, char>)
+ return &VARIANT::cVal;
+ else if constexpr (std::is_same_v<Type, char *>)
+ return &VARIANT::pcVal;
+ else if constexpr (std::is_same_v<Type, unsigned char>)
+ return &VARIANT::bVal;
+ else if constexpr (std::is_same_v<Type, unsigned char *>)
+ return &VARIANT::pbVal;
+ else if constexpr (std::is_same_v<Type, short>)
+ return &VARIANT::iVal;
+ else if constexpr (std::is_same_v<Type, short *>)
+ return &VARIANT::piVal;
+ else if constexpr (std::is_same_v<Type, unsigned short>)
+ return &VARIANT::uiVal;
+ else if constexpr (std::is_same_v<Type, unsigned short *>)
+ return &VARIANT::puiVal;
+ else if constexpr (std::is_same_v<Type, int>)
+ return &VARIANT::intVal;
+ else if constexpr (std::is_same_v<Type, int *>)
+ return &VARIANT::pintVal;
+ else if constexpr (std::is_same_v<Type, unsigned int>)
+ return &VARIANT::uintVal;
+ else if constexpr (std::is_same_v<Type, unsigned int *>)
+ return &VARIANT::puintVal;
+ else if constexpr (std::is_same_v<Type, long long>)
+ return &VARIANT::llVal;
+ else if constexpr (std::is_same_v<Type, long long *>)
+ return &VARIANT::pllVal;
+ else if constexpr (std::is_same_v<Type, unsigned long long>)
+ return &VARIANT::ullVal;
+ else if constexpr (std::is_same_v<Type, unsigned long long *>)
+ return &VARIANT::pullVal;
+ else if constexpr (std::is_same_v<Type, float>)
+ return &VARIANT::fltVal;
+ else if constexpr (std::is_same_v<Type, float *>)
+ return &VARIANT::pfltVal;
+ else if constexpr (std::is_same_v<Type, double>)
+ return &VARIANT::dblVal;
+ else if constexpr (std::is_same_v<Type, double *>)
+ return &VARIANT::pdblVal;
+ else if constexpr (std::is_same_v<T, const wchar_t *>)
+ return &VARIANT::bstrVal;
+ else if constexpr (std::is_base_of_v<IDispatch, std::remove_pointer_t<Type>>)
+ return &VARIANT::pdispVal;
+ else if constexpr (std::is_base_of_v<IUnknown, std::remove_pointer_t<Type>>)
+ return &VARIANT::punkVal;
+}
+
+class ComVariant : public tagVARIANT
+{
+public:
+ ComVariant() noexcept : VARIANT{} { ::VariantInit(this); }
+
+ ~ComVariant()
+ {
+ const HRESULT hr = ::VariantClear(this);
+ Q_ASSERT(hr == S_OK);
+ Q_UNUSED(hr)
+ }
+
+ ComVariant(const ComVariant &src) : ComVariant() { copy(&src); }
+ ComVariant(const VARIANT &src) noexcept : ComVariant() { copy(&src); }
+
+ template<typename T>
+ ComVariant(const T &value) : ComVariant()
+ {
+ assign(value);
+ }
+
+ ComVariant &operator=(const ComVariant &rhs) noexcept
+ {
+ if (this == &rhs)
+ return *this;
+
+ clear();
+ copy(&rhs);
+
+ return *this;
+ }
+
+ template<typename T>
+ ComVariant &operator=(const T &rhs)
+ {
+ assign(rhs);
+ return *this;
+ }
+
+ void clear()
+ {
+ const HRESULT hr = ::VariantClear(this);
+
+ Q_ASSERT(hr == S_OK);
+ Q_UNUSED(hr)
+ }
+
+ void copy(const VARIANT *src)
+ {
+ vt = VT_EMPTY;
+ const HRESULT hr = ::VariantCopy(this, const_cast<VARIANT *>(src));
+
+ Q_ASSERT(hr == S_OK);
+ Q_UNUSED(hr)
+ }
+
+ bool operator==(const ComVariant &rhs) const
+ {
+ auto *lhs = const_cast<tagVARIANT *>(static_cast<const tagVARIANT *>(this));
+ auto *other = const_cast<tagVARIANT *>(static_cast<const tagVARIANT *>(&rhs));
+ return compare(lhs, other, LOCALE_USER_DEFAULT, 0) == static_cast<HRESULT>(VARCMP_EQ);
+ }
+
+private:
+ template<typename T>
+ void assign(const T &value)
+ {
+ constexpr VARTYPE valueType = ValueType<T>();
+ static_assert(valueType != VT_EMPTY, "Invalid type for ComVariant");
+
+ vt = valueType;
+
+ constexpr auto VARIANT::*field = ValueField<T>();
+ if constexpr (valueType == VT_BSTR)
+ this->*field = ComBstr{ value }.copy();
+ else
+ this->*field = value;
+
+ if constexpr (valueType == VT_UNKNOWN || valueType == VT_DISPATCH)
+ value->AddRef();
+ }
+
+ static HRESULT compare(VARIANT *lhs, VARIANT *rhs, LCID lcid, ULONG flags)
+ {
+ // Workaround missing support for VT_I1, VT_UI2, VT_UI4 and VT_UI8 in VarCmp
+ switch (lhs->vt) {
+ case VT_I1:
+ if (lhs->cVal == rhs->cVal)
+ return VARCMP_EQ;
+ return lhs->cVal > rhs->cVal ? VARCMP_GT : VARCMP_LT;
+ case VT_UI2:
+ if (lhs->uiVal == rhs->uiVal)
+ return VARCMP_EQ;
+ return lhs->uiVal > rhs->uiVal ? VARCMP_GT : VARCMP_LT;
+ case VT_UI4:
+ if (lhs->uintVal == rhs->uintVal)
+ return VARCMP_EQ;
+ return lhs->uintVal > rhs->uintVal ? VARCMP_GT : VARCMP_LT;
+ case VT_UI8:
+ if (lhs->ullVal == rhs->ullVal)
+ return VARCMP_EQ;
+ return lhs->ullVal > rhs->ullVal ? VARCMP_GT : VARCMP_LT;
+ }
+ return ::VarCmp(lhs, rhs, lcid, flags);
+ }
+};
+
+#endif
diff --git a/tests/auto/conversion/conversion.pro b/tests/auto/conversion/conversion.pro
deleted file mode 100644
index 47f0699..0000000
--- a/tests/auto/conversion/conversion.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += testcase
-QT += axcontainer testlib
-SOURCES += tst_conversion.cpp
diff --git a/tests/auto/conversion/testutil_p.h b/tests/auto/conversion/testutil_p.h
new file mode 100644
index 0000000..4521811
--- /dev/null
+++ b/tests/auto/conversion/testutil_p.h
@@ -0,0 +1,98 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef TESTUTIL_P_H
+#define TESTUTIL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qtcore/qt_windows.h>
+#include <qtcore/qtglobal>
+#include <wrl/client.h>
+#include <atomic>
+
+using Microsoft::WRL::ComPtr;
+
+template<typename T>
+struct ComBase : T
+{
+ ~ComBase() { Q_ASSERT(m_refCount == 0); }
+
+ ULONG AddRef() final
+ {
+ return m_refCount++;
+ }
+
+ ULONG Release() final
+ {
+ const int refCount = --m_refCount;
+ if (refCount == 0)
+ delete this;
+ return refCount;
+ }
+
+ std::atomic_int m_refCount = 1u;
+};
+
+struct IUnknownStub : ComBase<IUnknown>
+{
+ HRESULT QueryInterface(const IID &riid, void **ppvObject) override
+ {
+ if (!ppvObject)
+ return E_POINTER;
+
+ if (riid == IID_IUnknown) {
+ *ppvObject = this;
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+ }
+};
+
+struct IDispatchStub : ComBase<IDispatch>
+{
+ HRESULT QueryInterface(const IID &riid, void **ppvObject) override
+ {
+ if (!ppvObject)
+ return E_POINTER;
+
+ if (riid == IID_IUnknown || riid == IID_IDispatch) {
+ *ppvObject = this;
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+ }
+
+ HRESULT GetTypeInfoCount(UINT * /*pctinfo*/) override { return E_NOTIMPL; }
+
+ HRESULT GetTypeInfo(UINT /*iTInfo*/, LCID /*lcid*/, ITypeInfo ** /*ppTInfo*/) override
+ {
+ return E_NOTIMPL;
+ }
+
+ HRESULT GetIDsOfNames(const IID & /*riid*/, LPOLESTR * /*rgszNames*/, UINT /*cNames*/,
+ LCID /*lcid*/, DISPID * /*rgDispId*/) override
+ {
+ return E_NOTIMPL;
+ }
+
+ HRESULT Invoke(DISPID /*dispIdMember*/, const IID & /*riid*/, LCID /*lcid*/, WORD /*wFlags*/,
+ DISPPARAMS * /*pDispParams*/, VARIANT * /*pVarResult*/,
+ EXCEPINFO * /*pExcepInfo*/, UINT * /*puArgErr*/) override
+ {
+ return E_NOTIMPL;
+ }
+};
+
+#endif
diff --git a/tests/auto/conversion/tst_conversion.cpp b/tests/auto/conversion/tst_conversion.cpp
index 52be69b..61ffb85 100644
--- a/tests/auto/conversion/tst_conversion.cpp
+++ b/tests/auto/conversion/tst_conversion.cpp
@@ -1,30 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "comutil_p.h"
+#include "testutil_p.h"
+
+#include <qaxtypes_p.h>
+#include <ActiveQt/qaxobject.h>
#include <QtTest/QtTest>
#include <QtCore/QVariant>
@@ -32,18 +13,13 @@
#include <QtCore/QMetaType>
#include <qt_windows.h>
+#include <wrl/client.h>
-QT_BEGIN_NAMESPACE
-
-// Conversion functions from statically linked library (axtypes.h)
-bool QVariantToVARIANT_container(const QVariant &var, VARIANT &arg,
- const QByteArray &typeName = QByteArray(),
- bool out = false);
+using Microsoft::WRL::ComPtr;
-QVariant VARIANTToQVariant_container(const VARIANT &arg, const QByteArray &typeName,
- uint type = 0);
+QT_BEGIN_NAMESPACE
-QT_END_NAMESPACE
+using namespace Qt::StringLiterals;
class tst_Conversion : public QObject
{
@@ -52,6 +28,36 @@ class tst_Conversion : public QObject
private slots:
void conversion_data();
void conversion();
+
+ void VARIANTToQVariant_ReturnsBool_WhenCalledWithVariantBool();
+ void QVariantToVARIANT_ReturnsVariantBool_WhenCalledWithBool();
+
+ void VARIANTToQVariant_ReturnsString_WhenCalledWithString_data();
+ void VARIANTToQVariant_ReturnsString_WhenCalledWithString();
+
+ void QVariantToVARIANT_ReturnsString_WhenCalledWithString_data();
+ void QVariantToVARIANT_ReturnsString_WhenCalledWithString();
+
+ void VARIANTToQVariant_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValueOrPointer_data();
+ void VARIANTToQVariant_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValueOrPointer();
+
+ void QVariantToVARIANT_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValue_data();
+ void QVariantToVARIANT_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValue();
+
+ void VARIANTToQVariant_DoesNotIncreaseRefCount_WhenGivenAnIUnknown();
+ void QVariantToVARIANT_RecoversIUnknown_WhenQVariantHasIUnknown();
+
+ void VARIANTToQVariant_DoesNotIncreaseRefCount_WhenGivenAnIDispatch();
+ void QVariantToVARIANT_RecoversIDispatch_WhenQVariantHasIDispatch();
+
+ void VARIANTToQVariant_IncreasesRefCount_WhenCalledWithQVariantTypeName();
+
+ void ObserveThat_VARIANTToQVariant_ReturnsEmptyQVariant_WhenWrappingIDispatchInQAxObjectPtr();
+ void VARIANTToQVariant_CreatesQAxObject_WhenCalledWithMetaTypeId();
+
+private:
+ template<typename T>
+ static void addScalarMaxValueRow();
};
enum Mode {
@@ -170,6 +176,11 @@ void tst_Conversion::conversion_data()
<< qvar << uint(VT_DATE | VT_BYREF) << typeName << ByReference;
QTest::newRow("datetime-out")
<< qvar << uint(VT_DATE | VT_BYREF) << typeName << OutParameter;
+
+ // QTBUG-122762; do not create a 2-dimensional array from a string (sequence).
+ qvar = QVariant(QVariantList{QVariant(QString("test"_L1)), QVariant(42)});
+ QTest::newRow("list")
+ << qvar << uint(VT_VARIANT | VT_ARRAY | VT_BYREF) << typeName << OutParameter;
}
void tst_Conversion::conversion()
@@ -195,5 +206,267 @@ void tst_Conversion::conversion()
delete variant.pullVal;
}
+void tst_Conversion::VARIANTToQVariant_ReturnsBool_WhenCalledWithVariantBool()
+{
+ {
+ const ComVariant v = true;
+ const QVariant result = VARIANTToQVariant(v, "canBeAnything");
+ QVERIFY(result == true);
+ }
+
+ {
+ const ComVariant v = false;
+ const QVariant result = VARIANTToQVariant(v, "canBeAnything");
+ QVERIFY(result == false);
+ }
+}
+
+void tst_Conversion::QVariantToVARIANT_ReturnsVariantBool_WhenCalledWithBool()
+{
+ {
+ const QVariant v = true;
+ ComVariant result;
+ QVERIFY(QVariantToVARIANT(v, result));
+ QVERIFY(result.vt == VT_BOOL);
+ QVERIFY(result.boolVal == VARIANT_TRUE);
+ }
+
+ {
+ const QVariant v = false;
+ ComVariant result;
+ QVERIFY(QVariantToVARIANT(v, result));
+ QVERIFY(result.vt == VT_BOOL);
+ QVERIFY(result.boolVal == VARIANT_FALSE);
+ }
+}
+
+void tst_Conversion::VARIANTToQVariant_ReturnsString_WhenCalledWithString_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::newRow("empty") << QString{ "" };
+ QTest::newRow("nonempty") << QString{ "Some Latin 1 text" };
+}
+
+void tst_Conversion::VARIANTToQVariant_ReturnsString_WhenCalledWithString()
+{
+ QFETCH(QString, text);
+
+ const ComVariant comVariant = text.toStdWString().c_str();
+ const QVariant actual = VARIANTToQVariant(comVariant, {});
+
+ QCOMPARE(actual, text);
+}
+
+void tst_Conversion::QVariantToVARIANT_ReturnsString_WhenCalledWithString_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::newRow("empty") << QString{ "" };
+ QTest::newRow("nonempty") << QString{ "Some Latin 1 text" };
+}
+
+void tst_Conversion::QVariantToVARIANT_ReturnsString_WhenCalledWithString()
+{
+ QFETCH(QString, text);
+
+ ComVariant comVariant;
+ QVERIFY(QVariantToVARIANT(text, comVariant));
+
+ const QString actual = QString::fromWCharArray(comVariant.bstrVal);
+
+ QCOMPARE(actual, text);
+}
+
+void tst_Conversion::
+ VARIANTToQVariant_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValueOrPointer_data()
+{
+ QTest::addColumn<ComVariant>("comVariant");
+ QTest::addColumn<QVariant>("qvariant");
+
+ addScalarMaxValueRow<char>();
+ addScalarMaxValueRow<unsigned char>();
+ addScalarMaxValueRow<short>();
+ addScalarMaxValueRow<unsigned short>();
+ addScalarMaxValueRow<int>();
+ addScalarMaxValueRow<unsigned int>();
+ addScalarMaxValueRow<long long>();
+ addScalarMaxValueRow<unsigned long long>();
+ addScalarMaxValueRow<float>();
+ addScalarMaxValueRow<double>();
+
+ addScalarMaxValueRow<char *>();
+ addScalarMaxValueRow<unsigned char *>();
+ addScalarMaxValueRow<short *>();
+ addScalarMaxValueRow<unsigned short *>();
+ addScalarMaxValueRow<int *>();
+ addScalarMaxValueRow<unsigned int *>();
+ addScalarMaxValueRow<long long *>();
+ addScalarMaxValueRow<unsigned long long *>();
+ addScalarMaxValueRow<float *>();
+ addScalarMaxValueRow<double *>();
+}
+
+void tst_Conversion::VARIANTToQVariant_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValueOrPointer()
+{
+ QFETCH(ComVariant, comVariant);
+ QFETCH(QVariant, qvariant);
+
+ const QVariant actual = VARIANTToQVariant(comVariant, qvariant.typeName());
+
+ QCOMPARE(actual, qvariant);
+}
+
+void tst_Conversion::QVariantToVARIANT_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValue_data()
+{
+ QTest::addColumn<ComVariant>("comVariant");
+ QTest::addColumn<QVariant>("qvariant");
+
+ addScalarMaxValueRow<int>();
+ addScalarMaxValueRow<unsigned int>();
+ addScalarMaxValueRow<long long>();
+ addScalarMaxValueRow<unsigned long long>();
+ addScalarMaxValueRow<float>();
+ addScalarMaxValueRow<double>();
+}
+
+void tst_Conversion::QVariantToVARIANT_ReturnsCopyOfValue_WhenCalledWithMaxPossibleValue()
+{
+ QFETCH(ComVariant, comVariant);
+ QFETCH(QVariant, qvariant);
+
+ ComVariant actual;
+ QVERIFY(QVariantToVARIANT(qvariant, actual));
+
+ QCOMPARE(actual, comVariant);
+}
+
+void tst_Conversion::VARIANTToQVariant_DoesNotIncreaseRefCount_WhenGivenAnIUnknown()
+{
+ const auto stub = makeComObject<IUnknownStub>();
+
+ const ComVariant value = stub.Get();
+
+ QVERIFY(stub->m_refCount == 2u);
+
+ const QVariant qVariant = VARIANTToQVariant(value, {});
+
+ QVERIFY(stub->m_refCount == 2u);
+
+ Q_UNUSED(qVariant);
+}
+
+void tst_Conversion::QVariantToVARIANT_RecoversIUnknown_WhenQVariantHasIUnknown()
+{
+ const auto stub = makeComObject<IUnknownStub>();
+ const ComVariant value = stub.Get();
+
+ const QVariant qvar = VARIANTToQVariant(value, {});
+
+ ComVariant comVariant;
+ QVERIFY(QVariantToVARIANT(qvar, comVariant));
+
+ QCOMPARE(stub->m_refCount, 3u);
+
+ const ComPtr<IUnknown> recovered = comVariant.punkVal;
+
+ QCOMPARE(recovered, stub);
+}
+
+void tst_Conversion::VARIANTToQVariant_DoesNotIncreaseRefCount_WhenGivenAnIDispatch()
+{
+ const auto stub = makeComObject<IDispatchStub>();
+
+ const ComVariant value = stub.Get();
+
+ QCOMPARE(stub->m_refCount, 2u);
+ const QVariant qVariant = VARIANTToQVariant(value, "IDispatch*");
+
+ QCOMPARE(stub->m_refCount, 2u);
+
+ Q_UNUSED(qVariant);
+}
+
+struct IDispatchFixture
+{
+ const ComPtr<IDispatchStub> m_iDispatchStub = makeComObject<IDispatchStub>();
+ const ComVariant m_comVariant = m_iDispatchStub.Get();
+ const QVariant m_qVariant = VARIANTToQVariant(m_comVariant, "IDispatch*");
+};
+
+void tst_Conversion::QVariantToVARIANT_RecoversIDispatch_WhenQVariantHasIDispatch()
+{
+ const IDispatchFixture testFixture;
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 2u);
+
+ ComVariant comVariant;
+ QVERIFY(QVariantToVARIANT(testFixture.m_qVariant, comVariant));
+
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 3u);
+
+ const ComPtr<IUnknown> recovered = comVariant.pdispVal;
+
+ QCOMPARE(recovered, testFixture.m_iDispatchStub);
+}
+
+void tst_Conversion::VARIANTToQVariant_IncreasesRefCount_WhenCalledWithQVariantTypeName()
+{
+ const IDispatchFixture testFixture;
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 2u);
+
+ QVariant qVariant = VARIANTToQVariant(testFixture.m_comVariant, "QVariant");
+ qVariant = {};
+
+ // Observe that IDispatch interface is leaked here, since
+ // the QVariant destructor does not decrement the refcount
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 3u);
+
+ // Workaround to ensure cleanup
+ testFixture.m_iDispatchStub->Release();
+}
+
+void tst_Conversion::ObserveThat_VARIANTToQVariant_ReturnsEmptyQVariant_WhenWrappingIDispatchInQAxObjectPtr()
+{
+ const IDispatchFixture testFixture;
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 2u);
+
+ qRegisterMetaType<QAxObject *>("QAxObject*");
+ qRegisterMetaType<QAxObject>("QAxObject");
+
+ const QVariant qVariant = VARIANTToQVariant(testFixture.m_comVariant, "QAxObject*");
+ QVERIFY(qVariant.isNull());
+}
+
+void tst_Conversion::VARIANTToQVariant_CreatesQAxObject_WhenCalledWithMetaTypeId()
+{
+ const IDispatchFixture testFixture;
+ QCOMPARE(testFixture.m_iDispatchStub->m_refCount, 2u);
+
+ qRegisterMetaType<QAxObject *>("QAxObject*");
+ qRegisterMetaType<QAxObject>("QAxObject");
+
+ const QVariant qVariant = VARIANTToQVariant(testFixture.m_comVariant, "QAxObject*", QMetaType::fromType<QAxObject*>().id());
+
+ QAxObject *recovered = qVariant.value<QAxObject *>();
+ QVERIFY(recovered != nullptr);
+}
+
+template<typename T>
+void tst_Conversion::addScalarMaxValueRow()
+{
+ using ValueType = std::remove_pointer_t<T>;
+ static ValueType v = std::numeric_limits<ValueType>::max();
+
+ ComVariant comVariant;
+ if constexpr (std::is_pointer_v<T>)
+ comVariant = &v;
+ else
+ comVariant = v;
+
+ const char *typeName = QMetaType::fromType<T>().name();
+ QTest::newRow(typeName) << comVariant << QVariant{ v };
+}
+
QTEST_MAIN(tst_Conversion)
+
+QT_END_NAMESPACE
+
#include "tst_conversion.moc"
diff --git a/tests/auto/dumpcpp/CMakeLists.txt b/tests/auto/dumpcpp/CMakeLists.txt
index 91da6c3..a5ff2dc 100644
--- a/tests/auto/dumpcpp/CMakeLists.txt
+++ b/tests/auto/dumpcpp/CMakeLists.txt
@@ -1,20 +1,24 @@
-# Generated from dumpcpp.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_dumpcpp Test:
#####################################################################
-qt_add_test(tst_dumpcpp
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_dumpcpp LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(tst_dumpcpp
SOURCES
tst_dumpcpp.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::Gui
Qt::Widgets
)
-#### Keys ignored in scope 1:.:.:dumpcpp.pro:<TRUE>:
-# TYPELIBS = "$$(SystemRoot)\\system32\\ieframe.dll"
-
-## Scopes:
-#####################################################################
+qt6_target_typelibs(tst_dumpcpp LIBRARIES "ieframe.dll")
+qt6_target_typelibs(tst_dumpcpp LIBRARIES "msxml6.dll")
diff --git a/tests/auto/dumpcpp/dumpcpp.pro b/tests/auto/dumpcpp/dumpcpp.pro
deleted file mode 100644
index aae7bd8..0000000
--- a/tests/auto/dumpcpp/dumpcpp.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-CONFIG += testcase
-QT += widgets axcontainer testlib
-SOURCES += tst_dumpcpp.cpp
-TARGET = tst_dumpcpp
-
-# Assume Web Browser type library is available in all windows installations
-TYPELIBS = $$(SystemRoot)\\system32\\ieframe.dll
-
-!exists($$TYPELIBS) {
- message("Web Browser type library for test not found!")
-}
diff --git a/tests/auto/dumpcpp/tst_dumpcpp.cpp b/tests/auto/dumpcpp/tst_dumpcpp.cpp
index 039c090..aad0e51 100644
--- a/tests/auto/dumpcpp/tst_dumpcpp.cpp
+++ b/tests/auto/dumpcpp/tst_dumpcpp.cpp
@@ -1,47 +1,55 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtTest/QtTest>
#include "ieframe.h" // generated header
+#include "msxml6.h" // generated header
#include <QApplication>
+
+struct XmlFixture
+{
+ MSXML2::DOMDocument60 doc;
+ MSXML2::IXMLDOMNodeList *root;
+
+ const QString xml{
+ R"(
+ <root prop="The root property">
+ The value
+ </root>
+ )" };
+};
+
class tst_dumpcpp : public QObject
{
Q_OBJECT
private slots:
+ void init();
void toggleAddressBar();
+ void propertyGetter_ReturnsValue_WhenValueIsInt();
+ void propertyGetter_ReturnsValue_WhenValueIsString();
+ void invokeGetter_ReturnsValue_WhenValueInheritsIDispatch();
+ void propertyGetter_ReturnsValue_WhenValueInheritsIDispatch();
+
+ void propertySetter_SetsValue_WhenValueIsVariantInt();
+ void propertySetter_SetsValue_WhenValueIsString();
+ void invoke_SetsValue_WhenValueDerivesFromIDispatch();
+
+private:
+ XmlFixture m_xml;
};
+void tst_dumpcpp::init()
+{
+ m_xml.doc.loadXML(m_xml.xml);
+ m_xml.root = m_xml.doc.childNodes();
+}
+
// A simple test to verify that an object can be instantiated and interacted with
void tst_dumpcpp::toggleAddressBar()
{
- SHDocVw::WebBrowser* webBrowser = new SHDocVw::WebBrowser;
+ SHDocVw::WebBrowser *webBrowser = new SHDocVw::WebBrowser;
QVERIFY(webBrowser);
bool addressBar = webBrowser->AddressBar();
addressBar = !addressBar;
@@ -50,5 +58,60 @@ void tst_dumpcpp::toggleAddressBar()
delete webBrowser;
}
+void tst_dumpcpp::propertyGetter_ReturnsValue_WhenValueIsInt()
+{
+ int length = m_xml.root->length();
+ QVERIFY(length == 1);
+}
+
+void tst_dumpcpp::invokeGetter_ReturnsValue_WhenValueInheritsIDispatch()
+{
+ // item(...) takes an argument and is called as a function invocation
+ MSXML2::IXMLDOMNode *firstChild = m_xml.root->item(0);
+ QVERIFY(firstChild);
+}
+
+void tst_dumpcpp::propertyGetter_ReturnsValue_WhenValueInheritsIDispatch()
+{
+ // attributes() takes an argument and is called as property getter
+ MSXML2::IXMLDOMNamedNodeMap *attributes = m_xml.root->item(0)->attributes();
+ QVERIFY(attributes);
+}
+
+void tst_dumpcpp::propertyGetter_ReturnsValue_WhenValueIsString()
+{
+ MSXML2::IXMLDOMNamedNodeMap *attributes = m_xml.root->item(0)->attributes();
+
+ // nodeValue is a property getter
+ QVariant p = attributes->getNamedItem("prop")->nodeValue();
+ QCOMPARE(p, "The root property");
+}
+
+void tst_dumpcpp::propertySetter_SetsValue_WhenValueIsVariantInt()
+{
+ MSXML2::IXMLDOMNamedNodeMap *attributes = m_xml.root->item(0)->attributes();
+ MSXML2::IXMLDOMNode *attribNode = attributes->item(0);
+ attribNode->setNodeValue(QVariant { 42 } );
+
+ QVariant p = attributes->getNamedItem("prop")->nodeValue();
+ QCOMPARE(p, 42);
+}
+
+void tst_dumpcpp::propertySetter_SetsValue_WhenValueIsString()
+{
+ m_xml.root->item(0)->setText("The new value");
+ QCOMPARE(m_xml.root->item(0)->text(), "The new value");
+}
+
+void tst_dumpcpp::invoke_SetsValue_WhenValueDerivesFromIDispatch()
+{
+ MSXML2::IXMLDOMNode *node = m_xml.doc.createNode(MSXML2::NODE_ELEMENT, "sometag", "");
+ node->setText("The new text");
+
+ m_xml.root->item(0)->appendChild(node);
+
+ QCOMPARE(m_xml.root->item(0)->childNodes()->item(1)->text(), "The new text");
+}
+
QTEST_MAIN(tst_dumpcpp)
#include "tst_dumpcpp.moc"
diff --git a/tests/auto/qaxobject/CMakeLists.txt b/tests/auto/qaxobject/CMakeLists.txt
index 7c07415..87fe2e1 100644
--- a/tests/auto/qaxobject/CMakeLists.txt
+++ b/tests/auto/qaxobject/CMakeLists.txt
@@ -1,13 +1,20 @@
-# Generated from qaxobject.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
-## qaxobject Test:
+## QAxObject Test:
#####################################################################
-qt_add_test(qaxobject
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qaxobject LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(tst_qaxobject
SOURCES
tst_qaxobject.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::Gui
)
diff --git a/tests/auto/qaxobject/qaxobject.pro b/tests/auto/qaxobject/qaxobject.pro
deleted file mode 100644
index e6f51a1..0000000
--- a/tests/auto/qaxobject/qaxobject.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += testcase
-QT += axcontainer testlib
-SOURCES += tst_qaxobject.cpp
diff --git a/tests/auto/qaxobject/tst_qaxobject.cpp b/tests/auto/qaxobject/tst_qaxobject.cpp
index 3955a6c..f498927 100644
--- a/tests/auto/qaxobject/tst_qaxobject.cpp
+++ b/tests/auto/qaxobject/tst_qaxobject.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtTest/QtTest>
diff --git a/tests/auto/qaxscript/CMakeLists.txt b/tests/auto/qaxscript/CMakeLists.txt
index 4312217..351ab2f 100644
--- a/tests/auto/qaxscript/CMakeLists.txt
+++ b/tests/auto/qaxscript/CMakeLists.txt
@@ -1,12 +1,19 @@
-# Generated from qaxscript.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
-## qaxscript Test:
+## tst_QAxScript Test:
#####################################################################
-qt_add_test(qaxscript
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qaxscript LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(tst_qaxscript
SOURCES
tst_qaxscript.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
)
diff --git a/tests/auto/qaxscript/qaxscript.pro b/tests/auto/qaxscript/qaxscript.pro
deleted file mode 100644
index 704b2cd..0000000
--- a/tests/auto/qaxscript/qaxscript.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += testcase
-QT = core axcontainer testlib
-SOURCES += tst_qaxscript.cpp
diff --git a/tests/auto/qaxscript/tst_qaxscript.cpp b/tests/auto/qaxscript/tst_qaxscript.cpp
index 3b3ab88..4134b2d 100644
--- a/tests/auto/qaxscript/tst_qaxscript.cpp
+++ b/tests/auto/qaxscript/tst_qaxscript.cpp
@@ -1,57 +1,162 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtTest/QtTest>
#include <QAxScriptManager>
#include <QAxScript>
+using namespace Qt::StringLiterals;
+
class tst_QAxScript : public QObject
{
Q_OBJECT
private slots:
+ void call();
void scriptReturnValue();
+ void scriptOutParameters();
+ void error_data();
+ void error();
};
+void tst_QAxScript::call()
+{
+ QAxScriptManager scriptManager;
+ const auto scriptCode_js = uR"JS(
+ function test1() {
+ return 'JScript';
+ }
+ )JS"_s;
+ const auto scriptCode_vb = uR"VB(
+ Function test2()
+ test2 = "VBScript"
+ End Function
+ )VB"_s;
+ QAxScript *jsscript = scriptManager.load(scriptCode_js, u"JS"_s, u"JScript"_s);
+ QVERIFY2(jsscript, "Unable to load script (CoInitializeEx() called?)");
+ QVERIFY(jsscript->scriptEngine()->hasIntrospection());
+ QAxScript *vbscript = scriptManager.load(scriptCode_vb, u"VB"_s, u"VBScript"_s);
+ QVERIFY2(vbscript, "Unable to load script (CoInitializeEx() called?)");
+ QVERIFY(vbscript->scriptEngine()->hasIntrospection());
+
+ QCOMPARE(jsscript->call("test1()"), "JScript");
+ QTest::ignoreMessage(QtWarningMsg, "QAxBase::dynamicCallHelper: test1(): No such method in [unknown]");
+ QTest::ignoreMessage(QtWarningMsg, "\tCandidates are:");
+ QCOMPARE(vbscript->call("test1()"), QVariant());
+ QCOMPARE(vbscript->call("test2()"), "VBScript");
+ QTest::ignoreMessage(QtWarningMsg, "QAxBase::dynamicCallHelper: test2(): No such method in [unknown]");
+ QTest::ignoreMessage(QtWarningMsg, "\tCandidates are:");
+ QCOMPARE(jsscript->call("test2()"), QVariant());
+}
+
void tst_QAxScript::scriptReturnValue()
{
QAxScriptManager scriptManager;
- const char scriptCode[] =
- "function foo() {\n"
- " return 'test';\n"
- "}\n"; // QTBUG-42289, fails when DISPATCH_PROPERTYGET is used.
- QAxScript *script = scriptManager.load(QLatin1String(scriptCode),
- QStringLiteral("Test"),
- QStringLiteral("JScript"));
+ const auto scriptCode = uR"JS(
+ function foo() {
+ return 'test';
+ }
+ )JS"_s; // QTBUG-42289, fails when DISPATCH_PROPERTYGET is used.
+ QAxScript *script = scriptManager.load(scriptCode, u"Test"_s, u"JScript"_s);
QVERIFY2(script, "Unable to load script (CoInitializeEx() called?)");
const QVariant result = script->call("foo()");
- QCOMPARE(result, QVariant(QStringLiteral("test")));
+ QCOMPARE(result, QVariant(u"test"_s));
+}
+
+void tst_QAxScript::scriptOutParameters()
+{
+ QAxScriptManager scriptManager;
+ const auto scriptCode = uR"VB(
+ Function GetProductName(ByRef manufacturer, ByRef name, ByRef version)
+ manufacturer = "The Qt Company"
+ name = "ActiveQt"
+ version = 650
+ On Error Resume Next
+ GetProductName = 42
+ End Function
+ )VB"_s;
+
+ QAxScript *script = scriptManager.load(scriptCode, u"Test"_s, u"VBScript"_s);
+ QVERIFY2(script, "Unable to load script (CoInitializeEx() called?)");
+
+ QVariant returnValue;
+ QList<QVariant> results = {{}, {}, {}};
+
+ returnValue = script->scriptEngine()->dynamicCall("GetProductName(QVariant&,QVariant&,QVariant&)", results);
+ QCOMPARE(returnValue, 42);
+ QCOMPARE(results.size(), 3);
+ QCOMPARE(results.at(0), "The Qt Company");
+ QCOMPARE(results.at(1), "ActiveQt");
+ QCOMPARE(results.at(2), 650);
+
+ results = {{}, {}, {}};
+ returnValue = script->call("GetProductName(QVariant&,QVariant&,QVariant&)", results);
+ QCOMPARE(returnValue, 42);
+ QCOMPARE(results.size(), 3);
+ QCOMPARE(results.at(0), "The Qt Company");
+ QCOMPARE(results.at(1), "ActiveQt");
+ QCOMPARE(results.at(2), 650);
+}
+
+void tst_QAxScript::error_data()
+{
+ QTest::addColumn<QString>("scriptCode");
+ QTest::addColumn<QString>("language");
+ QTest::addColumn<int>("expectedErrorCode");
+ QTest::addColumn<QString>("expectedDescription");
+ QTest::addColumn<int>("expectedSourcePosition");
+ QTest::addColumn<QString>("expectedSourceText");
+
+ QTest::addRow("JS syntax error")
+ << "function foo {}"
+ << "JScript"
+ << 0 << "Expected '('" << 0 << "function foo {}";
+
+ QTest::addRow("VB syntax error")
+ << "Funktion test"
+ << "VBScript"
+ << 0 << "Type mismatch: 'Funktion'" << 0 << "";
+}
+
+void tst_QAxScript::error()
+{
+ QFETCH(QString, scriptCode);
+ QFETCH(QString, language);
+ QFETCH(int, expectedErrorCode);
+ QFETCH(QString, expectedDescription);
+ QFETCH(int, expectedSourcePosition);
+ QFETCH(QString, expectedSourceText);
+
+ QAxScriptManager scriptManager;
+ QAxScript script(u"Test"_s, &scriptManager);
+
+ QAxScript *actualScript = nullptr;
+ int actualCode;
+ QString actualDescription;
+ int actualSourcePosition;
+ QString actualSourceText;
+
+ connect(&scriptManager, &QAxScriptManager::error,
+ this, [&](QAxScript *script){
+ actualScript = script;
+ });
+
+ connect(&script, &QAxScript::error,
+ this, [&](int code, const QString &description, int sourcePosition, const QString &sourceText){
+ actualCode = code;
+ actualDescription = description;
+ actualSourcePosition = sourcePosition;
+ actualSourceText = sourceText.trimmed();
+ });
+
+ script.load(scriptCode, language);
+
+ QCOMPARE(actualScript, &script);
+ QCOMPARE(actualCode, expectedErrorCode);
+ QCOMPARE(actualDescription, expectedDescription);
+ QCOMPARE(actualSourcePosition, expectedSourcePosition);
+ QCOMPARE(actualSourceText, expectedSourceText);
}
QTEST_MAIN(tst_QAxScript)
diff --git a/tests/auto/qaxscriptmanager/CMakeLists.txt b/tests/auto/qaxscriptmanager/CMakeLists.txt
new file mode 100644
index 0000000..37b83ab
--- /dev/null
+++ b/tests/auto/qaxscriptmanager/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## QAxScriptManager Test:
+#####################################################################
+
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qaxscriptmanager LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(tst_qaxscriptmanager
+ SOURCES
+ tst_qaxscriptmanager.cpp
+ LIBRARIES
+ Qt::AxContainer
+)
diff --git a/tests/auto/qaxscriptmanager/tst_qaxscriptmanager.cpp b/tests/auto/qaxscriptmanager/tst_qaxscriptmanager.cpp
new file mode 100644
index 0000000..5c92bdf
--- /dev/null
+++ b/tests/auto/qaxscriptmanager/tst_qaxscriptmanager.cpp
@@ -0,0 +1,188 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+
+#include <QtTest/QtTest>
+#include <QAxScriptManager>
+#include <QAxScript>
+
+using namespace Qt::StringLiterals;
+
+class tst_QAxScriptManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ struct Script {
+ QString language;
+ QString name;
+ QString code;
+ };
+
+private slots:
+ void functions_data();
+ void functions();
+
+ void scriptNames_data();
+ void scriptNames();
+
+ void script_data();
+ void script();
+
+ void call_data();
+ void call();
+};
+
+void tst_QAxScriptManager::functions_data()
+{
+ const auto scriptCode_js = Script{u"JScript"_s, u"test1"_s, uR"JS(
+ function js1() {
+ return 'JScript 1';
+ }
+ function js2(value) {
+ return 'JScript 2';
+ }
+ )JS"_s};
+ const auto scriptCode_vb = Script{u"VBScript"_s, u"test2"_s, uR"VB(
+ Function vb1()
+ vb1 = "VBScript 1"
+ End Function
+
+ Function vb2(value)
+ vb2 = "VBScript 2"
+ End Function
+ )VB"_s};
+
+ QTest::addColumn<QList<Script>>("scripts");
+ QTest::addColumn<QStringList>("functions");
+ QTest::addColumn<QStringList>("signatures");
+
+ QTest::addRow("js") << QList{scriptCode_js}
+ << QStringList{"js1", "js2"}
+ << QStringList{"js1()", "js2(QVariant)"};
+ QTest::addRow("vb") << QList{scriptCode_vb}
+ << QStringList{"vb1", "vb2"}
+ << QStringList{"vb1()", "vb2(QVariant)"};
+ QTest::addRow("both") << QList{scriptCode_js, scriptCode_vb}
+ << QStringList{"js1", "js2", "vb1", "vb2"}
+ << QStringList{"js1()", "js2(QVariant)", "vb1()", "vb2(QVariant)"};
+}
+
+void tst_QAxScriptManager::functions()
+{
+ // QStringList functions(QAxScript::FunctionFlags = QAxScript::FunctionNames) const;
+
+ QFETCH(QList<Script>, scripts);
+ QFETCH(QStringList, functions);
+ QFETCH(QStringList, signatures);
+
+ QAxScriptManager scriptManager;
+ for (const auto &script : scripts) {
+ QVERIFY2(scriptManager.load(script.code, script.name, script.language),
+ "Unable to load script (CoInitializeEx() called?)");
+ }
+ functions.sort();
+ QStringList actualFunctions = scriptManager.functions();
+ actualFunctions.sort();
+ QCOMPARE(actualFunctions, functions);
+
+ QStringList actualSignatures = scriptManager.functions(QAxScript::FunctionSignatures);
+ actualSignatures.sort();
+ QCOMPARE(actualSignatures, signatures);
+}
+
+void tst_QAxScriptManager::scriptNames_data()
+{
+ functions_data();
+}
+
+void tst_QAxScriptManager::scriptNames()
+{
+ // QStringList scriptNames() const;
+ QFETCH(QList<Script>, scripts);
+ QFETCH(QStringList, functions);
+
+ QAxScriptManager scriptManager;
+ QStringList expectedNames;
+ for (const auto &script : scripts) {
+ expectedNames << script.name;
+ QVERIFY2(scriptManager.load(script.code, script.name, script.language),
+ "Unable to load script (CoInitializeEx() called?)");
+ }
+ expectedNames.sort();
+ QStringList actualNames = scriptManager.scriptNames();
+ actualNames.sort();
+ QCOMPARE(actualNames, expectedNames);
+}
+
+void tst_QAxScriptManager::script_data()
+{
+ functions_data();
+}
+
+void tst_QAxScriptManager::script()
+{
+ QFETCH(QList<Script>, scripts);
+ QFETCH(QStringList, functions);
+
+ QAxScriptManager scriptManager;
+ QStringList expectedNames;
+ for (const auto &script : scripts) {
+ expectedNames << script.name;
+ QVERIFY2(scriptManager.load(script.code, script.name, script.language),
+ "Unable to load script (CoInitializeEx() called?)");
+ }
+
+ for (const auto &script : scripts) {
+ QAxScript *axscript = scriptManager.script(script.name);
+ QVERIFY(axscript);
+ QVERIFY(axscript->scriptEngine());
+ QVERIFY(axscript->scriptEngine()->isValid());
+ const auto scriptFunctions = axscript->functions();
+ for (const auto &scriptFunction : scriptFunctions) {
+ auto index = functions.indexOf(scriptFunction);
+ QCOMPARE_NE(index, -1);
+ functions.remove(index);
+ }
+
+ QCOMPARE(axscript->scriptEngine()->scriptLanguage(), script.language);
+ }
+
+ // verify that all functions were found across the different QAxScript objects
+ QVERIFY(functions.isEmpty());
+}
+
+void tst_QAxScriptManager::call_data()
+{
+ functions_data();
+}
+
+void tst_QAxScriptManager::call()
+{
+ QFETCH(QList<Script>, scripts);
+ QFETCH(QStringList, functions);
+ QFETCH(QStringList, signatures);
+
+ QAxScriptManager scriptManager;
+ for (const auto &script : scripts) {
+ QAxScript *axScript = scriptManager.load(script.code, script.name, script.language);
+
+ QVERIFY2(axScript, "Unable to load script (CoInitializeEx() called?)");
+ QVERIFY(axScript->scriptEngine());
+ QVERIFY(axScript->scriptEngine()->hasIntrospection());
+ }
+
+ // QAxScriptManager::call finds the script based on function name...
+ for (const auto &function : std::as_const(functions)) {
+ QVariant result = scriptManager.call(function);
+ QCOMPARE(result.metaType(), QMetaType::fromType<QString>());
+ }
+ // ...or fully qualified function signature
+ for (const auto &function : std::as_const(signatures)) {
+ QVariant result = scriptManager.call(function);
+ QCOMPARE(result.metaType(), QMetaType::fromType<QString>());
+ }
+}
+
+QTEST_MAIN(tst_QAxScriptManager)
+#include "tst_qaxscriptmanager.moc"
diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt
index 048232d..f911543 100644
--- a/tests/manual/CMakeLists.txt
+++ b/tests/manual/CMakeLists.txt
@@ -1,5 +1,11 @@
-# Generated from manual.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(axviewer)
add_subdirectory(dumpcpp)
+add_subdirectory(hierarchy)
+add_subdirectory(mediaplayer)
+add_subdirectory(menus)
+add_subdirectory(multiple)
+add_subdirectory(opengl)
add_subdirectory(testcontrol)
diff --git a/tests/manual/axviewer/.prev_CMakeLists.txt b/tests/manual/axviewer/.prev_CMakeLists.txt
deleted file mode 100644
index 8864fee..0000000
--- a/tests/manual/axviewer/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-# Generated from axviewer.pro.
-
-#####################################################################
-## axviewer Binary:
-#####################################################################
-
-qt_add_executable(axviewer
- SOURCES
- ../shared/metaobjectdump.cpp ../shared/metaobjectdump.h
- ../shared/textdialog.cpp ../shared/textdialog.h
- main.cpp
- INCLUDE_DIRECTORIES
- ../shared
- PUBLIC_LIBRARIES
- Qt::AxContainer
- Qt::Gui
- Qt::Widgets
-)
-
-#### Keys ignored in scope 1:.:.:axviewer.pro:<TRUE>:
-# DIAGLIB = "../../../../qtbase/tests/manual/diaglib"
-# TEMPLATE = "app"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(axviewer CONDITION EXISTS _ss_DIAGLIB
- SOURCES
- ../../../../qtbase/tests/manual/diaglib/eventfilter.cpp ../../../../qtbase/tests/manual/diaglib/eventfilter.h
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump.h
- ../../../../qtbase/tests/manual/diaglib/qwindowdump.cpp ../../../../qtbase/tests/manual/diaglib/qwindowdump.h
- ../../../../qtbase/tests/manual/diaglib/textdump.cpp ../../../../qtbase/tests/manual/diaglib/textdump.h
- DEFINES
- QT_DIAG_LIB
- INCLUDE_DIRECTORIES
- ../../../../qtbase/tests/manual/diaglib
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::GuiPrivate
-)
-
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (WIN32)
- SOURCES
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump_win.cpp
- PUBLIC_LIBRARIES
- user32
-)
-
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (NOT (WIN32))
- SOURCES
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump.cpp
-)
-
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (QT_FEATURE_widgets)
- SOURCES
- ../../../../qtbase/tests/manual/diaglib/debugproxystyle.cpp ../../../../qtbase/tests/manual/diaglib/debugproxystyle.h
- ../../../../qtbase/tests/manual/diaglib/logwidget.cpp ../../../../qtbase/tests/manual/diaglib/logwidget.h
- ../../../../qtbase/tests/manual/diaglib/qwidgetdump.cpp ../../../../qtbase/tests/manual/diaglib/qwidgetdump.h
- PUBLIC_LIBRARIES
- Qt::WidgetsPrivate
-)
-
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (QT_FEATURE_opengl)
- SOURCES
- ../../../../qtbase/tests/manual/diaglib/glinfo.cpp ../../../../qtbase/tests/manual/diaglib/glinfo.h
- PUBLIC_LIBRARIES
- Qt::OpenGL
- Qt::OpenGLWidgets
-)
diff --git a/tests/manual/axviewer/CMakeLists.txt b/tests/manual/axviewer/CMakeLists.txt
index f34e32c..22f8f3a 100644
--- a/tests/manual/axviewer/CMakeLists.txt
+++ b/tests/manual/axviewer/CMakeLists.txt
@@ -1,70 +1,70 @@
-# Generated from axviewer.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
#####################################################################
## axviewer Binary:
#####################################################################
-# qt_add_executable(axviewer # special case
-qt_add_manual_test(axviewer # special case
+qt_internal_add_manual_test(tst_axviewer_manual
SOURCES
../shared/metaobjectdump.cpp ../shared/metaobjectdump.h
../shared/textdialog.cpp ../shared/textdialog.h
main.cpp
INCLUDE_DIRECTORIES
../shared
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::Gui
Qt::Widgets
)
-#### Keys ignored in scope 1:.:.:axviewer.pro:<TRUE>:
-# DIAGLIB = "../../../../qtbase/tests/manual/diaglib"
-# TEMPLATE = "app"
-
## Scopes:
#####################################################################
-qt_extend_target(axviewer CONDITION EXISTS _ss_DIAGLIB
+set(diaglib_path "${CMAKE_CURRENT_SOURCE_DIR}/../../../../qtbase/tests/manual/diaglib")
+qt_internal_extend_target(tst_axviewer_manual CONDITION EXISTS "${diaglib_path}"
SOURCES
- ../../../../qtbase/tests/manual/diaglib/eventfilter.cpp ../../../../qtbase/tests/manual/diaglib/eventfilter.h
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump.h
- ../../../../qtbase/tests/manual/diaglib/qwindowdump.cpp ../../../../qtbase/tests/manual/diaglib/qwindowdump.h
- ../../../../qtbase/tests/manual/diaglib/textdump.cpp ../../../../qtbase/tests/manual/diaglib/textdump.h
+ "${diaglib_path}/eventfilter.cpp" "${diaglib_path}/eventfilter.h"
+ "${diaglib_path}/nativewindowdump.h"
+ "${diaglib_path}/qwindowdump.cpp" "${diaglib_path}/qwindowdump.h"
+ "${diaglib_path}/textdump.cpp" "${diaglib_path}/textdump.h"
DEFINES
QT_DIAG_LIB
INCLUDE_DIRECTORIES
- ../../../../qtbase/tests/manual/diaglib
- PUBLIC_LIBRARIES
+ "${diaglib_path}"
+ LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
)
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (WIN32)
+qt_internal_extend_target(tst_axviewer_manual CONDITION (EXISTS "${diaglib_path}") AND (WIN32)
SOURCES
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump_win.cpp
- PUBLIC_LIBRARIES
+ "${diaglib_path}/nativewindowdump_win.cpp"
+ LIBRARIES
user32
)
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (NOT (WIN32))
+qt_internal_extend_target(tst_axviewer_manual CONDITION (EXISTS "${diaglib_path}") AND (NOT (WIN32))
SOURCES
- ../../../../qtbase/tests/manual/diaglib/nativewindowdump.cpp
+ "${diaglib_path}/nativewindowdump.cpp"
)
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (QT_FEATURE_widgets)
+qt_internal_extend_target(tst_axviewer_manual CONDITION (EXISTS "${diaglib_path}") AND
+ TARGET Qt::Widgets
SOURCES
- ../../../../qtbase/tests/manual/diaglib/debugproxystyle.cpp ../../../../qtbase/tests/manual/diaglib/debugproxystyle.h
- ../../../../qtbase/tests/manual/diaglib/logwidget.cpp ../../../../qtbase/tests/manual/diaglib/logwidget.h
- ../../../../qtbase/tests/manual/diaglib/qwidgetdump.cpp ../../../../qtbase/tests/manual/diaglib/qwidgetdump.h
- PUBLIC_LIBRARIES
+ "${diaglib_path}/debugproxystyle.cpp" "${diaglib_path}/debugproxystyle.h"
+ "${diaglib_path}/logwidget.cpp" "${diaglib_path}/logwidget.h"
+ "${diaglib_path}/qwidgetdump.cpp" "${diaglib_path}/qwidgetdump.h"
+ LIBRARIES
Qt::WidgetsPrivate
)
-qt_extend_target(axviewer CONDITION (EXISTS _ss_DIAGLIB) AND (QT_FEATURE_opengl)
+qt_internal_extend_target(tst_axviewer_manual CONDITION (EXISTS "${diaglib_path}") AND
+ TARGET Qt::OpenGL AND TARGET Qt::OpenGLWidgets
SOURCES
- ../../../../qtbase/tests/manual/diaglib/glinfo.cpp ../../../../qtbase/tests/manual/diaglib/glinfo.h
- PUBLIC_LIBRARIES
+ "${diaglib_path}/glinfo.cpp" "${diaglib_path}/glinfo.h"
+ LIBRARIES
Qt::OpenGL
Qt::OpenGLWidgets
)
diff --git a/tests/manual/axviewer/axviewer.pro b/tests/manual/axviewer/axviewer.pro
deleted file mode 100644
index a609e49..0000000
--- a/tests/manual/axviewer/axviewer.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = app
-QT = core gui widgets axcontainer
-CONFIG += console c++11
-
-SOURCES += main.cpp
-include(../shared/shared.pri)
-
-DIAGLIB = ../../../../qtbase/tests/manual/diaglib
-exists($$DIAGLIB):include($$DIAGLIB/diaglib.pri)
diff --git a/tests/manual/axviewer/main.cpp b/tests/manual/axviewer/main.cpp
index 29ad3dc..e48bdba 100644
--- a/tests/manual/axviewer/main.cpp
+++ b/tests/manual/axviewer/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "metaobjectdump.h"
#include "textdialog.h"
@@ -148,8 +123,6 @@ void MainWindow::showMetaObject()
int main(int argc, char* argv[])
{
- if (isOptionSet(argc, argv, "-s"))
- QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
if (!isOptionSet(argc, argv, "-n"))
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
@@ -161,9 +134,6 @@ int main(int argc, char* argv[])
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
parser.addHelpOption();
parser.addVersionOption();
- QCommandLineOption noScalingDummy(QStringLiteral("s"),
- QStringLiteral("Set Qt::AA_DisableHighDpiScaling."));
- parser.addOption(noScalingDummy);
QCommandLineOption nativeSiblingsDummy(QStringLiteral("n"),
QStringLiteral("Do not set Qt::AA_DontCreateNativeWidgetSiblings."));
parser.addOption(nativeSiblingsDummy);
diff --git a/tests/manual/dumpcpp/CMakeLists.txt b/tests/manual/dumpcpp/CMakeLists.txt
index bc681d9..e9ffc1a 100644
--- a/tests/manual/dumpcpp/CMakeLists.txt
+++ b/tests/manual/dumpcpp/CMakeLists.txt
@@ -1,26 +1,22 @@
-# Generated from dumpcpp.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## dumpcpp Binary:
#####################################################################
-qt_add_executable(dumpcpp
+qt_internal_add_manual_test(tst_dumpcpp_manual
SOURCES
../shared/metaobjectdump.cpp ../shared/metaobjectdump.h
../shared/textdialog.cpp ../shared/textdialog.h
main.cpp
INCLUDE_DIRECTORIES
../shared
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::Gui
Qt::Test
Qt::Widgets
)
-#### Keys ignored in scope 1:.:.:dumpcpp.pro:<TRUE>:
-# TEMPLATE = "app"
-# TYPELIBS = "$$(SystemRoot)\\system32\\ieframe.dll"
-
-## Scopes:
-#####################################################################
+qt6_target_typelibs(tst_dumpcpp_manual LIBRARIES "ieframe.dll")
diff --git a/tests/manual/dumpcpp/dumpcpp.pro b/tests/manual/dumpcpp/dumpcpp.pro
deleted file mode 100644
index 6f116c0..0000000
--- a/tests/manual/dumpcpp/dumpcpp.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE=app
-CONFIG += QMAKE_LFLAGS_CONSOLE
-QT += widgets axcontainer testlib
-
-SOURCES += main.cpp
-include(../shared/shared.pri)
-
-# Assume Web Browser type library is available in all windows installations
-TYPELIBS = $$(SystemRoot)\\system32\\ieframe.dll
-
-!exists($$TYPELIBS) {
- message("Web Browser type library for test not found!")
-}
diff --git a/tests/manual/dumpcpp/main.cpp b/tests/manual/dumpcpp/main.cpp
index 2f3cef8..0fc6b73 100644
--- a/tests/manual/dumpcpp/main.cpp
+++ b/tests/manual/dumpcpp/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "ieframe.h" // generated header
@@ -37,6 +12,7 @@
#include <QMenu>
#include <QMenuBar>
#include <QToolBar>
+#include <QLibraryInfo>
#include <QScreen>
@@ -96,9 +72,6 @@ void MainWindow::showMetaObject()
int main(int argc, char *argv[])
{
- QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-
QApplication a(argc, argv);
MainWindow w;
diff --git a/tests/manual/hierarchy/CMakeLists.txt b/tests/manual/hierarchy/CMakeLists.txt
new file mode 100644
index 0000000..3db0a0e
--- /dev/null
+++ b/tests/manual/hierarchy/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## hierarchy Library:
+#####################################################################
+
+set(CMAKE_AUTOMOC ON)
+
+qt_internal_add_manual_test(tst_hierarchy
+ GUI
+ SOURCES
+ main.cpp
+ objects.cpp objects.h
+ hierarchy.def
+ hierarchy.rc
+ LIBRARIES
+ Qt::AxServer
+ Qt::Gui
+ Qt::Widgets
+)
+
+qt_disable_warnings(tst_hierarchy)
+qt6_target_idl(tst_hierarchy)
diff --git a/tests/manual/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc b/tests/manual/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc
new file mode 100644
index 0000000..9b14316
--- /dev/null
+++ b/tests/manual/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc
@@ -0,0 +1,44 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+//! [script]
+<script language="javascript">
+function createSubWidget( form )
+{
+ ParentWidget.createSubWidget( form.nameEdit.value );
+}
+
+function renameSubWidget( form )
+{
+ var SubWidget = ParentWidget.subWidget( form.nameEdit.value );
+ if ( !SubWidget ) {
+ alert( "No such widget " + form.nameEdit.value + "!" );
+ return;
+ }
+ SubWidget.label = form.labelEdit.value;
+ form.nameEdit.value = SubWidget.label;
+}
+
+function setFont( form )
+{
+ ParentWidget.font = form.fontEdit.value;
+}
+</script>
+
+<p>
+This widget can have many children!
+</p>
+<object ID="ParentWidget" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c"
+CODEBASE="http://www.qt-project.org/demos/hierarchy.cab">
+[Object not available! Did you forget to build and register the server?]
+</object><br />
+<form>
+<input type="edit" ID="nameEdit" value="&lt;enter object name&gt;" />
+<input type="button" value="Create" onClick="createSubWidget(this.form)" />
+<input type="edit" ID="labelEdit" />
+<input type="button" value="Rename" onClick="renameSubWidget(this.form)" />
+<br />
+<input type="edit" ID="fontEdit" value="MS Sans Serif" />
+<input type="button" value = "Set Font" onClick="setFont(this.form)" />
+</form>
+//! [script]
diff --git a/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc b/tests/manual/hierarchy/doc/src/hierarchy.qdoc
index f618729..fbfaca9 100644
--- a/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc
+++ b/tests/manual/hierarchy/doc/src/hierarchy.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qaxserver-demo-hierarchy.html
@@ -35,6 +11,7 @@
/*!
\example activeqt/hierarchy
\title Hierarchy Example (ActiveQt)
+ \ingroup activeqt-examples
\brief The Hierarchy example is shows how to write an in-process ActiveX
control. The control is a QWidget subclass with child widgets
diff --git a/examples/activeqt/hierarchy/hierarchy.def b/tests/manual/hierarchy/hierarchy.def
index bc82a03..bc82a03 100644
--- a/examples/activeqt/hierarchy/hierarchy.def
+++ b/tests/manual/hierarchy/hierarchy.def
diff --git a/examples/activeqt/hierarchy/hierarchy.ico b/tests/manual/hierarchy/hierarchy.ico
index c80d36a..c80d36a 100644
--- a/examples/activeqt/hierarchy/hierarchy.ico
+++ b/tests/manual/hierarchy/hierarchy.ico
Binary files differ
diff --git a/examples/activeqt/hierarchy/hierarchy.inf b/tests/manual/hierarchy/hierarchy.inf
index cb7e90f..cb7e90f 100644
--- a/examples/activeqt/hierarchy/hierarchy.inf
+++ b/tests/manual/hierarchy/hierarchy.inf
diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/tests/manual/hierarchy/hierarchy.pro
index acc108a..acc108a 100644
--- a/examples/activeqt/hierarchy/hierarchy.pro
+++ b/tests/manual/hierarchy/hierarchy.pro
diff --git a/examples/activeqt/hierarchy/hierarchy.rc b/tests/manual/hierarchy/hierarchy.rc
index 70eb503..70eb503 100644
--- a/examples/activeqt/hierarchy/hierarchy.rc
+++ b/tests/manual/hierarchy/hierarchy.rc
diff --git a/tests/manual/hierarchy/main.cpp b/tests/manual/hierarchy/main.cpp
new file mode 100644
index 0000000..5ebe6e8
--- /dev/null
+++ b/tests/manual/hierarchy/main.cpp
@@ -0,0 +1,12 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+#include "objects.h"
+#include <QAxFactory>
+
+QAXFACTORY_BEGIN("{9e626211-be62-4d18-9483-9419358fbb03}", "{75c276de-1df5-451f-a004-e4fa1a587df1}")
+ QAXCLASS(QParentWidget)
+ QAXTYPE(QSubWidget)
+QAXFACTORY_END()
+//! [0]
diff --git a/tests/manual/hierarchy/objects.cpp b/tests/manual/hierarchy/objects.cpp
new file mode 100644
index 0000000..6dfda44
--- /dev/null
+++ b/tests/manual/hierarchy/objects.cpp
@@ -0,0 +1,70 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "objects.h"
+#include <QLayout>
+#include <QPainter>
+
+/* Implementation of QParentWidget */
+//! [0]
+QParentWidget::QParentWidget(QWidget *parent)
+: QWidget(parent),
+ m_vbox(new QVBoxLayout(this))
+{
+}
+
+//! [0] //! [1]
+void QParentWidget::createSubWidget(const QString &name)
+{
+ QSubWidget *sw = new QSubWidget(this, name);
+ m_vbox->addWidget(sw);
+ sw->setLabel(name);
+ sw->show();
+}
+
+//! [1] //! [2]
+QSubWidget *QParentWidget::subWidget(const QString &name)
+{
+ return findChild<QSubWidget *>(name);
+}
+
+//! [2]
+QSize QParentWidget::sizeHint() const
+{
+ return QWidget::sizeHint().expandedTo(QSize(100, 100));
+}
+
+/* Implementation of QSubWidget */
+//! [3]
+QSubWidget::QSubWidget(QWidget *parent, const QString &name)
+: QWidget(parent)
+{
+ setObjectName(name);
+}
+
+void QSubWidget::setLabel(const QString &text)
+{
+ m_label = text;
+ setObjectName(text);
+ update();
+}
+
+QString QSubWidget::label() const
+{
+ return m_label;
+}
+
+QSize QSubWidget::sizeHint() const
+{
+ QFontMetrics fm(font());
+ return QSize(fm.horizontalAdvance(m_label), fm.height());
+}
+
+void QSubWidget::paintEvent(QPaintEvent *)
+{
+ QPainter painter(this);
+ painter.setPen(palette().text().color());
+ painter.drawText(rect(), Qt::AlignCenter, m_label);
+//! [3] //! [4]
+}
+//! [4]
diff --git a/tests/manual/hierarchy/objects.h b/tests/manual/hierarchy/objects.h
new file mode 100644
index 0000000..6b8bea6
--- /dev/null
+++ b/tests/manual/hierarchy/objects.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef OBJECTS_H
+#define OBJECTS_H
+
+#include <QWidget>
+
+QT_BEGIN_NAMESPACE
+class QVBoxLayout;
+QT_END_NAMESPACE
+class QSubWidget;
+
+//! [0]
+class QParentWidget : public QWidget
+{
+ Q_OBJECT
+ Q_CLASSINFO("ClassID", "{d574a747-8016-46db-a07c-b2b4854ee75c}");
+ Q_CLASSINFO("InterfaceID", "{4a30719d-d9c2-4659-9d16-67378209f822}");
+ Q_CLASSINFO("EventsID", "{4a30719d-d9c2-4659-9d16-67378209f823}");
+public:
+ explicit QParentWidget(QWidget *parent = nullptr);
+
+ QSize sizeHint() const override;
+
+public slots:
+ void createSubWidget(const QString &name);
+
+ QSubWidget *subWidget(const QString &name);
+
+private:
+ QVBoxLayout *m_vbox;
+};
+//! [0]
+
+//! [1]
+class QSubWidget : public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(QString label READ label WRITE setLabel)
+
+ Q_CLASSINFO("ClassID", "{850652f4-8f71-4f69-b745-bce241ccdc30}");
+ Q_CLASSINFO("InterfaceID", "{2d76cc2f-3488-417a-83d6-debff88b3c3f}");
+ Q_CLASSINFO("ToSuperClass", "QSubWidget");
+
+public:
+ QSubWidget(QWidget *parent = nullptr, const QString &name = QString());
+
+ void setLabel(const QString &text);
+ QString label() const;
+
+ QSize sizeHint() const override;
+
+protected:
+ void paintEvent(QPaintEvent *e) override;
+
+private:
+ QString m_label;
+};
+//! [1]
+
+#endif // OBJECTS_H
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
deleted file mode 100644
index 5749606..0000000
--- a/tests/manual/manual.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += axviewer dumpcpp testcontrol
diff --git a/tests/manual/mediaplayer/CMakeLists.txt b/tests/manual/mediaplayer/CMakeLists.txt
new file mode 100644
index 0000000..6f443e7
--- /dev/null
+++ b/tests/manual/mediaplayer/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## mediaplayer Binary:
+#####################################################################
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+qt_internal_add_manual_test(tst_mediaplayer
+ SOURCES
+ mainwindow.ui
+ mediaaxwidget.h
+ main.cpp
+ INCLUDE_DIRECTORIES
+ ../shared
+ LIBRARIES
+ Qt::AxContainer
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+set_target_properties(tst_mediaplayer PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
diff --git a/examples/activeqt/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg b/tests/manual/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg
index 4839242..4839242 100644
--- a/examples/activeqt/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg
+++ b/tests/manual/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg
Binary files differ
diff --git a/examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc b/tests/manual/mediaplayer/doc/src/mediaplayer.qdoc
index 6043a6a..e6cd19b 100644
--- a/examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc
+++ b/tests/manual/mediaplayer/doc/src/mediaplayer.qdoc
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example activeqt/mediaplayer
\title Media Player Example (ActiveQt)
+ \ingroup activeqt-examples
\brief The Media Player example uses the Microsoft Media Player
ActiveX control to implement a functional media player application.
diff --git a/examples/activeqt/mediaplayer/main.cpp b/tests/manual/mediaplayer/main.cpp
index 2f84d83..bedb97f 100644
--- a/examples/activeqt/mediaplayer/main.cpp
+++ b/tests/manual/mediaplayer/main.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QApplication>
#include <QMessageBox>
@@ -173,7 +126,6 @@ void MainWindow::updateWindowTitle(const QString &state)
int main(int argc, char *argv[])
{
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
QCoreApplication::setApplicationName(QLatin1String("Active Qt Media Player"));
diff --git a/examples/activeqt/mediaplayer/mainwindow.ui b/tests/manual/mediaplayer/mainwindow.ui
index b83d392..b83d392 100644
--- a/examples/activeqt/mediaplayer/mainwindow.ui
+++ b/tests/manual/mediaplayer/mainwindow.ui
diff --git a/tests/manual/mediaplayer/mediaaxwidget.h b/tests/manual/mediaplayer/mediaaxwidget.h
new file mode 100644
index 0000000..3a49b61
--- /dev/null
+++ b/tests/manual/mediaplayer/mediaaxwidget.h
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef MEDIAAXWIDGET_H
+#define MEDIAAXWIDGET_H
+
+#include <QtAxContainer/QAxWidget>
+#include <qt_windows.h>
+
+// Overrides the translateKeyEvent() function to pass keystrokes
+// to the Windows Media Player ActiveX control.
+class MediaAxWidget : public QAxWidget
+{
+public:
+ MediaAxWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {})
+ : QAxWidget(parent, f)
+ {
+ }
+
+protected:
+ bool translateKeyEvent(int message, int keycode) const override
+ {
+ if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
+ return true;
+ return QAxWidget::translateKeyEvent(message, keycode);
+ }
+};
+
+#endif // MEDIAAXWIDGET_H
diff --git a/examples/activeqt/mediaplayer/mediaplayer.pro b/tests/manual/mediaplayer/mediaplayer.pro
index ad787a3..ad787a3 100644
--- a/examples/activeqt/mediaplayer/mediaplayer.pro
+++ b/tests/manual/mediaplayer/mediaplayer.pro
diff --git a/tests/manual/menus/CMakeLists.txt b/tests/manual/menus/CMakeLists.txt
new file mode 100644
index 0000000..a8b3899
--- /dev/null
+++ b/tests/manual/menus/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## menus Executable:
+#####################################################################
+
+set(CMAKE_AUTOMOC ON)
+
+qt_internal_add_manual_test(tst_menus
+ GUI
+ SOURCES
+ main.cpp
+ menus.cpp menus.h
+ menus.def
+ menus.rc
+ LIBRARIES
+ Qt::AxServer
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+qt_disable_warnings(tst_menus)
+qt6_target_idl(tst_menus)
diff --git a/tests/manual/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc b/tests/manual/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc
new file mode 100644
index 0000000..a889f0f
--- /dev/null
+++ b/tests/manual/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc
@@ -0,0 +1,9 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+<object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
+CODEBASE="http://www.qt-project.org/demos/menusax.cab">
+[Object not available! Did you forget to build and register the server?]
+</object>
+//! [0]
diff --git a/tests/manual/menus/doc/src/menus.qdoc b/tests/manual/menus/doc/src/menus.qdoc
new file mode 100644
index 0000000..2ed7ea1
--- /dev/null
+++ b/tests/manual/menus/doc/src/menus.qdoc
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qaxserver-demo-menus.html
+ \preliminary
+
+ \title Menubar Merging
+
+ This example is not fully functional at the moment.
+
+ \raw HTML
+ <object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
+ CODEBASE="http://www.qt-project.org/demos/menusax.cab">
+ [Object not available! Did you forget to build and register the server?]
+ </object>
+ \endraw
+*/
+
+/*!
+ \example activeqt/menus
+ \title Menus Example (ActiveQt)
+ \ingroup activeqt-examples
+
+ \brief The Menus example demonstrates the use of QMenuBar and QStatusBar
+ in a QMainWindow to implement an in-place active control.
+
+ To build the example you must first build the QAxServer library.
+ Then run \c qmake and your make tool in \c
+ examples/activeqt/menus.
+
+ The \l{qaxserver-demo-menus.html}{demonstration} requires your
+ WebBrowser to support ActiveX controls, and scripting to be
+ enabled.
+
+ \snippet activeqt/menus/doc/snippets/doc_src_examples_activeqt_menus.qdoc 0
+*/
diff --git a/examples/activeqt/menus/fileopen.xpm b/tests/manual/menus/fileopen.xpm
index 880417e..880417e 100644
--- a/examples/activeqt/menus/fileopen.xpm
+++ b/tests/manual/menus/fileopen.xpm
diff --git a/examples/activeqt/menus/filesave.xpm b/tests/manual/menus/filesave.xpm
index bd6870f..bd6870f 100644
--- a/examples/activeqt/menus/filesave.xpm
+++ b/tests/manual/menus/filesave.xpm
diff --git a/tests/manual/menus/main.cpp b/tests/manual/menus/main.cpp
new file mode 100644
index 0000000..70e84eb
--- /dev/null
+++ b/tests/manual/menus/main.cpp
@@ -0,0 +1,26 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "menus.h"
+#include <QApplication>
+#include <QAxFactory>
+#include <QScopedPointer>
+
+QAXFACTORY_BEGIN(
+ "{ce947ee3-0403-4fdc-895a-4fe779394b46}", // type library ID
+ "{8de435ce-8d2a-46ac-b3b3-cb800d0847c7}") // application ID
+ QAXCLASS(QMenus)
+QAXFACTORY_END()
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ QScopedPointer<QWidget> window;
+
+ if (!QAxFactory::isServer()) {
+ window.reset(new QMenus());
+ window->show();
+ }
+
+ return a.exec();
+}
diff --git a/examples/activeqt/menus/menus.cpp b/tests/manual/menus/menus.cpp
index 18d1a5b..3093862 100644
--- a/examples/activeqt/menus/menus.cpp
+++ b/tests/manual/menus/menus.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "menus.h"
#include <QAction>
diff --git a/examples/activeqt/menus/menus.def b/tests/manual/menus/menus.def
index bc82a03..bc82a03 100644
--- a/examples/activeqt/menus/menus.def
+++ b/tests/manual/menus/menus.def
diff --git a/tests/manual/menus/menus.h b/tests/manual/menus/menus.h
new file mode 100644
index 0000000..b21a9c3
--- /dev/null
+++ b/tests/manual/menus/menus.h
@@ -0,0 +1,41 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef MENUS_H
+#define MENUS_H
+
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+class QTextEdit;
+QT_END_NAMESPACE
+
+class QMenus : public QMainWindow
+{
+ Q_OBJECT
+ Q_CLASSINFO("ClassID", "{4dc3f340-a6f7-44e4-a79b-3e9217695fbd}")
+ Q_CLASSINFO("InterfaceID", "{9ee49617-7d5c-441a-b833-4b068d40d751}")
+ Q_CLASSINFO("EventsID", "{13eca64b-ee2a-4f3c-aa04-5d9d975979a7}")
+
+public:
+ explicit QMenus(QWidget *parent = nullptr);
+
+public slots:
+ void fileOpen();
+ void fileSave();
+
+ void editNormal();
+ void editBold();
+ void editUnderline();
+
+ void editAdvancedFont();
+ void editAdvancedStyle();
+
+ void helpAbout();
+ void helpAboutQt();
+
+private:
+ QTextEdit *m_editor;
+};
+
+#endif // MENUS_H
diff --git a/examples/activeqt/menus/menus.ico b/tests/manual/menus/menus.ico
index c80d36a..c80d36a 100644
--- a/examples/activeqt/menus/menus.ico
+++ b/tests/manual/menus/menus.ico
Binary files differ
diff --git a/examples/activeqt/menus/menus.inf b/tests/manual/menus/menus.inf
index f97efe8..f97efe8 100644
--- a/examples/activeqt/menus/menus.inf
+++ b/tests/manual/menus/menus.inf
diff --git a/examples/activeqt/menus/menus.pro b/tests/manual/menus/menus.pro
index f5a7890..f5a7890 100644
--- a/examples/activeqt/menus/menus.pro
+++ b/tests/manual/menus/menus.pro
diff --git a/examples/activeqt/menus/menus.rc b/tests/manual/menus/menus.rc
index d466b35..d466b35 100644
--- a/examples/activeqt/menus/menus.rc
+++ b/tests/manual/menus/menus.rc
diff --git a/tests/manual/multiple/CMakeLists.txt b/tests/manual/multiple/CMakeLists.txt
new file mode 100644
index 0000000..8e5d7c7
--- /dev/null
+++ b/tests/manual/multiple/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## multiple Binary:
+#####################################################################
+
+set(CMAKE_AUTOMOC ON)
+
+qt_internal_add_manual_test(tst_multiple
+ GUI
+ SOURCES
+ ax1.h
+ ax2.h
+ main.cpp
+ multipleax.def
+ multipleax.rc
+ LIBRARIES
+ Qt::AxServer
+ Qt::Gui
+ Qt::Widgets
+
+)
+# qt_disable_warnings(tst_multiple)
+qt6_target_idl(tst_multiple)
diff --git a/tests/manual/multiple/ax1.h b/tests/manual/multiple/ax1.h
new file mode 100644
index 0000000..e3a7b10
--- /dev/null
+++ b/tests/manual/multiple/ax1.h
@@ -0,0 +1,50 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef AX1_H
+#define AX1_H
+
+#include <QWidget>
+#include <QPainter>
+
+//! [0]
+class QAxWidget1 : public QWidget
+{
+ Q_OBJECT
+ Q_CLASSINFO("ClassID", "{1D9928BD-4453-4bdd-903D-E525ED17FDE5}")
+ Q_CLASSINFO("InterfaceID", "{99F6860E-2C5A-42ec-87F2-43396F4BE389}")
+ Q_CLASSINFO("EventsID", "{0A3E9F27-E4F1-45bb-9E47-63099BCCD0E3}")
+
+ Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor)
+public:
+ explicit QAxWidget1(QWidget *parent = nullptr)
+ : QWidget(parent)
+ {
+ }
+
+ QColor fillColor() const
+ {
+ return m_fillColor;
+ }
+
+ void setFillColor(const QColor &fc)
+ {
+ m_fillColor = fc;
+ repaint();
+ }
+
+protected:
+ void paintEvent(QPaintEvent *e) override
+ {
+ QPainter paint(this);
+ QRect r = rect();
+ r.adjust(10, 10, -10, -10);
+ paint.fillRect(r, m_fillColor);
+ }
+
+private:
+ QColor m_fillColor = Qt::red;
+};
+//! [0]
+
+#endif // AX1_H
diff --git a/tests/manual/multiple/ax2.h b/tests/manual/multiple/ax2.h
new file mode 100644
index 0000000..0509a12
--- /dev/null
+++ b/tests/manual/multiple/ax2.h
@@ -0,0 +1,54 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef AX2_H
+#define AX2_H
+
+#include <QWidget>
+#include <QPainter>
+
+//! [0]
+class QAxWidget2 : public QWidget
+{
+ Q_OBJECT
+ Q_CLASSINFO("ClassID", "{58139D56-6BE9-4b17-937D-1B1EDEDD5B71}")
+ Q_CLASSINFO("InterfaceID", "{B66280AB-08CC-4dcc-924F-58E6D7975B7D}")
+ Q_CLASSINFO("EventsID", "{D72BACBA-03C4-4480-B4BB-DE4FE3AA14A0}")
+ Q_CLASSINFO("ToSuperClass", "QAxWidget2")
+ Q_CLASSINFO("StockEvents", "yes")
+ Q_CLASSINFO("Insertable", "yes")
+
+ Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
+public:
+ using QWidget::QWidget;
+
+ int lineWidth() const
+ {
+ return m_lineWidth;
+ }
+
+ void setLineWidth(int lw)
+ {
+ m_lineWidth = lw;
+ repaint();
+ }
+
+protected:
+ void paintEvent(QPaintEvent *e) override
+ {
+ QPainter paint(this);
+ QPen pen = paint.pen();
+ pen.setWidth(m_lineWidth);
+ paint.setPen(pen);
+
+ QRect r = rect();
+ r.adjust(10, 10, -10, -10);
+ paint.drawEllipse(r);
+ }
+
+private:
+ int m_lineWidth = 1;
+};
+//! [0]
+
+#endif // AX2_H
diff --git a/examples/activeqt/multiple/doc/src/multiple.qdoc b/tests/manual/multiple/doc/src/multiple.qdoc
index bf9c832..95e587c 100644
--- a/examples/activeqt/multiple/doc/src/multiple.qdoc
+++ b/tests/manual/multiple/doc/src/multiple.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qaxserver-demo-multiple.html
@@ -35,6 +11,7 @@
/*!
\example activeqt/multiple
\title Multiple Example (ActiveQt)
+ \ingroup activeqt-examples
\brief The Multiple example demonstrates the implementation of a
QAxFactory to provide multiple ActiveX controls in a single in
diff --git a/tests/manual/multiple/main.cpp b/tests/manual/multiple/main.cpp
new file mode 100644
index 0000000..6ce4346
--- /dev/null
+++ b/tests/manual/multiple/main.cpp
@@ -0,0 +1,15 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+#include "ax1.h"
+#include "ax2.h"
+#include <QAxFactory>
+
+QT_USE_NAMESPACE
+
+QAXFACTORY_BEGIN("{98DE28B6-6CD3-4e08-B9FA-3D1DB43F1D2F}", "{05828915-AD1C-47ab-AB96-D6AD1E25F0E2}")
+ QAXCLASS(QAxWidget1)
+ QAXCLASS(QAxWidget2)
+QAXFACTORY_END()
+//! [0]
diff --git a/examples/activeqt/multiple/multiple.inf b/tests/manual/multiple/multiple.inf
index 7f6be76..7f6be76 100644
--- a/examples/activeqt/multiple/multiple.inf
+++ b/tests/manual/multiple/multiple.inf
diff --git a/examples/activeqt/multiple/multiple.pro b/tests/manual/multiple/multiple.pro
index f08d3a2..f08d3a2 100644
--- a/examples/activeqt/multiple/multiple.pro
+++ b/tests/manual/multiple/multiple.pro
diff --git a/examples/activeqt/multiple/multipleax.def b/tests/manual/multiple/multipleax.def
index bc82a03..bc82a03 100644
--- a/examples/activeqt/multiple/multipleax.def
+++ b/tests/manual/multiple/multipleax.def
diff --git a/examples/activeqt/multiple/multipleax.ico b/tests/manual/multiple/multipleax.ico
index c80d36a..c80d36a 100644
--- a/examples/activeqt/multiple/multipleax.ico
+++ b/tests/manual/multiple/multipleax.ico
Binary files differ
diff --git a/examples/activeqt/multiple/multipleax.rc b/tests/manual/multiple/multipleax.rc
index a9bcc1a..a9bcc1a 100644
--- a/examples/activeqt/multiple/multipleax.rc
+++ b/tests/manual/multiple/multipleax.rc
diff --git a/tests/manual/opengl/CMakeLists.txt b/tests/manual/opengl/CMakeLists.txt
new file mode 100644
index 0000000..e8e4255
--- /dev/null
+++ b/tests/manual/opengl/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## testcontrol Binary:
+#####################################################################
+
+set(CMAKE_AUTOMOC ON)
+
+qt_internal_add_manual_test(tst_opengl
+ GUI
+ SOURCES
+ glbox.cpp glbox.h
+ globjwin.cpp globjwin.h
+ main.cpp
+ opengl.def
+ opengl.rc
+ LIBRARIES
+ Qt::AxServer
+ Qt::Gui
+ Qt::OpenGL
+ Qt::OpenGLWidgets
+ Qt::Widgets
+)
+
+# qt_disable_warnings(tst_opengl)
+qt6_target_idl(tst_opengl)
diff --git a/examples/activeqt/opengl/doc/src/opengl.qdoc b/tests/manual/opengl/doc/src/opengl.qdoc
index 000d864..b95e89d 100644
--- a/examples/activeqt/opengl/doc/src/opengl.qdoc
+++ b/tests/manual/opengl/doc/src/opengl.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qaxserver-demo-opengl.html
@@ -60,6 +36,7 @@
/*!
\example activeqt/opengl
\title OpenGL Example (ActiveQt)
+ \ingroup activeqt-examples
\brief The OpenGL example demonstrates the use of the default factory
and QAxFactory::isServer(), and the implementation of an
diff --git a/examples/activeqt/opengl/glbox.cpp b/tests/manual/opengl/glbox.cpp
index 3694bd8..3388670 100644
--- a/examples/activeqt/opengl/glbox.cpp
+++ b/tests/manual/opengl/glbox.cpp
@@ -1,52 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
/****************************************************************************
**
diff --git a/tests/manual/opengl/glbox.h b/tests/manual/opengl/glbox.h
new file mode 100644
index 0000000..a1b58da
--- /dev/null
+++ b/tests/manual/opengl/glbox.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+/****************************************************************************
+**
+** This is a simple QGLWidget displaying an openGL wireframe box
+**
+****************************************************************************/
+
+#ifndef GLBOX_H
+#define GLBOX_H
+
+#include <QOpenGLWidget>
+#include <QOpenGLFunctions_1_1>
+//! [0]
+#include <QAxBindable>
+
+class GLBox : public QOpenGLWidget,
+ public QOpenGLFunctions_1_1,
+ public QAxBindable
+{
+ Q_OBJECT
+ Q_CLASSINFO("ClassID", "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}")
+ Q_CLASSINFO("InterfaceID", "{33b051af-bb25-47cf-a390-5cfd2987d26a}")
+ Q_CLASSINFO("EventsID", "{8c996c29-eafa-46ac-a6f9-901951e765b5}")
+ //! [0] //! [1]
+
+public:
+ explicit GLBox(QWidget *parent, const char *name = nullptr);
+ virtual ~GLBox();
+ QAxAggregated *createAggregate() override;
+
+public slots:
+ void setXRotation(int degrees);
+//! [1]
+ void setYRotation(int degrees);
+ void setZRotation(int degrees);
+
+protected:
+ void initializeGL() override;
+ void paintGL() override;
+ void resizeGL(int w, int h) override;
+ virtual GLuint makeObject();
+
+private:
+ GLuint m_object = 0;
+ GLdouble m_xRot = 0;
+ GLdouble m_yRot = 0;
+ GLdouble m_zRot = 0;
+ GLdouble m_scale = 1.25;
+};
+
+#endif // GLBOX_H
diff --git a/tests/manual/opengl/globjwin.cpp b/tests/manual/opengl/globjwin.cpp
new file mode 100644
index 0000000..0b9cea1
--- /dev/null
+++ b/tests/manual/opengl/globjwin.cpp
@@ -0,0 +1,72 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "globjwin.h"
+#include "glbox.h"
+#include <QPushButton>
+#include <QSlider>
+#include <QLayout>
+#include <QFrame>
+#include <QMenuBar>
+#include <QMenu>
+#include <QApplication>
+
+
+GLObjectWindow::GLObjectWindow(QWidget *parent)
+ : QWidget(parent)
+{
+ // Create a menu
+ QMenu *file = new QMenu(this);
+ file->addAction(tr("Exit"), qApp, &QApplication::quit);
+
+ // Create a menu bar
+ QMenuBar *m = new QMenuBar(this);
+ m->addMenu(file)->setText(tr("&File"));
+
+ // Create a nice frame to put around the OpenGL widget
+ QFrame *f = new QFrame(this);
+ f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
+ f->setLineWidth(2);
+
+ // Create our OpenGL widget
+ GLBox *c = new GLBox(f, "glbox");
+
+ // Create the three sliders; one for each rotation axis
+ QSlider *x = new QSlider(Qt::Vertical, this);
+ x->setMaximum(360);
+ x->setPageStep(60);
+ x->setTickPosition(QSlider::TicksLeft);
+ connect(x, &QSlider::valueChanged, c, &GLBox::setXRotation);
+
+ QSlider *y = new QSlider(Qt::Vertical, this);
+ y->setMaximum(360);
+ y->setPageStep(60);
+ y->setTickPosition(QSlider::TicksLeft);
+ connect(y, &QSlider::valueChanged, c, &GLBox::setYRotation);
+
+ QSlider *z = new QSlider(Qt::Vertical, this);
+ z->setMaximum(360);
+ z->setPageStep(60);
+ z->setTickPosition(QSlider::TicksLeft);
+ connect(z, &QSlider::valueChanged, c, &GLBox::setZRotation);
+
+ // Now that we have all the widgets, put them into a nice layout
+
+ // Top level layout, puts the sliders to the left of the frame/GL widget
+ QHBoxLayout *hlayout = new QHBoxLayout(this);
+
+ // Put the sliders on top of each other
+ QVBoxLayout *vlayout = new QVBoxLayout();
+ vlayout->addWidget(x);
+ vlayout->addWidget(y);
+ vlayout->addWidget(z);
+
+ // Put the GL widget inside the frame
+ QHBoxLayout *flayout = new QHBoxLayout(f);
+ flayout->setContentsMargins(0, 0, 0, 0);
+ flayout->addWidget(c, 1);
+
+ hlayout->setMenuBar(m);
+ hlayout->addLayout(vlayout);
+ hlayout->addWidget(f, 1);
+}
diff --git a/tests/manual/opengl/globjwin.h b/tests/manual/opengl/globjwin.h
new file mode 100644
index 0000000..58ff614
--- /dev/null
+++ b/tests/manual/opengl/globjwin.h
@@ -0,0 +1,24 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+/****************************************************************************
+**
+** The GLObjectWindow contains a GLBox and three sliders connected to
+** the GLBox's rotation slots.
+**
+****************************************************************************/
+
+#ifndef GLOBJWIN_H
+#define GLOBJWIN_H
+
+#include <qwidget.h>
+
+class GLObjectWindow : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit GLObjectWindow(QWidget *parent = nullptr);
+};
+
+#endif
diff --git a/tests/manual/opengl/main.cpp b/tests/manual/opengl/main.cpp
new file mode 100644
index 0000000..2f78324
--- /dev/null
+++ b/tests/manual/opengl/main.cpp
@@ -0,0 +1,49 @@
+// Copyright (C) 2015 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//
+// Qt OpenGL example: Box
+//
+// A small example showing how a GLWidget can be used just as any Qt widget
+//
+// File: main.cpp
+//
+// The main() function
+//
+
+#include "globjwin.h"
+#include "glbox.h"
+#include <QApplication>
+//! [0]
+#include <QAxFactory>
+
+QAXFACTORY_BEGIN(
+ "{2c3c183a-eeda-41a4-896e-3d9c12c3577d}", // type library ID
+ "{83e16271-6480-45d5-aaf1-3f40b7661ae4}") // application ID
+ QAXCLASS(GLBox)
+QAXFACTORY_END()
+
+//! [0] //! [1]
+/*
+ The main program is here.
+*/
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc,argv);
+
+ if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL) {
+ qWarning("This system does not support OpenGL. Exiting.");
+ return -1;
+ }
+
+ if (!QAxFactory::isServer()) {
+ GLObjectWindow w;
+ w.resize(400, 350);
+ w.show();
+ return a.exec();
+//! [1] //! [2]
+ }
+ return a.exec();
+//! [2] //! [3]
+}
+//! [3]
diff --git a/examples/activeqt/opengl/opengl.def b/tests/manual/opengl/opengl.def
index bc82a03..bc82a03 100644
--- a/examples/activeqt/opengl/opengl.def
+++ b/tests/manual/opengl/opengl.def
diff --git a/examples/activeqt/opengl/opengl.ico b/tests/manual/opengl/opengl.ico
index c80d36a..c80d36a 100644
--- a/examples/activeqt/opengl/opengl.ico
+++ b/tests/manual/opengl/opengl.ico
Binary files differ
diff --git a/examples/activeqt/opengl/opengl.inf b/tests/manual/opengl/opengl.inf
index 4a79e67..4a79e67 100644
--- a/examples/activeqt/opengl/opengl.inf
+++ b/tests/manual/opengl/opengl.inf
diff --git a/examples/activeqt/opengl/opengl.pro b/tests/manual/opengl/opengl.pro
index 1ece9b9..1ece9b9 100644
--- a/examples/activeqt/opengl/opengl.pro
+++ b/tests/manual/opengl/opengl.pro
diff --git a/examples/activeqt/opengl/opengl.rc b/tests/manual/opengl/opengl.rc
index 02c0898..02c0898 100644
--- a/examples/activeqt/opengl/opengl.rc
+++ b/tests/manual/opengl/opengl.rc
diff --git a/tests/manual/shared/metaobjectdump.cpp b/tests/manual/shared/metaobjectdump.cpp
index 2eaec84..0d437b5 100644
--- a/tests/manual/shared/metaobjectdump.cpp
+++ b/tests/manual/shared/metaobjectdump.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "metaobjectdump.h"
diff --git a/tests/manual/shared/metaobjectdump.h b/tests/manual/shared/metaobjectdump.h
index b3bde57..2e8363b 100644
--- a/tests/manual/shared/metaobjectdump.h
+++ b/tests/manual/shared/metaobjectdump.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef METAOBJECTDUMP_H
#define METAOBJECTDUMP_H
diff --git a/tests/manual/shared/shared.pri b/tests/manual/shared/shared.pri
deleted file mode 100644
index ffd18b3..0000000
--- a/tests/manual/shared/shared.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES += $$PWD/metaobjectdump.cpp $$PWD/textdialog.cpp
-HEADERS += $$PWD/metaobjectdump.h $$PWD/textdialog.h
-INCLUDEPATH += $$PWD
diff --git a/tests/manual/shared/textdialog.cpp b/tests/manual/shared/textdialog.cpp
index f8ad7fc..399ceec 100644
--- a/tests/manual/shared/textdialog.cpp
+++ b/tests/manual/shared/textdialog.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "textdialog.h"
diff --git a/tests/manual/shared/textdialog.h b/tests/manual/shared/textdialog.h
index 74bfaf5..e4aeca6 100644
--- a/tests/manual/shared/textdialog.h
+++ b/tests/manual/shared/textdialog.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtWidgets/QDialog>
diff --git a/tests/manual/testcontrol/CMakeLists.txt b/tests/manual/testcontrol/CMakeLists.txt
index 3115e4d..78e410c 100644
--- a/tests/manual/testcontrol/CMakeLists.txt
+++ b/tests/manual/testcontrol/CMakeLists.txt
@@ -1,20 +1,19 @@
-# Generated from testcontrol.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## testcontrol Binary:
#####################################################################
-qt_add_executable(testcontrol
+qt_internal_add_manual_test(tst_testcontrol_manual
GUI
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ testcontrol.rc
+ LIBRARIES
Qt::AxServer
Qt::Gui
Qt::Widgets
)
-qt_disable_warnings(testcontrol)
-
-#### Keys ignored in scope 1:.:.:testcontrol.pro:<TRUE>:
-# RC_FILE = "testcontrol.rc"
-# TEMPLATE = "app"
+qt_disable_warnings(tst_testcontrol_manual)
+qt6_target_idl(tst_testcontrol_manual)
diff --git a/tests/manual/testcontrol/main.cpp b/tests/manual/testcontrol/main.cpp
index bedd265..f4fa554 100644
--- a/tests/manual/testcontrol/main.cpp
+++ b/tests/manual/testcontrol/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtAxServer/QAxFactory>
#include <QtGui/QAction>
diff --git a/tests/manual/testcontrol/testcontrol.pro b/tests/manual/testcontrol/testcontrol.pro
deleted file mode 100644
index 30a0b48..0000000
--- a/tests/manual/testcontrol/testcontrol.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-QT += widgets axserver
-TARGET = testcontrol
-TEMPLATE = app
-SOURCES += main.cpp
-CONFIG += warn_off
-RC_FILE = testcontrol.rc
diff --git a/tests/tests.pro b/tests/tests.pro
deleted file mode 100644
index 157ef34..0000000
--- a/tests/tests.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += auto
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index c41b17e..bfbe5fd 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,5 +1,5 @@
-# Generated from tools.pro.
-
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
qt_exclude_tool_directories_from_default_target(
testcon
diff --git a/tools/dumpcpp/CMakeLists.txt b/tools/dumpcpp/CMakeLists.txt
index 6c13386..571f830 100644
--- a/tools/dumpcpp/CMakeLists.txt
+++ b/tools/dumpcpp/CMakeLists.txt
@@ -1,23 +1,24 @@
-# Generated from dumpcpp.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## dumpcpp Tool:
#####################################################################
-qt_add_tool(dumpcpp
- TOOLS_TARGET AxContainer # special case
+qt_get_tool_target_name(target_name dumpcpp)
+qt_internal_add_tool(${target_name}
+ TARGET_DESCRIPTION "Active Qt DumpCpp"
+ TOOLS_TARGET AxContainer
SOURCES
main.cpp
moc.cpp moc.h
DEFINES
QT_ASCII_CAST_WARNINGS
QT_NO_CAST_TO_ASCII
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::CorePrivate
Qt::Gui
Qt::Widgets
)
-
-#### Keys ignored in scope 1:.:.:dumpcpp.pro:<TRUE>:
-# QMAKE_TARGET_DESCRIPTION = "Active Qt DumpCpp"
+qt_internal_return_unless_building_tools()
diff --git a/tools/dumpcpp/dumpcpp.pro b/tools/dumpcpp/dumpcpp.pro
deleted file mode 100644
index 5b56cea..0000000
--- a/tools/dumpcpp/dumpcpp.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += axcontainer widgets core-private
-DEFINES += QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
-
-SOURCES = main.cpp moc.cpp
-HEADERS += moc.h
-
-QMAKE_TARGET_DESCRIPTION = "Active Qt DumpCpp"
-load(qt_tool)
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index e8c2ffd..1b6fbeb 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -1,34 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "moc.h"
#include <QAxObject>
+#include <QAxBaseWidget>
#include <QFile>
#include <QMetaObject>
#include <QMetaEnum>
@@ -41,7 +17,6 @@
#include <QCoreApplication>
#include <QCommandLineOption>
#include <QCommandLineParser>
-#include <QWidget>
#include <QFileInfo>
#include <qt_windows.h>
#include <ocidl.h>
@@ -75,6 +50,7 @@ extern QMetaObject *qax_readEnumInfo(ITypeLib *typeLib, const QMetaObject *paren
extern QMetaObject *qax_readClassInfo(ITypeLib *typeLib, ITypeInfo *typeInfo, const QMetaObject *parentObject);
extern QMetaObject *qax_readInterfaceInfo(ITypeLib *typeLib, ITypeInfo *typeInfo, const QMetaObject *parentObject);
extern QByteArrayList qax_qualified_usertypes;
+extern QHash<QByteArray, QByteArray> qax_enum_values;
extern QString qax_docuFromName(ITypeInfo *typeInfo, const QString &name);
extern bool qax_dispatchEqualsIDispatch;
extern void qax_deleteMetaObject(QMetaObject *mo);
@@ -124,9 +100,9 @@ void generateNameSpace(QTextStream &out, const QMetaObject *mo, const QByteArray
static QByteArray joinParameterNames(const QByteArrayList &parameterNames)
{
QByteArray slotParameters;
- for (int p = 0; p < parameterNames.count(); ++p) {
+ for (qsizetype p = 0; p < parameterNames.size(); ++p) {
slotParameters += parameterNames.at(p);
- if (p < parameterNames.count() - 1)
+ if (p < parameterNames.size() - 1)
slotParameters += ',';
}
@@ -180,8 +156,16 @@ static void formatConstructorSignature(QTextStream &out, ObjectCategories catego
static void formatConstructorBody(QTextStream &out, const QByteArray &nameSpace,
const QByteArray &className,
- const QString &controlID, ObjectCategories category)
+ const QString &controlID, ObjectCategories category, bool useControlName)
{
+ QString controlName;
+ if (useControlName) {
+ if (!nameSpace.isEmpty())
+ controlName = QString::fromUtf8(nameSpace) + QStringLiteral(".");
+ controlName += QString::fromUtf8(className);
+ } else {
+ controlName = controlID;
+ }
if (!nameSpace.isEmpty())
out << nameSpace << "::";
out << className << "::" << className;
@@ -198,15 +182,21 @@ static void formatConstructorBody(QTextStream &out, const QByteArray &nameSpace,
out << " internalRelease();" << Qt::endl;
} else if (category & Licensed) {
out << " if (licenseKey.isEmpty())" << Qt::endl;
- out << " setControl(QStringLiteral(\"" << controlID << "\"));" << Qt::endl;
+ out << " setControl(QStringLiteral(\"" << controlName << "\"));" << Qt::endl;
out << " else" << Qt::endl;
- out << " setControl(QStringLiteral(\"" << controlID << ":\") + licenseKey);" << Qt::endl;
+ out << " setControl(QStringLiteral(\"" << controlName << ":\") + licenseKey);" << Qt::endl;
} else {
- out << " setControl(QStringLiteral(\"" << controlID << "\"));" << Qt::endl;
+ out << " setControl(QStringLiteral(\"" << controlName << "\"));" << Qt::endl;
}
out << '}' << Qt::endl << Qt::endl;
}
+// Hash of C# only types.
+static const QSet<QByteArray> cSharpTypes = {
+ "ICloneable", "ICollection", "IDisposable", "IEnumerable",
+ "IList", "ISerializable", "_Attribute"
+};
+
void generateClassDecl(QTextStream &out, const QMetaObject *mo,
const QByteArray &className, const QByteArray &nameSpace,
ObjectCategories category)
@@ -237,6 +227,11 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
continue;
QByteArray iface_class = info.value();
+ if (cSharpTypes.contains(iface_class)) {
+ qWarning("Skipping constructor %s(%s *) (C#-only type).",
+ className.constData(), iface_class.constData());
+ continue;
+ }
out << " " << className << '(' << iface_class << " *iface)" << Qt::endl;
@@ -319,28 +314,28 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
if (qax_qualified_usertypes.contains(simplePropType)) {
if (foreignNamespace)
out << "#ifdef QAX_DUMPCPP_" << propertyType.left(propertyType.indexOf("::")).toUpper() << "_H" << Qt::endl;
- out << indent << " " << propertyType << " qax_pointer = 0;" << Qt::endl;
QByteArray simplePropTypeWithNamespace = propertyType;
simplePropTypeWithNamespace.replace('*', "");
- out << indent << " qRegisterMetaType<" << propertyType << ">(\"" << property.typeName() << "\", &qax_pointer);" << Qt::endl;
- out << indent << " qRegisterMetaType<" << simplePropTypeWithNamespace << ">(\"" << simplePropType << "\", qax_pointer);" << Qt::endl;
+ out << indent << " qRegisterMetaType<" << propertyType << ">(\"" << property.typeName() << "\");" << Qt::endl;
+ out << indent << " qRegisterMetaType<" << simplePropTypeWithNamespace << ">(\"" << simplePropType << "\");" << Qt::endl;
}
out << indent << " QVariant qax_result = property(\"" << propertyName << "\");" << Qt::endl;
if (propertyType.length() && propertyType.at(propertyType.length()-1) == '*')
- out << indent << " if (!qax_result.constData()) return 0;" << Qt::endl;
- out << indent << " Q_ASSERT(qax_result.isValid());" << Qt::endl;
+ out << indent << " if (qax_result.constData() == nullptr)\n"
+ << indent << " return nullptr;\n"
+ << indent << " Q_ASSERT(qax_result.isValid());" << Qt::endl;
if (qax_qualified_usertypes.contains(simplePropType)) {
simplePropType = propertyType;
simplePropType.replace('*', "");
- out << indent << " return *(" << propertyType << "*)qax_result.constData();" << Qt::endl;
+ out << indent << " return *reinterpret_cast<" << propertyType << "*>(qax_result.data());\n";
if (foreignNamespace) {
out << "#else" << Qt::endl;
- out << indent << " return 0; // foreign namespace not included" << Qt::endl;
+ out << indent << " return nullptr; // foreign namespace not included" << Qt::endl;
out << "#endif" << Qt::endl;
}
} else {
- out << indent << " return *(" << propertyType << "*)qax_result.constData();" << Qt::endl;
+ out << indent << " return *reinterpret_cast<" << propertyType << "*>(qax_result.data());\n";
}
out << indent << '}' << Qt::endl;
} else {
@@ -360,8 +355,8 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
if (!(category & NoInlines)) {
if (propertyType.endsWith('*')) {
out << '{' << Qt::endl;
- out << " int typeId = qRegisterMetaType<" << propertyType << ">(\"" << propertyType << "\", &value);" << Qt::endl;
- out << " setProperty(\"" << propertyName << "\", QVariant(typeId, &value));" << Qt::endl;
+ out << " int typeId = qRegisterMetaType<" << propertyType << ">(\"" << propertyType << "\");" << Qt::endl;
+ out << " setProperty(\"" << propertyName << "\", QVariant(QMetaType(typeId), &value));" << Qt::endl;
out << '}' << Qt::endl;
} else {
out << "{ setProperty(\"" << propertyName << "\", QVariant(value)); }" << Qt::endl;
@@ -427,19 +422,19 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
const auto signatureSplit = slotSignatureTruncated.split(',');
QByteArrayList parameterSplit;
if (slotParameters.isEmpty()) { // generate parameter names
- for (int i = 0; i < signatureSplit.count(); ++i)
+ for (qsizetype i = 0; i < signatureSplit.size(); ++i)
parameterSplit << QByteArray("p") + QByteArray::number(i);
} else {
parameterSplit = slotParameters.split(',');
}
- for (int i = 0; i < signatureSplit.count(); ++i) {
+ for (qsizetype i = 0; i < signatureSplit.count(); ++i) {
QByteArray parameterType = signatureSplit.at(i);
if (!parameterType.contains("::") && namespaceForType.contains(parameterType))
parameterType.prepend(namespaceForType.value(parameterType) + "::");
QByteArray arraySpec; // transform array method signature "foo(int[4])" ->"foo(int p[4])"
- const int arrayPos = parameterType.lastIndexOf('[');
+ const qsizetype arrayPos = parameterType.lastIndexOf('[');
if (arrayPos != -1) {
arraySpec = parameterType.right(parameterType.size() - arrayPos);
parameterType.truncate(arrayPos);
@@ -448,11 +443,11 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
slotNamedSignature += ' ';
slotNamedSignature += parameterSplit.at(i);
slotNamedSignature += arraySpec;
- if (defaultArguments >= signatureSplit.count() - i) {
+ if (defaultArguments >= signatureSplit.size() - i) {
slotNamedSignature += " = ";
slotNamedSignature += parameterType + "()";
}
- if (i + 1 < signatureSplit.count())
+ if (i + 1 < signatureSplit.size())
slotNamedSignature += ", ";
}
slotNamedSignature += ')';
@@ -496,9 +491,9 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
out << "#ifdef QAX_DUMPCPP_" << simpleSlotType.left(simpleSlotType.indexOf(':')).toUpper() << "_H" << Qt::endl;
QByteArray simpleSlotTypeWithNamespace = slotType;
simpleSlotTypeWithNamespace.replace('*', "");
- out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << "*>(\"" << simpleSlotType << "*\", &qax_result);" << Qt::endl;
+ out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << "*>(\"" << simpleSlotType << "*\");" << Qt::endl;
if (!vTableOnlyStubs.contains(simpleSlotTypeWithNamespace))
- out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << ">(\"" << simpleSlotType << "\", qax_result);" << Qt::endl;
+ out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << ">(\"" << simpleSlotType << "\");" << Qt::endl;
if (foreignNamespace)
out << "#endif" << Qt::endl;
}
@@ -539,26 +534,65 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo,
bool generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray &className,
const QString &controlID,
const QByteArray &nameSpace, ObjectCategories category,
+ bool useControlName,
QString *errorString)
{
- Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 9, "dumpcpp should generate the same version as moc");
+ Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 12, "dumpcpp should generate the same version as moc");
QByteArray qualifiedClassName;
if (!nameSpace.isEmpty())
qualifiedClassName = nameSpace + "::";
qualifiedClassName += className;
+ const QByteArray nestedQualifier = className + "::";
- const QString moCode = mocCode(mo, QLatin1String(qualifiedClassName),
- category.testFlag(ActiveX) ? QLatin1String("QWidget") : QLatin1String("QObject"),
- errorString);
+ QString moCode = mocCode(mo, QLatin1String(qualifiedClassName), errorString);
if (moCode.isEmpty()) {
out << "#error moc error\n";
return false;
}
+ // Postprocess the moc output to fully qualify types. This works around moc
+ // not having any semantic type information, and a fix for QTBUG-100145.
+ constexpr QStringView typeAndForceComplete(u"QtPrivate::TypeAndForceComplete<");
+ qsizetype nextTypeAndForceComplete = 0;
+ do {
+ nextTypeAndForceComplete = moCode.indexOf(typeAndForceComplete, nextTypeAndForceComplete);
+ if (nextTypeAndForceComplete == -1)
+ break;
+ const auto startType = nextTypeAndForceComplete + typeAndForceComplete.length();
+ const auto lengthType = moCode.indexOf(u',', startType) - startType;
+ if (lengthType == -1)
+ break;
+
+ QString type = moCode.sliced(startType, lengthType);
+ if (type.endsWith(u'*'))
+ type.chop(1);
+ type = type.trimmed();
+
+ // If ActiveQt thinks it's a nested type within the class, but it really is a type in the
+ // namespace, then we need to replace the nested type qualifier with the real namespace.
+ const bool isNestedType = type.startsWith(QString::fromUtf8(nestedQualifier));
+ auto namespaceForTypeEntry = namespaceForType.constEnd();
+ if (isNestedType) {
+ const QString rawType = type.mid(nestedQualifier.length());
+ namespaceForTypeEntry = namespaceForType.constFind(rawType.toUtf8());
+ if (namespaceForTypeEntry != namespaceForType.constEnd()) {
+ moCode.remove(startType, nestedQualifier.length());
+ type = rawType;
+ }
+ }
+ if (namespaceForTypeEntry == namespaceForType.constEnd())
+ namespaceForTypeEntry = namespaceForType.constFind(type.toUtf8());
+ if (namespaceForTypeEntry != namespaceForType.constEnd()) {
+ const auto ns = QString::fromUtf8(namespaceForTypeEntry.value());
+ moCode.insert(startType, ns + QStringView(u"::"));
+ }
+ nextTypeAndForceComplete = startType + lengthType;
+ } while (true);
+
out << moCode << "\n\n";
- formatConstructorBody(out, nameSpace, className, controlID, category);
+ formatConstructorBody(out, nameSpace, className, controlID, category, useControlName);
return true;
}
@@ -602,21 +636,15 @@ static QByteArrayList vTableOnlyStubsFromTypeLib(ITypeLib *typelib, const QStrin
return result;
}
-static void writeForwardDeclaration(QTextStream &declOut, const QByteArray &className)
+static const QMetaObject *baseMetaObject(ObjectCategories c)
{
- if (className.startsWith("enum ")) {
- declOut << "#ifndef Q_CC_MINGW\n"
- << " " << className << ';' << Qt::endl // Only MSVC accepts this
- << "#else\n"
- << " " << className << " {};" << Qt::endl
- << "#endif\n";
- } else {
- declOut << " " << className << ';' << Qt::endl;
- }
+ return c.testFlag(ActiveX)
+ ? &QAxBaseWidget::staticMetaObject
+ : &QAxBaseObject::staticMetaObject;
}
bool generateTypeLibrary(QString typeLibFile, QString outname,
- const QString &nameSpace, ObjectCategories category)
+ const QString &nameSpace, ObjectCategories category, bool useControlName)
{
typeLibFile.replace(QLatin1Char('/'), QLatin1Char('\\'));
@@ -726,16 +754,10 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
// trigger meta object to collect references to other type libraries
switch (typekind) {
case TKIND_COCLASS:
- if (category & ActiveX)
- metaObject = qax_readClassInfo(typelib, typeinfo, &QWidget::staticMetaObject);
- else
- metaObject = qax_readClassInfo(typelib, typeinfo, &QObject::staticMetaObject);
+ metaObject = qax_readClassInfo(typelib, typeinfo, baseMetaObject(category));
break;
case TKIND_DISPATCH:
- if (category & ActiveX)
- metaObject = qax_readInterfaceInfo(typelib, typeinfo, &QWidget::staticMetaObject);
- else
- metaObject = qax_readInterfaceInfo(typelib, typeinfo, &QObject::staticMetaObject);
+ metaObject = qax_readInterfaceInfo(typelib, typeinfo, baseMetaObject(category));
break;
case TKIND_RECORD:
case TKIND_ENUM:
@@ -765,7 +787,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
typeinfo->Release();
}
- for (int i = 0; i < qax_qualified_usertypes.count(); ++i) {
+ for (qsizetype i = 0; i < qax_qualified_usertypes.size(); ++i) {
QByteArray refType = qax_qualified_usertypes.at(i);
QByteArray refTypeLib;
if (refType.contains("::")) {
@@ -787,9 +809,16 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
if (libName != QLatin1String(nspace)) {
declOut << "namespace " << nspace << " {" << Qt::endl;
for (const auto &className : it.value()) {
- if (className.contains(' ')) {
- writeForwardDeclaration(declOut, className);
- namespaceForType.insert(className.mid(className.indexOf(' ') + 1), nspace);
+ const auto spacePos = className.indexOf(' ');
+ if (spacePos != -1) {
+ const QByteArray name = className.mid(spacePos + 1);
+ if (className.startsWith("enum ")) {
+ declOut << " " << className << " {\n"
+ << qax_enum_values.value(nspace + "::" + name) << " };\n";
+ } else {
+ declOut << " " << className << ";\n";
+ }
+ namespaceForType.insert(name, nspace);
} else {
declOut << " class " << className << ';' << Qt::endl;
opaquePointerTypes.append(nspace + "::" + className);
@@ -801,7 +830,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
declOut << '}' << Qt::endl << Qt::endl;
}
}
- for (const QByteArray &opaquePointerType : qAsConst(opaquePointerTypes))
+ for (const QByteArray &opaquePointerType : std::as_const(opaquePointerTypes))
declOut << "Q_DECLARE_OPAQUE_POINTER(" << opaquePointerType << "*)" << Qt::endl;
declOut << Qt::endl;
}
@@ -864,16 +893,10 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
switch (typekind) {
case TKIND_COCLASS:
- if (object_category & ActiveX)
- metaObject = qax_readClassInfo(typelib, typeinfo, &QWidget::staticMetaObject);
- else
- metaObject = qax_readClassInfo(typelib, typeinfo, &QObject::staticMetaObject);
+ metaObject = qax_readClassInfo(typelib, typeinfo, baseMetaObject(object_category));
break;
case TKIND_DISPATCH:
- if (object_category & ActiveX)
- metaObject = qax_readInterfaceInfo(typelib, typeinfo, &QWidget::staticMetaObject);
- else
- metaObject = qax_readInterfaceInfo(typelib, typeinfo, &QObject::staticMetaObject);
+ metaObject = qax_readInterfaceInfo(typelib, typeinfo, baseMetaObject(object_category));
break;
case TKIND_INTERFACE: { // only stub: QTBUG-27792, explicitly disable copy in inherited
// class to make related error messages clearer
@@ -915,7 +938,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
if (implFile.isOpen()) {
QString errorString;
if (!generateClassImpl(classImplOut, metaObject, className, guid.toString(), libNameBa,
- object_category, &errorString)) {
+ object_category, useControlName, &errorString)) {
qWarning("%s", qPrintable(errorString));
return false;
}
@@ -957,39 +980,6 @@ bool generateTypeLibrary(QString typeLibFile, QString outname,
declOut << '}' << Qt::endl;
declOut << Qt::endl;
- // partial template specialization for qMetaTypeCreateHelper and qMetaTypeConstructHelper
- declOut << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl;
- declOut << "namespace QtMetaTypePrivate {" << Qt::endl;
- for (int t = 0; t < subtypes.count(); ++t) {
- QByteArray subType(subtypes.at(t));
-
- declOut << "template<>" << Qt::endl;
- declOut << "struct QMetaTypeFunctionHelper<" << libName << "::" << subType << ", /* Accepted */ true> {" << Qt::endl;
-
- declOut << " static void Destruct(void *t)" << Qt::endl;
- declOut << " {" << Qt::endl;
- declOut << " Q_UNUSED(t)" << Qt::endl; // Silence MSVC that warns for POD types.
- declOut << " static_cast<" << libName << "::" << subType << "*>(t)->" << libName << "::" << subType << "::~" << subType << "();" << Qt::endl;
- declOut << " }" << Qt::endl;
-
- declOut << " static void *Construct(void *where, const void *t)" << Qt::endl;
- declOut << " {" << Qt::endl;
- declOut << " Q_ASSERT(!t);" << Qt::endl;
- declOut << " Q_UNUSED(t)" << Qt::endl; // Silence warnings for release builds
- declOut << " return new (where) " << libName << "::" << subType << ';' << Qt::endl;
- declOut << " }" << Qt::endl;
-
- declOut << "#ifndef QT_NO_DATASTREAM" << Qt::endl;
-
- declOut << " static void Save(QDataStream &stream, const void *t) { stream << *static_cast<const " << libName << "::" << subType << "*>(t); }" << Qt::endl;
- declOut << " static void Load(QDataStream &stream, void *t) { stream >> *static_cast<" << libName << "::" << subType << "*>(t); }" << Qt::endl;
-
- declOut << "#endif // QT_NO_DATASTREAM" << Qt::endl;
-
- declOut << "};" << Qt::endl << Qt::endl;
- }
- declOut << "} // namespace QtMetaTypePrivate" << Qt::endl;
- declOut << "QT_END_NAMESPACE" << Qt::endl << Qt::endl;
declOut << "#endif" << Qt::endl;
declOut << Qt::endl;
}
@@ -1009,6 +999,7 @@ struct Options
ProgramMode mode = GenerateMode;
ObjectCategories category = DefaultObject;
bool dispatchEqualsIDispatch = false;
+ bool useControlName = false;
QString outname;
QString typeLib;
@@ -1028,6 +1019,7 @@ static void parseOptions(Options *options)
const char outputOptionC[] = "-o";
const char nameSpaceOptionC[] = "-n";
const char getfileOptionC[] = "-getfile";
+ const char useControlNameOptionC[] = "-controlname";
QStringList args = QCoreApplication::arguments();
// Convert Windows-style '/option' into '-option'.
@@ -1075,6 +1067,9 @@ static void parseOptions(Options *options)
parser.addOption(getFileOption);
parser.addPositionalArgument(QStringLiteral("input"),
QStringLiteral("A type library file, type library ID, ProgID or CLSID."));
+ QCommandLineOption useControlNameOption(QLatin1String(useControlNameOptionC + 1),
+ QStringLiteral("Use the control class name instead of the UUID for setControl()."));
+ parser.addOption(useControlNameOption);
parser.process(args);
if (parser.isSet(outputOption))
@@ -1092,6 +1087,8 @@ static void parseOptions(Options *options)
options->typeLib = parser.value(getFileOption);
options->mode = TypeLibID;
}
+ if (parser.isSet(useControlNameOption))
+ options->useControlName = true;
if (!parser.positionalArguments().isEmpty())
options->typeLib = parser.positionalArguments().first();
@@ -1119,8 +1116,14 @@ int main(int argc, char **argv)
typeLib, QSettings::NativeFormat);
typeLib.clear();
QStringList codes = settings.childGroups();
- for (int c = 0; c < codes.count(); ++c) {
- typeLib = settings.value(QLatin1Char('/') + codes.at(c) + QLatin1String("/0/win32/.")).toString();
+ for (qsizetype c = 0; c < codes.size(); ++c) {
+ const QString keyPrefix = QLatin1Char('/') + codes.at(c) + QLatin1String("/0/");
+ if (QT_POINTER_SIZE == 8) {
+ typeLib = settings.value(keyPrefix + QLatin1String("win64/.")).toString();
+ if (QFile::exists(typeLib))
+ break;
+ }
+ typeLib = settings.value(keyPrefix + QLatin1String("win32/.")).toString();
if (QFile::exists(typeLib))
break;
}
@@ -1169,7 +1172,7 @@ int main(int argc, char **argv)
settings.beginGroup(key);
QStringList versions = settings.childGroups();
QStringList codes;
- if (versions.count()) {
+ if (!versions.isEmpty()) {
settings.beginGroup(QLatin1Char('/') + versions.last());
codes = settings.childGroups();
key += QLatin1Char('/') + versions.last();
@@ -1177,9 +1180,14 @@ int main(int argc, char **argv)
}
settings.endGroup();
- for (int c = 0; c < codes.count(); ++c) {
- typeLib = settings.value(key + QLatin1Char('/') + codes.at(c)
- + QLatin1String("/win32/.")).toString();
+ for (qsizetype c = 0; c < codes.size(); ++c) {
+ const QString keyPrefix = key + QLatin1Char('/') + codes.at(c) + QLatin1Char('/');
+ if (QT_POINTER_SIZE == 8) {
+ typeLib = settings.value(keyPrefix + QLatin1String("win64/.")).toString();
+ if (QFile::exists(typeLib))
+ break;
+ }
+ typeLib = settings.value(keyPrefix + QLatin1String("win32/.")).toString();
if (QFile::exists(typeLib))
break;
}
@@ -1190,7 +1198,7 @@ int main(int argc, char **argv)
return -2;
}
- if (!generateTypeLibrary(typeLib, options.outname, options.nameSpace, options.category)) {
+ if (!generateTypeLibrary(typeLib, options.outname, options.nameSpace, options.category, options.useControlName)) {
qWarning("dumpcpp: error processing type library '%s'", qPrintable(typeLib));
return -1;
}
diff --git a/tools/dumpcpp/moc.cpp b/tools/dumpcpp/moc.cpp
index e405b0a..99f41c2 100644
--- a/tools/dumpcpp/moc.cpp
+++ b/tools/dumpcpp/moc.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "moc.h"
@@ -35,6 +10,8 @@
#include <QTemporaryFile>
#include <QTextStream>
+#include <private/qtools_p.h>
+
QT_BEGIN_NAMESPACE
QByteArray setterName(const QByteArray &propertyName)
@@ -43,7 +20,7 @@ QByteArray setterName(const QByteArray &propertyName)
if (isupper(setter.at(0))) {
setter = "Set" + setter;
} else {
- setter[0] = char(toupper(setter[0]));
+ setter[0] = QtMiscUtils::toAsciiUpper(setter[0]);
setter = "set" + setter;
}
return setter;
@@ -262,16 +239,13 @@ static QString cleanCode(QString code, const QString &className, const QString &
}
QString mocCode(const QMetaObject *mo, const QString &qualifiedClassName,
- QString baseClass, QString *errorString)
+ QString *errorString)
{
QStringList name = qualifiedClassName.split(QLatin1String("::"));
if (name.isEmpty())
name.append(QLatin1String(mo->className()));
- if (baseClass.isEmpty()) {
- if (const auto sc = mo->superClass())
- baseClass = QLatin1String(sc->className());
- }
+ const QString baseClass = QLatin1String(mo->superClass()->className());
const QString tempPattern = QDir::tempPath() + QLatin1Char('/')
+ name.constLast().toLower() + QLatin1String("_XXXXXX.h");
diff --git a/tools/dumpcpp/moc.h b/tools/dumpcpp/moc.h
index 30a5030..4c72b5c 100644
--- a/tools/dumpcpp/moc.h
+++ b/tools/dumpcpp/moc.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef __MOC__
#define __MOC__
@@ -41,7 +16,7 @@ QByteArray setterName(const QByteArray &propertyName);
void formatCppEnum(QTextStream &str, const QMetaEnum &metaEnum);
QString mocCode(const QMetaObject *, const QString &qualifiedClassName,
- QString baseClass, QString *errorString);
+ QString *errorString);
QT_END_NAMESPACE
diff --git a/tools/dumpdoc/CMakeLists.txt b/tools/dumpdoc/CMakeLists.txt
index 5ee059e..84b4018 100644
--- a/tools/dumpdoc/CMakeLists.txt
+++ b/tools/dumpdoc/CMakeLists.txt
@@ -1,18 +1,19 @@
-# Generated from dumpdoc.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## dumpdoc Tool:
#####################################################################
-qt_add_tool(dumpdoc
- TOOLS_TARGET AxContainer # special case
+qt_get_tool_target_name(target_name dumpdoc)
+qt_internal_add_tool(${target_name}
+ TARGET_DESCRIPTION "Active Qt DumpDoc"
+ TOOLS_TARGET AxContainer
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::AxContainer
Qt::Gui
Qt::Widgets
)
-
-#### Keys ignored in scope 1:.:.:dumpdoc.pro:<TRUE>:
-# QMAKE_TARGET_DESCRIPTION = "Active Qt DumpDoc"
+qt_internal_return_unless_building_tools()
diff --git a/tools/dumpdoc/dumpdoc.pro b/tools/dumpdoc/dumpdoc.pro
deleted file mode 100644
index b879a68..0000000
--- a/tools/dumpdoc/dumpdoc.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-QT += axcontainer widgets
-
-SOURCES += main.cpp
-
-QMAKE_TARGET_DESCRIPTION = "Active Qt DumpDoc"
-load(qt_tool)
diff --git a/tools/dumpdoc/main.cpp b/tools/dumpdoc/main.cpp
index 6e14ee6..5488c38 100644
--- a/tools/dumpdoc/main.cpp
+++ b/tools/dumpdoc/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QAxObject>
#include <QFile>
diff --git a/tools/testcon/CMakeLists.txt b/tools/testcon/CMakeLists.txt
index 1a34519..50ebd69 100644
--- a/tools/testcon/CMakeLists.txt
+++ b/tools/testcon/CMakeLists.txt
@@ -1,13 +1,11 @@
-# Generated from testcon.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## testcon Binary:
#####################################################################
-qt_add_executable(testcon
- GUI
-# OUTPUT_DIRECTORY "$$[QT_INSTALL_BINS]" # special case
-# INSTALL_DIRECTORY "$$[QT_INSTALL_BINS]" # special case
+qt_internal_add_app(testcon
SOURCES
ambientproperties.cpp ambientproperties.h ambientproperties.ui
changeproperties.cpp changeproperties.h changeproperties.ui
@@ -16,7 +14,8 @@ qt_add_executable(testcon
invokemethod.cpp invokemethod.h invokemethod.ui
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
- PUBLIC_LIBRARIES
+ sandboxing.cpp sandboxing.h
+ LIBRARIES
Qt::AxContainer
Qt::AxContainerPrivate
Qt::AxServer
@@ -34,20 +33,9 @@ set(testcon_resource_files
"images/filenew.png"
)
-qt_add_resource(testcon "testcon"
+qt_internal_add_resource(testcon "testcon"
PREFIX
"/"
FILES
${testcon_resource_files}
)
-
-
-#### Keys ignored in scope 1:.:.:testcon.pro:<TRUE>:
-# RC_FILE = "testcon.rc"
-# TEMPLATE = "app"
-
-## Scopes:
-#####################################################################
-
-#### Keys ignored in scope 2:.:.:testcon.pro:NOT mingw:
-# QMAKE_POST_LINK = "midl" "$$shell_quote($$shell_path $$PWD/testcon.idl)" "&&" "move" "testcon.tlb" "$(TARGETDIR)"
diff --git a/tools/testcon/ambientproperties.cpp b/tools/testcon/ambientproperties.cpp
index 83ef2e2..2163cf6 100644
--- a/tools/testcon/ambientproperties.cpp
+++ b/tools/testcon/ambientproperties.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "ambientproperties.h"
diff --git a/tools/testcon/ambientproperties.h b/tools/testcon/ambientproperties.h
index 0613679..c5e9dd2 100644
--- a/tools/testcon/ambientproperties.h
+++ b/tools/testcon/ambientproperties.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef AMBIENTPROPERTIES_H
#define AMBIENTPROPERTIES_H
diff --git a/tools/testcon/ambientproperties.ui b/tools/testcon/ambientproperties.ui
index e95212d..bfd8a11 100644
--- a/tools/testcon/ambientproperties.ui
+++ b/tools/testcon/ambientproperties.ui
@@ -1,32 +1,8 @@
<ui version="4.0" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+</comment>
<exportmacro></exportmacro>
<class>AmbientProperties</class>
<widget class="QDialog" name="AmbientProperties" >
diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp
index 966b5f1..799ee0b 100644
--- a/tools/testcon/changeproperties.cpp
+++ b/tools/testcon/changeproperties.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "changeproperties.h"
@@ -87,17 +62,16 @@ void ChangeProperties::on_buttonSet_clicked()
QString prop = item->text(0);
QVariant value = activex->property(prop.toLatin1());
- QVariant::Type type = value.type();
+ int type = value.metaType().id();
if (!value.isValid()) {
const QMetaObject *mo = activex->metaObject();
const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1()));
- type = QVariant::nameToType(property.typeName());
+ type = QMetaType::fromName(property.typeName()).id();
}
switch (type) {
- case QVariant::Color:
+ case QMetaType::QColor:
{
- QColor col;
- col.setNamedColor(editValue->text());
+ const QColor col = QColor::fromString(editValue->text());
if (col.isValid()) {
value = QVariant::fromValue(col);
} else {
@@ -109,7 +83,7 @@ void ChangeProperties::on_buttonSet_clicked()
}
}
break;
- case QVariant::Font:
+ case QMetaType::QFont:
{
QFont fnt;
if (fnt.fromString(editValue->text())) {
@@ -123,7 +97,7 @@ void ChangeProperties::on_buttonSet_clicked()
}
}
break;
- case QVariant::Pixmap:
+ case QMetaType::QPixmap:
{
QString fileName = editValue->text();
if (fileName.isEmpty())
@@ -135,17 +109,17 @@ void ChangeProperties::on_buttonSet_clicked()
value = QVariant::fromValue(pm);
}
break;
- case QVariant::Bool:
+ case QMetaType::Bool:
{
const QString txt = editValue->text();
value = QVariant(txt != QLatin1String("0") && txt.compare(QLatin1String("false"), Qt::CaseInsensitive));
}
break;
- case QVariant::List:
+ case QMetaType::QVariantList:
{
QStringList txtList = editValue->text().split(QRegularExpression(QLatin1String("[,;]")));
QVariantList varList;
- for (int i = 0; i < txtList.count(); ++i) {
+ for (qsizetype i = 0; i < txtList.size(); ++i) {
QVariant svar(txtList.at(i));
QString str = svar.toString();
str = str.trimmed();
@@ -208,31 +182,31 @@ void ChangeProperties::updateProperties()
}
QVariant var = activex->property(property.name());
- switch (var.type()) {
- case QVariant::Color:
+ switch (var.metaType().id()) {
+ case QMetaType::QColor:
{
QColor col = qvariant_cast<QColor>(var);
item->setText(2, col.name());
}
break;
- case QVariant::Font:
+ case QMetaType::QFont:
{
QFont fnt = qvariant_cast<QFont>(var);
item->setText(2, fnt.toString());
}
break;
- case QVariant::Bool:
+ case QMetaType::Bool:
{
item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false"));
}
break;
- case QVariant::Pixmap:
+ case QMetaType::QPixmap:
{
QPixmap pm = qvariant_cast<QPixmap>(var);
item->setIcon(2, pm);
}
break;
- case QVariant::List:
+ case QMetaType::QVariantList:
{
const auto varList = var.toList();
QStringList strList;
@@ -241,7 +215,7 @@ void ChangeProperties::updateProperties()
item->setText(2, strList.join(QLatin1String(", ")));
}
break;
- case QVariant::Int:
+ case QMetaType::Int:
if (property.isEnumType()) {
const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName()));
item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt())));
diff --git a/tools/testcon/changeproperties.h b/tools/testcon/changeproperties.h
index 908ecb3..749eb7b 100644
--- a/tools/testcon/changeproperties.h
+++ b/tools/testcon/changeproperties.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef CHANGEPROPERTIES_H
#define CHANGEPROPERTIES_H
diff --git a/tools/testcon/changeproperties.ui b/tools/testcon/changeproperties.ui
index b264598..011721b 100644
--- a/tools/testcon/changeproperties.ui
+++ b/tools/testcon/changeproperties.ui
@@ -1,32 +1,8 @@
<ui version="4.0" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+</comment>
<exportmacro></exportmacro>
<class>ChangeProperties</class>
<widget class="QDialog" name="ChangeProperties" >
diff --git a/tools/testcon/controlinfo.cpp b/tools/testcon/controlinfo.cpp
index 2339895..2cea30f 100644
--- a/tools/testcon/controlinfo.cpp
+++ b/tools/testcon/controlinfo.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "controlinfo.h"
diff --git a/tools/testcon/controlinfo.h b/tools/testcon/controlinfo.h
index 0f22a82..b3cde7a 100644
--- a/tools/testcon/controlinfo.h
+++ b/tools/testcon/controlinfo.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef CONTROLINFO_H
#define CONTROLINFO_H
diff --git a/tools/testcon/controlinfo.ui b/tools/testcon/controlinfo.ui
index 1023561..47315e6 100644
--- a/tools/testcon/controlinfo.ui
+++ b/tools/testcon/controlinfo.ui
@@ -1,32 +1,8 @@
<ui version="4.0" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+</comment>
<exportmacro></exportmacro>
<class>ControlInfo</class>
<widget class="QDialog" name="ControlInfo" >
diff --git a/tools/testcon/docuwindow.cpp b/tools/testcon/docuwindow.cpp
index c5f60e9..fbc19d6 100644
--- a/tools/testcon/docuwindow.cpp
+++ b/tools/testcon/docuwindow.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "docuwindow.h"
#include <QTextBrowser>
diff --git a/tools/testcon/docuwindow.h b/tools/testcon/docuwindow.h
index a2849e5..ca81689 100644
--- a/tools/testcon/docuwindow.h
+++ b/tools/testcon/docuwindow.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef DOCUWINDOW_H
#define DOCUWINDOW_H
diff --git a/tools/testcon/invokemethod.cpp b/tools/testcon/invokemethod.cpp
index 1651537..eb1376e 100644
--- a/tools/testcon/invokemethod.cpp
+++ b/tools/testcon/invokemethod.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "invokemethod.h"
@@ -122,7 +97,7 @@ void InvokeMethod::on_comboMethods_textActivated(const QString &method)
const auto pnames = slot.parameterNames();
const auto ptypes = slot.parameterTypes();
- for (int p = 0; p < ptypes.count(); ++p) {
+ for (qsizetype p = 0; p < ptypes.size(); ++p) {
QString ptype(QString::fromLatin1(ptypes.at(p)));
if (ptype.isEmpty())
continue;
diff --git a/tools/testcon/invokemethod.h b/tools/testcon/invokemethod.h
index dff8cc9..b9eacb6 100644
--- a/tools/testcon/invokemethod.h
+++ b/tools/testcon/invokemethod.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef INVOKEMETHOD_H
#define INVOKEMETHOD_H
diff --git a/tools/testcon/invokemethod.ui b/tools/testcon/invokemethod.ui
index 88ef34e..8511c5a 100644
--- a/tools/testcon/invokemethod.ui
+++ b/tools/testcon/invokemethod.ui
@@ -1,32 +1,8 @@
<ui version="4.0" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+</comment>
<exportmacro></exportmacro>
<class>InvokeMethod</class>
<widget class="QDialog" name="InvokeMethod" >
diff --git a/tools/testcon/main.cpp b/tools/testcon/main.cpp
index e1b5c29..d867b10 100644
--- a/tools/testcon/main.cpp
+++ b/tools/testcon/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mainwindow.h"
@@ -60,8 +35,6 @@ static void redirectDebugOutput(QtMsgType, const QMessageLogContext &, const QSt
int main( int argc, char **argv )
{
- if (isOptionSet(argc, argv, "--no-scaling"))
- QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
if (isOptionSet(argc, argv, "--no-native-siblings"))
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
@@ -80,9 +53,6 @@ int main( int argc, char **argv )
QCommandLineOption noMessageHandlerOption(QLatin1String("no-messagehandler"),
QLatin1String("Suppress installation of the message handler."));
parser.addOption(noMessageHandlerOption);
- QCommandLineOption noScalingDummy(QLatin1String("no-scaling"),
- QLatin1String("Set Qt::AA_DisableHighDpiScaling."));
- parser.addOption(noScalingDummy);
QCommandLineOption noNativeSiblingsDummy(QLatin1String("no-native-siblings"),
QLatin1String("Set Qt::AA_DontCreateNativeWidgetSiblings."));
parser.addOption(noNativeSiblingsDummy);
diff --git a/tools/testcon/mainwindow.cpp b/tools/testcon/mainwindow.cpp
index 1e5347e..df81e42 100644
--- a/tools/testcon/mainwindow.cpp
+++ b/tools/testcon/mainwindow.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mainwindow.h"
#include "changeproperties.h"
@@ -47,8 +22,7 @@
#include <QtAxContainer/QAxScriptManager>
#include <QtAxContainer/QAxWidget>
#include <QtAxContainer/private/qaxbase_p.h>
-#include <memory>
-#include <sddl.h>
+#include "sandboxing.h"
QT_BEGIN_NAMESPACE
@@ -115,70 +89,28 @@ QList<QAxWidget *> MainWindow::axWidgets() const
return result;
}
-
-/** RAII class for temporarily impersonating low-integrity level for the current thread.
- Intended to be used together with CLSCTX_ENABLE_CLOAKING when creating COM objects.
- Based on "Designing Applications to Run at a Low Integrity Level" https://msdn.microsoft.com/en-us/library/bb625960.aspx */
-struct LowIntegrity {
- LowIntegrity()
- {
- HANDLE cur_token = nullptr;
- if (!OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_ADJUST_DEFAULT | TOKEN_QUERY | TOKEN_ASSIGN_PRIMARY, &cur_token))
- abort();
-
- if (!DuplicateTokenEx(cur_token, 0, nullptr, SecurityImpersonation, TokenPrimary, &m_token))
- abort();
-
- CloseHandle(cur_token);
-
- PSID li_sid = nullptr;
- if (!ConvertStringSidToSid(L"S-1-16-4096", &li_sid)) // low integrity SID
- abort();
-
- // reduce process integrity level
- TOKEN_MANDATORY_LABEL TIL = {};
- TIL.Label.Attributes = SE_GROUP_INTEGRITY;
- TIL.Label.Sid = li_sid;
- if (!SetTokenInformation(m_token, TokenIntegrityLevel, &TIL, sizeof(TOKEN_MANDATORY_LABEL) + GetLengthSid(li_sid)))
- abort();
-
- if (!ImpersonateLoggedOnUser(m_token)) // change current thread integrity
- abort();
-
- LocalFree(li_sid);
- li_sid = nullptr;
- }
-
- ~LowIntegrity()
- {
- if (!RevertToSelf())
- abort();
-
- CloseHandle(m_token);
- m_token = nullptr;
- }
-
-private:
- HANDLE m_token = nullptr;
-};
-
bool MainWindow::addControlFromClsid(const QString &clsid, QAxSelect::SandboxingLevel sandboxing)
{
QAxWidget *container = new QAxWidget;
bool result = false;
{
- std::unique_ptr<LowIntegrity> low_integrity;
+ // RAII object for impersonating sandboxing on current thread
+ std::unique_ptr<Sandboxing> sandbox_impl;
- if (sandboxing == QAxSelect::SandboxingProcess) {
+ switch (sandboxing) {
+ case QAxSelect::SandboxingNone:
+ break; // sandboxing disabled
+ case QAxSelect::SandboxingProcess:
// require out-of-process
container->setClassContext(CLSCTX_LOCAL_SERVER);
- } else if (sandboxing == QAxSelect::SandboxingLowIntegrity) {
- // impersonate "low integrity"
- low_integrity.reset(new LowIntegrity);
- // require out-of-process and
- // propagate integrity level when calling setControl
+ break;
+ default:
+ // impersonate desired sandboxing
+ sandbox_impl = Sandboxing::Create(sandboxing, clsid);
+ // require out-of-process and activate impersonation
container->setClassContext(CLSCTX_LOCAL_SERVER | CLSCTX_ENABLE_CLOAKING);
+ break;
}
result = container->setControl(clsid);
@@ -349,11 +281,11 @@ void MainWindow::on_VerbMenu_aboutToShow()
return;
QStringList verbs = container->verbs();
- for (int i = 0; i < verbs.count(); ++i) {
+ for (qsizetype i = 0; i < verbs.size(); ++i) {
VerbMenu->addAction(verbs.at(i));
}
- if (!verbs.count()) { // no verbs?
+ if (verbs.isEmpty()) { // no verbs?
VerbMenu->addAction(tr("-- Object does not support any verbs --"))->setEnabled(false);
}
}
@@ -404,7 +336,7 @@ void MainWindow::on_actionScriptingRun_triggered()
// If we have only one script loaded we can use the cool dialog
QStringList scriptList = m_scripts->scriptNames();
- if (scriptList.count() == 1) {
+ if (scriptList.size() == 1) {
InvokeMethod scriptInvoke(this);
scriptInvoke.setWindowTitle(tr("Execute Script Function"));
scriptInvoke.setControl(m_scripts->script(scriptList[0])->scriptEngine());
diff --git a/tools/testcon/mainwindow.h b/tools/testcon/mainwindow.h
index a8722bd..32fb678 100644
--- a/tools/testcon/mainwindow.h
+++ b/tools/testcon/mainwindow.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
diff --git a/tools/testcon/mainwindow.ui b/tools/testcon/mainwindow.ui
index ec770a9..65ee716 100644
--- a/tools/testcon/mainwindow.ui
+++ b/tools/testcon/mainwindow.ui
@@ -1,32 +1,8 @@
<ui version="4.0" stdsetdef="1" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
+<comment>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+</comment>
<exportmacro></exportmacro>
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow" >
@@ -362,7 +338,6 @@
<addaction name="actionLogProperties" />
</widget>
<addaction name="actionFreezeEvents" />
- <addaction name="actionGroupLogging" />
<addaction name="LoggingMenu" />
<addaction name="actionFreeUnusedDLLs"/>
</widget>
diff --git a/tools/testcon/sandboxing.cpp b/tools/testcon/sandboxing.cpp
new file mode 100644
index 0000000..e0c0eea
--- /dev/null
+++ b/tools/testcon/sandboxing.cpp
@@ -0,0 +1,204 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include "sandboxing.h"
+#include <memory>
+#include <windows.h>
+#include <sddl.h>
+#include <userenv.h>
+#include <QProcess>
+#include <QSettings>
+
+
+/** RAII wrapper of STARTUPINFOEX. */
+struct StartupInfoExWrap
+{
+ STARTUPINFOEX si = {};
+
+ StartupInfoExWrap ()
+ {
+ si.StartupInfo.cb = sizeof(STARTUPINFOEX);
+
+ const DWORD attr_count = 1; // SECURITY_CAPABILITIES
+ SIZE_T attr_size = 0;
+ InitializeProcThreadAttributeList(NULL, attr_count, 0, &attr_size);
+ si.lpAttributeList = (PPROC_THREAD_ATTRIBUTE_LIST)new BYTE[attr_size]();
+ if (!InitializeProcThreadAttributeList(si.lpAttributeList, attr_count, 0, &attr_size))
+ qFatal("InitializeProcThreadAttributeList failed");
+ }
+
+ void SetSecurity(SECURITY_CAPABILITIES *sc)
+ {
+ if (!UpdateProcThreadAttribute(si.lpAttributeList, 0, PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES,
+ sc, sizeof(SECURITY_CAPABILITIES), NULL, NULL))
+ qFatal("UpdateProcThreadAttribute failed");
+ }
+
+ ~StartupInfoExWrap()
+ {
+ DeleteProcThreadAttributeList(si.lpAttributeList);
+ delete [] (BYTE*)si.lpAttributeList;
+ }
+};
+
+/** RAII wrapper of PROCESS_INFORMATION. */
+struct ProcessInformationWrap
+{
+ PROCESS_INFORMATION pi = {};
+
+ ~ProcessInformationWrap()
+ {
+ CloseHandle(pi.hThread);
+ pi.hThread = nullptr;
+ CloseHandle(pi.hProcess);
+ pi.hProcess = nullptr;
+ }
+};
+
+/** RAII class for temporarily impersonating an AppContainer-isolated process
+ * for the current thread. Intended to be used together with CLSCTX_ENABLE_CLOAKING
+ * when creating COM objects. There's no direct support for AppContainer
+ * impersonation in Windows, so the impl. will instead create a suspended throw-away
+ * process within the AppContainer to use as basis for AppContainer impersonation.
+ * This seem kind of weird, but is the approach recommended by Microsoft when opening
+ * a support case on the matter. Based on "AppContainer Isolation"
+ * https://learn.microsoft.com/en-us/windows/win32/secauthz/appcontainer-isolation */
+struct AppContainer : public Sandboxing
+{
+ AppContainer(const QString &clsid)
+ {
+ // Create AppContainer sandbox without any special capabilities
+ static const wchar_t name[] = L"Qt_testcon";
+ static const wchar_t desc[] = L"Qt ActiveQt Test Container";
+ HRESULT hr = CreateAppContainerProfile(name, name, desc, nullptr, 0, &m_sid);
+ if (HRESULT_CODE(hr) == ERROR_ALREADY_EXISTS)
+ hr = DeriveAppContainerSidFromAppContainerName(name, &m_sid); // fallback to existing container
+ if (FAILED(hr))
+ qFatal("CreateAppContainerProfile and DeriveAppContainerSidFromAppContainerName failed");
+
+ SECURITY_CAPABILITIES sec_cap = {};
+ sec_cap.AppContainerSid = m_sid;
+
+ StartupInfoExWrap si;
+ si.SetSecurity(&sec_cap);
+
+ // Create suspended COM server process in AppContainer
+ QString exe_path = GetExePath(clsid);
+ ProcessInformationWrap pi;
+ DWORD flags = EXTENDED_STARTUPINFO_PRESENT | CREATE_SUSPENDED; // don't start main thread
+ if (!CreateProcess(exe_path.toStdWString().data(), nullptr, nullptr, nullptr,
+ FALSE, flags, nullptr, nullptr, (STARTUPINFO*)&si.si, &pi.pi))
+ qFatal("CreateProcess failed");
+
+ // Kill process since we're only interested in the handle for now.
+ // The COM runtime will later recreate the process when calling CoCreateInstance.
+ TerminateProcess(pi.pi.hProcess, 0);
+
+ // Create AppContainer impersonation token
+ HANDLE cur_token = nullptr;
+ if (!OpenProcessToken(pi.pi.hProcess,
+ TOKEN_DUPLICATE | TOKEN_ADJUST_DEFAULT | TOKEN_QUERY | TOKEN_ASSIGN_PRIMARY,
+ &cur_token))
+ qFatal("OpenProcessToken failed");
+
+ if (!DuplicateTokenEx(cur_token, 0, NULL, SecurityImpersonation, TokenPrimary, &m_token))
+ qFatal("DuplicateTokenEx failed");
+
+ CloseHandle(cur_token);
+ cur_token = nullptr;
+
+ // Impersonate AppContainer on current thread
+ if (!ImpersonateLoggedOnUser(m_token))
+ qFatal("ImpersonateLoggedOnUser failed");
+ }
+
+ ~AppContainer()
+ {
+ if (!RevertToSelf())
+ qFatal("RevertToSelf failed");
+
+ CloseHandle(m_token);
+ m_token = nullptr;
+
+ FreeSid(m_sid);
+ m_sid = nullptr;
+ }
+
+private:
+ /** Get EXE path for a COM class. Input is on "{hex-guid}" format.
+ * Returns empty string if the COM class is DLL-based and on failure. */
+ static QString GetExePath (const QString &clsid)
+ {
+ // extract COM class
+ QSettings cls_folder("HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\" + clsid, QSettings::NativeFormat);
+ QString command = cls_folder.value("LocalServer32/.").toString();
+ if (command.isEmpty())
+ return ""; // not exe path found
+
+ // remove any quotes and "/automation" or "-activex" arguments
+ QStringList arguments = QProcess::splitCommand(command);
+ return arguments[0]; // executable is first argument
+ }
+
+ PSID m_sid = nullptr;
+ HANDLE m_token = nullptr;
+};
+
+/** RAII class for temporarily impersonating low-integrity level for the current thread.
+ Intended to be used together with CLSCTX_ENABLE_CLOAKING when creating COM objects.
+ Based on "Designing Applications to Run at a Low Integrity Level" https://msdn.microsoft.com/en-us/library/bb625960.aspx */
+class LowIntegrity : public Sandboxing
+{
+public:
+ LowIntegrity()
+ {
+ HANDLE cur_token = nullptr;
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_ADJUST_DEFAULT | TOKEN_QUERY | TOKEN_ASSIGN_PRIMARY, &cur_token))
+ qFatal("OpenProcessToken failed");
+
+ if (!DuplicateTokenEx(cur_token, 0, nullptr, SecurityImpersonation, TokenPrimary, &m_token))
+ qFatal("DuplicateTokenEx failed");
+
+ CloseHandle(cur_token);
+
+ PSID li_sid = nullptr;
+ if (!ConvertStringSidToSid(L"S-1-16-4096", &li_sid)) // low integrity SID
+ qFatal("ConvertStringSidToSid failed");
+
+ // reduce process integrity level
+ TOKEN_MANDATORY_LABEL TIL = {};
+ TIL.Label.Attributes = SE_GROUP_INTEGRITY;
+ TIL.Label.Sid = li_sid;
+ if (!SetTokenInformation(m_token, TokenIntegrityLevel, &TIL, sizeof(TOKEN_MANDATORY_LABEL) + GetLengthSid(li_sid)))
+ qFatal("SetTokenInformation failed");
+
+ if (!ImpersonateLoggedOnUser(m_token)) // change current thread integrity
+ qFatal("ImpersonateLoggedOnUser failed");
+
+ LocalFree(li_sid);
+ li_sid = nullptr;
+ }
+
+ ~LowIntegrity()
+ {
+ if (!RevertToSelf())
+ qFatal("RevertToSelf failed");
+
+ CloseHandle(m_token);
+ m_token = nullptr;
+ }
+
+private:
+ HANDLE m_token = nullptr;
+};
+
+std::unique_ptr<Sandboxing> Sandboxing::Create(QAxSelect::SandboxingLevel level, const QString &clsid)
+{
+ if (level == QAxSelect::SandboxingLowIntegrity)
+ return std::make_unique<LowIntegrity>();
+ else if (level == QAxSelect::SandboxingAppContainer)
+ return std::make_unique<AppContainer>(clsid);
+
+ Q_ASSERT_X(false, "Sandboxing::Create", "unknown sandboxing level");
+ return {};
+}
diff --git a/tools/testcon/sandboxing.h b/tools/testcon/sandboxing.h
new file mode 100644
index 0000000..5f51227
--- /dev/null
+++ b/tools/testcon/sandboxing.h
@@ -0,0 +1,20 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef SANDBOXING_H
+#define SANDBOXING_H
+#include <QString>
+#include <QAxSelect>
+
+
+class Sandboxing
+{
+public:
+ static std::unique_ptr<Sandboxing> Create(QAxSelect::SandboxingLevel level, const QString &clsid);
+
+ Sandboxing() {}
+
+ virtual ~Sandboxing() {}
+};
+
+#endif // SANDBOXING_H
diff --git a/tools/testcon/scripts/hierarchyax.vbs b/tools/testcon/scripts/hierarchyax.vbs
index 0c1a3c5..10c4e0d 100644
--- a/tools/testcon/scripts/hierarchyax.vbs
+++ b/tools/testcon/scripts/hierarchyax.vbs
@@ -1,30 +1,5 @@
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-''
-'' Copyright (C) 2016 The Qt Company Ltd.
-'' Contact: https://www.qt.io/licensing/
-''
-'' This file is part of the ActiveQt module of the Qt Toolkit.
-''
-'' $QT_BEGIN_LICENSE:GPL-EXCEPT$
-'' Commercial License Usage
-'' Licensees holding valid commercial Qt licenses may use this file in
-'' accordance with the commercial license agreement provided with the
-'' Software or, alternatively, in accordance with the terms contained in
-'' a written agreement between you and The Qt Company. For licensing terms
-'' and conditions see https://www.qt.io/terms-conditions. For further
-'' information use the contact form at https://www.qt.io/contact-us.
-''
-'' GNU General Public License Usage
-'' Alternatively, this file may be used under the terms of the GNU
-'' General Public License version 3 as published by the Free Software
-'' Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-'' included in the packaging of this file. Please review the following
-'' information to ensure the GNU General Public License requirements will
-'' be met: https://www.gnu.org/licenses/gpl-3.0.html.
-''
-'' $QT_END_LICENSE$
-''
-'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+' Copyright (C) 2016 The Qt Company Ltd.
+' SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
' This script can be loaded in Qt TestCon, and used to script
' the hierarchyax project.
diff --git a/tools/testcon/scripts/perlscript.pl b/tools/testcon/scripts/perlscript.pl
index 2f65e46..8176b81 100644
--- a/tools/testcon/scripts/perlscript.pl
+++ b/tools/testcon/scripts/perlscript.pl
@@ -1,30 +1,5 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the ActiveQt module of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
sub QAxWidget2_Click {
$QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1;
diff --git a/tools/testcon/scripts/pythonscript.py b/tools/testcon/scripts/pythonscript.py
index a0ac4dd..b348ef9 100644
--- a/tools/testcon/scripts/pythonscript.py
+++ b/tools/testcon/scripts/pythonscript.py
@@ -1,31 +1,6 @@
#!/usr/bin/env python
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2016 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
def QAxWidget2_Click():
QAxWidget2.lineWidth = QAxWidget2.lineWidth + 1;
diff --git a/tools/testcon/testcon.pro b/tools/testcon/testcon.pro
deleted file mode 100644
index f796ba9..0000000
--- a/tools/testcon/testcon.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-
-CONFIG += qaxserver_no_postlink
-QT += widgets axserver axcontainer axcontainer-private printsupport
-
-SOURCES = main.cpp docuwindow.cpp mainwindow.cpp invokemethod.cpp changeproperties.cpp ambientproperties.cpp controlinfo.cpp
-HEADERS = docuwindow.h mainwindow.h invokemethod.h changeproperties.h ambientproperties.h controlinfo.h
-FORMS = mainwindow.ui invokemethod.ui changeproperties.ui ambientproperties.ui controlinfo.ui
-RC_FILE = testcon.rc
-RESOURCES += testcon.qrc
-
-!mingw:QMAKE_POST_LINK = midl $$shell_quote($$shell_path($$PWD/testcon.idl)) && move testcon.tlb $(TARGETDIR)
-
-target.path = $$[QT_INSTALL_BINS]
-INSTALLS += target
diff --git a/tools/testcon/testcon.qrc b/tools/testcon/testcon.qrc
deleted file mode 100644
index 871a32b..0000000
--- a/tools/testcon/testcon.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
-<qresource>
- <file>images/controlmethods.png</file>
- <file>images/controlproperties.png</file>
- <file>images/filenew.png</file>
-</qresource>
-</RCC>
diff --git a/tools/tools.pro b/tools/tools.pro
deleted file mode 100644
index 4a83738..0000000
--- a/tools/tools.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = subdirs
-
-CONFIG += ordered
-
-SUBDIRS = dumpdoc \
- dumpcpp \
- testcon
-
-qtNomakeTools( \
- testcon \
-)