diff options
Diffstat (limited to 'examples')
94 files changed, 99 insertions, 5147 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 362d2da..91c72be 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: LicenseRef-Qt-Commercial OR 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..4457442 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: LicenseRef-Qt-Commercial OR 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..f92fff5 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: LicenseRef-Qt-Commercial OR 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..dd89def 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 GFDL-1.3-no-invariants-only //! [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=""$(QTDIR)\include";"$(QTDIR)\include\QtCore"" - 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=""$(QTDIR)\include";"$(QTDIR)\include\QtCore"" - 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="<enter object name>" /> -<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/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc deleted file mode 100644 index f618729..0000000 --- a/examples/activeqt/hierarchy/doc/src/hierarchy.qdoc +++ /dev/null @@ -1,88 +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-hierarchy.html - \title Qt Widget Hierarchy - - \input examples/hierarchy-demo.qdocinc -*/ - -/*! - \example activeqt/hierarchy - \title Hierarchy Example (ActiveQt) - - \brief The Hierarchy example is shows how to write an in-process ActiveX - control. The control is a QWidget subclass with child widgets - that are accessible as sub-types. - - \snippet activeqt/hierarchy/objects.h 0 - The \c QParentWidget class provides slots to create a widget - with a name, and to return a pointer to a named widget. The class - declaration uses \c Q_CLASSINFO() to provide the COM identifiers for - this class. - - \snippet activeqt/hierarchy/objects.cpp 0 - The constructor of \c QParentWidget creates a vertical box layout. - New child widgets are automatically added to the layout. - - \snippet activeqt/hierarchy/objects.cpp 1 - The \c createSubWidget slot creates a new \c QSubWidget with - the name provided in the parameter, and sets the label to that - name. The widget is also shown explicitly. - - \snippet activeqt/hierarchy/objects.cpp 2 - The \c subWidget slot uses the \c QObject::findChild() function and - returns the first child of type \c QSubWidget that has the requested - name. - - \snippet activeqt/hierarchy/objects.h 1 - The \c QSubWidget class has a single string-property \c label, - and implements the paintEvent to draw the label. The class uses - again \c Q_CLASSINFO to provide the COM identifiers, and also sets - the \e ToSuperClass attribute to \e QSubWidget, to ensure that only - no slots of any superclasses (i.e. QWidget) are exposed. - - \snippet activeqt/hierarchy/objects.cpp 3 - \snippet activeqt/hierarchy/objects.cpp 4 - The implementation of the \c QSubWidget class is self-explanatory. - - \snippet activeqt/hierarchy/main.cpp 0 - The classes are then exported using a QAxFactory. \c QParentWidget is - exported as a full class (which can be created ), while \c QSubWidget is - only exported as a type, which can only be created indirectly through - APIs of \c QParentWidget. - - To build the example you must first build the QAxServer library. - Then run qmake and your make tool in \c activeqt/hierarchy. - - The \l{qaxserver-demo-hierarchy.html}{demonstration} requires - your WebBrowser to support ActiveX controls, and scripting to be - enabled. - - \snippet activeqt/hierarchy/doc/snippets/hierarchy-demo-snippet.qdoc script -*/ diff --git a/examples/activeqt/hierarchy/hierarchy.def b/examples/activeqt/hierarchy/hierarchy.def deleted file mode 100644 index bc82a03..0000000 --- a/examples/activeqt/hierarchy/hierarchy.def +++ /dev/null @@ -1,6 +0,0 @@ -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - DumpIDL PRIVATE diff --git a/examples/activeqt/hierarchy/hierarchy.ico b/examples/activeqt/hierarchy/hierarchy.ico Binary files differdeleted file mode 100644 index c80d36a..0000000 --- a/examples/activeqt/hierarchy/hierarchy.ico +++ /dev/null diff --git a/examples/activeqt/hierarchy/hierarchy.inf b/examples/activeqt/hierarchy/hierarchy.inf deleted file mode 100644 index cb7e90f..0000000 --- a/examples/activeqt/hierarchy/hierarchy.inf +++ /dev/null @@ -1,9 +0,0 @@ -[version] - signature="$CHICAGO$" - AdvancedINF=2.0 - [Add.Code] - hierarchyax.dll=hierarchyax.dll - [hierarchyax.dll] - file-win32-x86=thiscab - clsid={d574a747-8016-46db-a07c-b2b4854ee75c} - RegisterServer=yes diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro deleted file mode 100644 index acc108a..0000000 --- a/examples/activeqt/hierarchy/hierarchy.pro +++ /dev/null @@ -1,16 +0,0 @@ -include(../shared.pri) - -TEMPLATE = lib -TARGET = hierarchyax - -CONFIG += warn_off dll -QT += widgets axserver - -SOURCES = objects.cpp main.cpp -HEADERS = objects.h -RC_FILE = hierarchy.rc -DEF_FILE = hierarchy.def - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy -INSTALLS += target diff --git a/examples/activeqt/hierarchy/hierarchy.rc b/examples/activeqt/hierarchy/hierarchy.rc deleted file mode 100644 index 70eb503..0000000 --- a/examples/activeqt/hierarchy/hierarchy.rc +++ /dev/null @@ -1,2 +0,0 @@ -1 TYPELIB "hierarchy.rc" -1 ICON "hierarchy.ico" 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/doc/images/activeqt-mediaplayer-example.jpg b/examples/activeqt/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg Binary files differdeleted file mode 100644 index 4839242..0000000 --- a/examples/activeqt/mediaplayer/doc/images/activeqt-mediaplayer-example.jpg +++ /dev/null diff --git a/examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc b/examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc deleted file mode 100644 index 6043a6a..0000000 --- a/examples/activeqt/mediaplayer/doc/src/mediaplayer.qdoc +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -/*! - \example activeqt/mediaplayer - \title Media Player Example (ActiveQt) - - \brief The Media Player example uses the Microsoft Media Player - ActiveX control to implement a functional media player application. - - \image activeqt-mediaplayer-example.jpg - - \e {Media Player} demonstrates how a Qt application can communicate with - embedded ActiveX controls using signals, slots, and the \c dynamicCall() - function. - - \quotefromfile activeqt/mediaplayer/main.cpp - \skipto class MainWindow - \printuntil /^\}/ - - The \c MainWindow class declares a \c QMainWindow based user interface, - using the \c Ui::MainWindow class created by Qt Designer. A number - of slots are implemented to handle events from user interface elements, - including the \c mediaPlayer object, which is a QAxWidget hosting - the Microsoft Media Player ActiveX control. - - \quotefromfile activeqt/mediaplayer/main.cpp - \skipto MainWindow::MainWindow() - \printuntil /^\}/ - - The constructor initializes the user interface, restores a previously - saved window geometry, and uses the \c dynamicCall() function to invoke - the APIs implemented by the Microsoft Media Player ActiveX control, - to set initial configuration parameters. - - \quotefromfile activeqt/mediaplayer/main.cpp - \skipto MainWindow::on_mediaPlayer_PlayStateChange - \printuntil /^\}/ - - The \c on_mediaPlayer_PlayStateChange slot handles the signal emitted - by the \c mediaPlayer object when its state changes. - - \quotefromfile activeqt/mediaplayer/main.cpp - \skipto MainWindow::openMedia - \printuntil /^\}/ - - The \c openMedia() function allows a media file to be opened by using - the \c dynamicCall() function to set the URL property in the ActiveX - control, which causes the media file to be loaded and played. - - \quotefromfile activeqt/mediaplayer/main.cpp - \skipto int main - \printuntil /^\}/ - - The \c main() function starts the application using standard Qt APIs - and uses an optional command line argument as the name of a media - file to be loaded by the player. - - To build the example, you must first build the QAxContainer - library. Then run your make tool in - \c examples/activeqt/mediaplayer and run the resulting - \c mediaplayer.exe. -*/ diff --git a/examples/activeqt/mediaplayer/main.cpp b/examples/activeqt/mediaplayer/main.cpp deleted file mode 100644 index 2f84d83..0000000 --- a/examples/activeqt/mediaplayer/main.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#include <QApplication> -#include <QMessageBox> -#include <QMainWindow> -#include <QScreen> -#include <QVariant> -#include <QSettings> -#include <QFileDialog> -#include <QCommandLineParser> - -#include "ui_mainwindow.h" - -static const char geometryKey[] = "Geometry"; - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - MainWindow(); - ~MainWindow(); - void openMedia(const QString &mediaUrl); - -public slots: - void on_mediaPlayer_PlayStateChange(int newState); - void on_actionOpen_triggered(); - void on_actionExit_triggered(); - void on_actionAbout_triggered(); - void on_actionAboutQt_triggered(); - -private: - void updateWindowTitle(const QString &state); - Ui::MainWindow m_ui; -}; - -MainWindow::MainWindow() -{ - m_ui.setupUi(this); - - QSettings settings(QSettings::IniFormat, QSettings::UserScope, - QCoreApplication::organizationName(), QCoreApplication::applicationName()); - - const QByteArray restoredGeometry = settings.value(QLatin1String(geometryKey)).toByteArray(); - if (restoredGeometry.isEmpty() || !restoreGeometry(restoredGeometry)) { - const QRect availableGeometry = screen()->availableGeometry(); - const QSize size = (availableGeometry.size() * 4) / 5; - resize(size); - move(availableGeometry.center() - QPoint(size.width(), size.height()) / 2); - } - - m_ui.mediaPlayer->dynamicCall("enableContextMenu", false); - m_ui.mediaPlayer->dynamicCall("stretchToFit", true); - updateWindowTitle(""); -} - -MainWindow::~MainWindow() -{ - QSettings settings(QSettings::IniFormat, QSettings::UserScope, - QCoreApplication::organizationName(), QCoreApplication::applicationName()); - settings.setValue(QLatin1String(geometryKey), saveGeometry()); -} - -void MainWindow::on_mediaPlayer_PlayStateChange(int newState) -{ - static const QHash<int, const char *> stateMapping { - {1, "Stopped"}, - {2, "Paused"}, - {3, "Playing"}, - {4, "Scanning Forwards"}, - {5, "Scanning Backwards"}, - {6, "Buffering"}, - {7, "Waiting"}, - {8, "Media Ended"}, - {9, "Transitioning"}, - {10, "Ready"}, - {11, "Reconnecting"}, - }; - const char *stateStr = stateMapping.value(newState, ""); - updateWindowTitle(tr(stateStr)); -} - -void MainWindow::on_actionOpen_triggered() -{ - QFileDialog fileDialog(this, tr("Open File")); - fileDialog.setAcceptMode(QFileDialog::AcceptOpen); - fileDialog.setFileMode(QFileDialog::ExistingFile); - fileDialog.setMimeTypeFilters({ "application/octet-stream", "video/x-msvideo", "video/mp4", "audio/mpeg", "audio/mp4" }); - if (fileDialog.exec() == QDialog::Accepted) - openMedia(fileDialog.selectedFiles().first()); -} - -void MainWindow::on_actionExit_triggered() -{ - QCoreApplication::quit(); -} - -void MainWindow::on_actionAbout_triggered() -{ - QMessageBox::about(this, tr("About Media Player"), - tr("This Example has been created using the ActiveQt integration into Qt Designer.\n" - "It demonstrates the use of QAxWidget to embed the Windows Media Player ActiveX\n" - "control into a Qt application.")); -} - -void MainWindow::on_actionAboutQt_triggered() -{ - QMessageBox::aboutQt(this, tr("About Qt")); -} - -void MainWindow::openMedia(const QString &mediaUrl) -{ - if (!mediaUrl.isEmpty()) - m_ui.mediaPlayer->dynamicCall("URL", mediaUrl); -} - -void MainWindow::updateWindowTitle(const QString &state) -{ - QString appName = QCoreApplication::applicationName(); - QString title = state.isEmpty() ? appName : - QString("%1 (%2)").arg(appName, state); - setWindowTitle(title); -} - -#include "main.moc" - -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")); - QCoreApplication::setOrganizationName(QLatin1String("QtProject")); - - MainWindow w; - QCommandLineParser parser; - parser.setApplicationDescription(QCoreApplication::applicationName()); - parser.addHelpOption(); - parser.addVersionOption(); - parser.addPositionalArgument("file", "The media file to open."); - parser.process(app); - if (!parser.positionalArguments().isEmpty()) - w.openMedia(parser.positionalArguments().constFirst()); - w.show(); - return app.exec(); -} diff --git a/examples/activeqt/mediaplayer/mainwindow.ui b/examples/activeqt/mediaplayer/mainwindow.ui deleted file mode 100644 index b83d392..0000000 --- a/examples/activeqt/mediaplayer/mainwindow.ui +++ /dev/null @@ -1,147 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>794</width> - <height>599</height> - </rect> - </property> - <property name="acceptDrops"> - <bool>true</bool> - </property> - <property name="windowTitle"> - <string>Qt Media Player</string> - </property> - <widget class="QWidget" name="centralWidget"> - <layout class="QHBoxLayout" name="unnamed"> - <property name="spacing"> - <number>6</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QFrame" name="Frame"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <layout class="QVBoxLayout" name="unnamed"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>1</number> - </property> - <property name="topMargin"> - <number>1</number> - </property> - <property name="rightMargin"> - <number>1</number> - </property> - <property name="bottomMargin"> - <number>1</number> - </property> - <item> - <widget class="MediaAxWidget" name="mediaPlayer"> - <property name="control" stdset="0"> - <string>{6bf52a52-394a-11d3-b153-00c04f79faa6}</string> - </property> - <property name="sizePolicy" stdset="0"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>794</width> - <height>21</height> - </rect> - </property> - <widget class="QMenu" name="PopupMenu"> - <property name="title"> - <string>&File</string> - </property> - <addaction name="actionOpen"/> - <addaction name="actionExit"/> - </widget> - <widget class="QMenu" name="menuHelp"> - <property name="title"> - <string>&Help</string> - </property> - <addaction name="actionAbout"/> - <addaction name="actionAboutQt"/> - </widget> - <addaction name="PopupMenu"/> - <addaction name="menuHelp"/> - </widget> - <action name="actionOpen"> - <property name="text"> - <string>&Open</string> - </property> - </action> - <action name="actionExit"> - <property name="text"> - <string>E&xit</string> - </property> - </action> - <action name="actionAbout"> - <property name="text"> - <string>&About</string> - </property> - </action> - <action name="actionAboutQt"> - <property name="text"> - <string>About &Qt</string> - </property> - </action> - <actiongroup name="FileNewGroup"/> - </widget> - <layoutdefault spacing="6" margin="11"/> - <customwidgets> - <customwidget> - <class>QAxWidget</class> - <extends>QWidget</extends> - <header>qaxwidget.h</header> - </customwidget> - <customwidget> - <class>MediaAxWidget</class> - <extends>QAxWidget</extends> - <header>mediaaxwidget.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> 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/mediaplayer/mediaplayer.pro b/examples/activeqt/mediaplayer/mediaplayer.pro deleted file mode 100644 index ad787a3..0000000 --- a/examples/activeqt/mediaplayer/mediaplayer.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = app - -QT += widgets axcontainer - -HEADERS = mediaaxwidget.h -SOURCES = main.cpp -FORMS = mainwindow.ui - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/mediaplayer -INSTALLS += target 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/fileopen.xpm b/examples/activeqt/menus/fileopen.xpm deleted file mode 100644 index 880417e..0000000 --- a/examples/activeqt/menus/fileopen.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static const char *fileopen[] = { -" 16 13 5 1", -". c #040404", -"# c #808304", -"a c None", -"b c #f3f704", -"c c #f3f7f3", -"aaaaaaaaa...aaaa", -"aaaaaaaa.aaa.a.a", -"aaaaaaaaaaaaa..a", -"a...aaaaaaaa...a", -".bcb.......aaaaa", -".cbcbcbcbc.aaaaa", -".bcbcbcbcb.aaaaa", -".cbcb...........", -".bcb.#########.a", -".cb.#########.aa", -".b.#########.aaa", -"..#########.aaaa", -"...........aaaaa" -}; diff --git a/examples/activeqt/menus/filesave.xpm b/examples/activeqt/menus/filesave.xpm deleted file mode 100644 index bd6870f..0000000 --- a/examples/activeqt/menus/filesave.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static const char *filesave[] = { -" 14 14 4 1", -". c #040404", -"# c #808304", -"a c #bfc2bf", -"b c None", -"..............", -".#.aaaaaaaa.a.", -".#.aaaaaaaa...", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".##........##.", -".############.", -".##.........#.", -".##......aa.#.", -".##......aa.#.", -".##......aa.#.", -"b............." -}; 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.cpp b/examples/activeqt/menus/menus.cpp deleted file mode 100644 index 18d1a5b..0000000 --- a/examples/activeqt/menus/menus.cpp +++ /dev/null @@ -1,187 +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 <QAction> -#include <QAxFactory> -#include <QMenuBar> -#include <QMessageBox> -#include <QTextEdit> -#include <QPixmap> - -#include "fileopen.xpm" -#include "filesave.xpm" - -QMenus::QMenus(QWidget *parent) - : QMainWindow(parent, {}) // QMainWindow's default flag is WType_TopLevel -{ - QAction *action; - - QMenu *file = new QMenu(this); - - action = new QAction(QPixmap((const char**)fileopen), tr("&Open"), this); - action->setShortcut(tr("CTRL+O")); - connect(action, &QAction::triggered, this, &QMenus::fileOpen); - file->addAction(action); - - action = new QAction(QPixmap((const char**)filesave), tr("&Save"), this); - action->setShortcut(tr("CTRL+S")); - connect(action, &QAction::triggered, this, &QMenus::fileSave); - file->addAction(action); - - QMenu *edit = new QMenu(this); - - action = new QAction(tr("&Normal"), this); - action->setShortcut(tr("CTRL+N")); - action->setToolTip(tr("Normal")); - action->setStatusTip(tr("Toggles Normal")); - action->setCheckable(true); - connect(action, &QAction::triggered, this, &QMenus::editNormal); - edit->addAction(action); - - action = new QAction(tr("&Bold"), this); - action->setShortcut(tr("CTRL+B")); - action->setCheckable(true); - connect(action, &QAction::triggered, this, &QMenus::editBold); - edit->addAction(action); - - action = new QAction(tr("&Underline"), this); - action->setShortcut(tr("CTRL+U")); - action->setCheckable(true); - connect(action, &QAction::triggered, this, &QMenus::editUnderline); - edit->addAction(action); - - QMenu *advanced = new QMenu(this); - action = new QAction(tr("&Font..."), this); - connect(action, &QAction::triggered, this, &QMenus::editAdvancedFont); - advanced->addAction(action); - - action = new QAction(tr("&Style..."), this); - connect(action, &QAction::triggered, this, &QMenus::editAdvancedStyle); - advanced->addAction(action); - - edit->addMenu(advanced)->setText(tr("&Advanced")); - - edit->addSeparator(); - - action = new QAction(tr("Una&vailable"), this); - action->setShortcut(tr("CTRL+V")); - action->setCheckable(true); - action->setEnabled(false); - connect(action, &QAction::triggered, this, &QMenus::editUnderline); - edit->addAction(action); - - QMenu *help = new QMenu(this); - - action = new QAction(tr("&About..."), this); - action->setShortcut(tr("F1")); - connect(action, &QAction::triggered, this, &QMenus::helpAbout); - help->addAction(action); - - action = new QAction(tr("&About Qt..."), this); - connect(action, &QAction::triggered, this, &QMenus::helpAboutQt); - help->addAction(action); - - if (!QAxFactory::isServer()) - menuBar()->addMenu(file)->setText(tr("&File")); - menuBar()->addMenu(edit)->setText(tr("&Edit")); - menuBar()->addMenu(help)->setText(tr("&Help")); - - m_editor = new QTextEdit(this); - setCentralWidget(m_editor); - - statusBar(); -} - -void QMenus::fileOpen() -{ - m_editor->append(tr("File Open selected.")); -} - -void QMenus::fileSave() -{ - m_editor->append(tr("File Save selected.")); -} - -void QMenus::editNormal() -{ - m_editor->append(tr("Edit Normal selected.")); -} - -void QMenus::editBold() -{ - m_editor->append(tr("Edit Bold selected.")); -} - -void QMenus::editUnderline() -{ - m_editor->append(tr("Edit Underline selected.")); -} - -void QMenus::editAdvancedFont() -{ - m_editor->append(tr("Edit Advanced Font selected.")); -} - -void QMenus::editAdvancedStyle() -{ - m_editor->append(tr("Edit Advanced Style selected.")); -} - -void QMenus::helpAbout() -{ - QMessageBox::about(this, tr("About QMenus"), - tr("This example implements an in-place ActiveX control with menus and status messages.")); -} - -void QMenus::helpAboutQt() -{ - QMessageBox::aboutQt(this); -} diff --git a/examples/activeqt/menus/menus.def b/examples/activeqt/menus/menus.def deleted file mode 100644 index bc82a03..0000000 --- a/examples/activeqt/menus/menus.def +++ /dev/null @@ -1,6 +0,0 @@ -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - DumpIDL PRIVATE 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/menus/menus.ico b/examples/activeqt/menus/menus.ico Binary files differdeleted file mode 100644 index c80d36a..0000000 --- a/examples/activeqt/menus/menus.ico +++ /dev/null diff --git a/examples/activeqt/menus/menus.inf b/examples/activeqt/menus/menus.inf deleted file mode 100644 index f97efe8..0000000 --- a/examples/activeqt/menus/menus.inf +++ /dev/null @@ -1,9 +0,0 @@ -[version] - signature="$CHICAGO$" - AdvancedINF=2.0 - [Add.Code] - menusax.exe=menusax.exe - [menusax.exe] - file-win32-x86=thiscab - clsid={4dc3f340-a6f7-44e4-a79b-3e9217695fbd} - RegisterServer=yes diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro deleted file mode 100644 index f5a7890..0000000 --- a/examples/activeqt/menus/menus.pro +++ /dev/null @@ -1,16 +0,0 @@ -include(../shared.pri) - -TEMPLATE = app -TARGET = menusax - -CONFIG += warn_off -QT += widgets axserver - -SOURCES = main.cpp menus.cpp -HEADERS = menus.h -RC_FILE = menus.rc -DEF_FILE = menus.def - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus -INSTALLS += target diff --git a/examples/activeqt/menus/menus.rc b/examples/activeqt/menus/menus.rc deleted file mode 100644 index d466b35..0000000 --- a/examples/activeqt/menus/menus.rc +++ /dev/null @@ -1,2 +0,0 @@ -1 TYPELIB "menus.rc" -1 ICON "menus.ico" 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/doc/src/multiple.qdoc b/examples/activeqt/multiple/doc/src/multiple.qdoc deleted file mode 100644 index bf9c832..0000000 --- a/examples/activeqt/multiple/doc/src/multiple.qdoc +++ /dev/null @@ -1,70 +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-multiple.html - \title Two Simple Qt Widgets - - \input multiple-demo.qdocinc -*/ - -/*! - \example activeqt/multiple - \title Multiple Example (ActiveQt) - - \brief The Multiple example demonstrates the implementation of a - QAxFactory to provide multiple ActiveX controls in a single in - process ActiveX server using the \c QAXFACTORY_EXPORT() macro. - The ActiveX controls in this example are simple QWidget - subclasses that reimplement QWidget::paintEvent(). - - \snippet activeqt/multiple/ax1.h 0 - - The first control draws a filled rectangle. The fill color is exposed - as a property. \c Q_CLASSINFO() is used to specify the COM identifiers. - - \snippet activeqt/multiple/ax2.h 0 - - The second control draws a circle. The linewith is exposed as a property. - \c Q_CLASSINFO() is used to specify the COM identifiers, and to set the - attributes \e ToSuperClass and \e StockEvents to expose only the API of - the class itself, and to add COM stock events to the ActiveX control. - - \snippet activeqt/multiple/main.cpp 0 - - The classes are exported from the server using the QAxFactory macros. - - To build the example you must first build the QAxServer library. - Then run \c qmake and your make tool in \c - examples/activeqt/multiple. - - The \l{Two Simple Qt Widgets} demonstration requires your - WebBrowser to support ActiveX controls, and scripting to be - enabled. - - \input multiple-demo.qdocinc -*/ 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/multiple/multiple.inf b/examples/activeqt/multiple/multiple.inf deleted file mode 100644 index 7f6be76..0000000 --- a/examples/activeqt/multiple/multiple.inf +++ /dev/null @@ -1,9 +0,0 @@ -[version] - signature="$CHICAGO$" - AdvancedINF=2.0 - [Add.Code] - multipleax.dll=multipleax.dll - [multipleax.dll] - file-win32-x86=thiscab - clsid={1D9928BD-4453-4bdd-903D-E525ED17FDE5} - RegisterServer=yes diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro deleted file mode 100644 index f08d3a2..0000000 --- a/examples/activeqt/multiple/multiple.pro +++ /dev/null @@ -1,16 +0,0 @@ -include(../shared.pri) - -TEMPLATE = lib -TARGET = multipleax - -CONFIG += warn_off dll -QT += widgets axserver - -SOURCES = main.cpp -HEADERS = ax1.h ax2.h -RC_FILE = multipleax.rc -DEF_FILE = multipleax.def - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple -INSTALLS += target diff --git a/examples/activeqt/multiple/multipleax.def b/examples/activeqt/multiple/multipleax.def deleted file mode 100644 index bc82a03..0000000 --- a/examples/activeqt/multiple/multipleax.def +++ /dev/null @@ -1,6 +0,0 @@ -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - DumpIDL PRIVATE diff --git a/examples/activeqt/multiple/multipleax.ico b/examples/activeqt/multiple/multipleax.ico Binary files differdeleted file mode 100644 index c80d36a..0000000 --- a/examples/activeqt/multiple/multipleax.ico +++ /dev/null diff --git a/examples/activeqt/multiple/multipleax.rc b/examples/activeqt/multiple/multipleax.rc deleted file mode 100644 index a9bcc1a..0000000 --- a/examples/activeqt/multiple/multipleax.rc +++ /dev/null @@ -1,32 +0,0 @@ -#include "winver.h" - -1 TYPELIB "multipleax.rc" -1 ICON "multipleax.ico" - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,0 - PRODUCTVERSION 1,0,0,0 - FILEFLAGSMASK 0x3fL - FILEOS 0x00040000L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "The Qt Company Ltd." - VALUE "FileDescription", "Multiple Example (ActiveQt)" - VALUE "FileVersion", "1.0.0.0" - VALUE "LegalCopyright", "Copyright (C) 2015 The Qt Company Ltd." - VALUE "InternalName", "multipleax.dll" - VALUE "OriginalFilename", "multipleax.dll" - VALUE "ProductName", "Multiple Example (ActiveQt)" - VALUE "ProductVersion", "1.0.0.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END 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/doc/src/opengl.qdoc b/examples/activeqt/opengl/doc/src/opengl.qdoc deleted file mode 100644 index 000d864..0000000 --- a/examples/activeqt/opengl/doc/src/opengl.qdoc +++ /dev/null @@ -1,129 +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-opengl.html - - \title OpenGL in an HTML page - - \raw HTML - <SCRIPT LANGUAGE="JavaScript"> - function setRot( form ) - { - GLBox.setXRotation( form.XEdit.value ); - GLBox.setYRotation( form.YEdit.value ); - GLBox.setZRotation( form.ZEdit.value ); - } - </SCRIPT> - - <p /> - An OpenGL scene:<br /> - <object ID="GLBox" CLASSID="CLSID:5fd9c22e-ed45-43fa-ba13-1530bb6b03e0" - CODEBASE="http://www.qt-project.org/demos/openglax.cab"> - [Object not available! Did you forget to build and register the server?] - </object><br /> - - <form> - Rotate the scene:<br /> - X:<input type="edit" ID="XEdit" value="0" /><br /> - Y:<input type="edit" name="YEdit" value="0" /><br /> - Z:<input type="edit" name="ZEdit" value="0" /><br /> - <input type="button" value="Set" onClick="setRot(this.form)" /> - </form> - \endraw -*/ - -/*! - \example activeqt/opengl - \title OpenGL Example (ActiveQt) - - \brief The OpenGL example demonstrates the use of the default factory - and QAxFactory::isServer(), and the implementation of an - additional COM interface using QAxBindable and QAxAggregated. - The server executable can run both as an ActiveX server and as a - stand-alone application. - - The ActiveX control in this example uses the QGlWidget class in - Qt to render an OpenGL scene in an ActiveX. The control exposes a few - methods to change the scene. - - The application uses QAxFactory through the \c QAXFACTORY_BEGIN(), - \c QAXCLASS() and \c QAXFACTORY_END() macros to expose the - \c GLBox widget as an ActiveX control. - \snippet activeqt/opengl/main.cpp 0 - The implementation of \c main initializes the QApplication object, - and uses \c QAxFactory::isServer() to determine whether or not it is - appropriate to create and show the application interface. - \snippet activeqt/opengl/main.cpp 1 - \snippet activeqt/opengl/main.cpp 2 - \snippet activeqt/opengl/main.cpp 3 - - The \c GLBox class inherits from both the \l QOpenGLWidget class to be able - to render OpenGL, and from \l QAxBindable. - \snippet activeqt/opengl/glbox.h 0 - The class reimplements the \l QAxBindable::createAggregate() function from QAxBindable - to return the pointer to a \l QAxAggregated object. - \snippet activeqt/opengl/glbox.h 1 - - The implementation file of the \c GLBox class includes the \c objsafe.h - system header, in which the \c IObjectSafety COM interface is defined. - \snippet activeqt/opengl/glbox.cpp 0 - A class \c ObjectSafetyImpl is declared using multiple inheritance - to subclass the QAxAggregated class, and to implement the IObjectSafety - interface. - \snippet activeqt/opengl/glbox.cpp 1 - The class declares a default constructor, and implements the queryInterface - function to support the IObjectSafety interface. - \snippet activeqt/opengl/glbox.cpp 2 - Since every COM interface inherits \c IUnknown the \c QAXAGG_IUNKNOWN macro - is used to provide the default implementation of the \c IUnknown interface. - The macro is defined to delegate all calls to \c QueryInterface, \c AddRef - and \c Release to the interface returned by the controllingUnknown() function. - \snippet activeqt/opengl/glbox.cpp 3 - The implementation of the \c IObjectSafety interface provides the caller - with information about supported and enabled safety options, and returns - \c S_OK for all calls to indicate that the ActiveX control is safe. - \snippet activeqt/opengl/glbox.cpp 4 - The implementation of the \c createAggregate() function just returns a new - \c ObjectSafetyImpl object. - \snippet activeqt/opengl/glbox.cpp 5 - - To build the example you must first build the QAxServer library. - Then run \c qmake and your make tool in \c - examples/activeqt/wrapper. - - The \l{qaxserver-demo-opengl.html}{demonstration} requires your - WebBrowser to support ActiveX controls, and scripting to be - enabled. - - In contrast to the other QAxServer examples Internet Explorer will not - open a dialog box to ask the user whether or not the scripting of the GLBox - control should be allowed (the exact browser behaviour depends on the security - settings in the Internet Options dialog). - - \input doc/src/examples/opengl-demo.qdocinc -*/ diff --git a/examples/activeqt/opengl/glbox.cpp b/examples/activeqt/opengl/glbox.cpp deleted file mode 100644 index 3694bd8..0000000 --- a/examples/activeqt/opengl/glbox.cpp +++ /dev/null @@ -1,265 +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 -** -** The OpenGL code is mostly borrowed from Brian Pauls "spin" example -** in the Mesa distribution -** -****************************************************************************/ - -#include "glbox.h" -#include <QAxAggregated> -#include <QUuid> -//! [0] -#include <objsafe.h> -//! [0] - -/*! - Create a GLBox widget -*/ - -GLBox::GLBox(QWidget *parent, const char *name) - : QOpenGLWidget(parent) -{ - setObjectName(name); - - QSurfaceFormat format; - format.setVersion(1, 1); - format.setProfile(QSurfaceFormat::CompatibilityProfile); - setFormat(format); -} - - -/*! - Release allocated resources -*/ - -GLBox::~GLBox() -{ - makeCurrent(); - - if (m_object) - glDeleteLists(m_object, 1); -} - - -/*! - Paint the box. The actual openGL commands for drawing the box are - performed here. -*/ - -void GLBox::paintGL() -{ - glClear(GL_COLOR_BUFFER_BIT); - - glLoadIdentity(); - glTranslated(0, 0, -10); - glScaled(m_scale, m_scale, m_scale); - - glRotated(m_xRot, 1, 0, 0); - glRotated(m_yRot, 0, 1, 0); - glRotated(m_zRot, 0, 0, 1); - - glCallList(m_object); -} - - -/*! - Set up the OpenGL rendering state, and define display list -*/ - -void GLBox::initializeGL() -{ - initializeOpenGLFunctions(); - glClearColor(0, 0, 0, 1); // Let OpenGL clear to black - m_object = makeObject(); // Generate an OpenGL display list - glShadeModel(GL_FLAT); -} - - - -/*! - Set up the OpenGL view port, matrix mode, etc. -*/ - -void GLBox::resizeGL(int w, int h) -{ - glViewport(0, 0, (GLint)w, (GLint)h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 5, 15); - glMatrixMode(GL_MODELVIEW); -} - - -/*! - Generate an OpenGL display list for the object to be shown, i.e. the box -*/ - -GLuint GLBox::makeObject() -{ - GLuint list; - - list = glGenLists(1); - - glNewList(list, GL_COMPILE); - - glColor3d(1, 1, 1); // Shorthand for glColor3f or glIndex - - glLineWidth(2); - - glBegin(GL_LINE_LOOP); - glVertex3d( 1, 0.5, -0.4); - glVertex3d( 1, -0.5, -0.4); - glVertex3d(-1, -0.5, -0.4); - glVertex3d(-1, 0.5, -0.4); - glEnd(); - - glBegin(GL_LINE_LOOP); - glVertex3d( 1, 0.5, 0.4); - glVertex3d( 1, -0.5, 0.4); - glVertex3d(-1, -0.5, 0.4); - glVertex3d(-1, 0.5, 0.4); - glEnd(); - - glBegin(GL_LINES); - glVertex3d( 1, 0.5, -0.4); glVertex3d( 1, 0.5, 0.4); - glVertex3d( 1, -0.5, -0.4); glVertex3d( 1, -0.5, 0.4); - glVertex3d(-1, -0.5, -0.4); glVertex3d(-1, -0.5, 0.4); - glVertex3d(-1, 0.5, -0.4); glVertex3d(-1, 0.5, 0.4); - glEnd(); - - glEndList(); - - return list; -} - - -/*! - Set the rotation angle of the object to \e degrees around the X axis. -*/ - -void GLBox::setXRotation(int degrees) -{ - m_xRot = GLdouble(degrees % 360); - update(); -} - - -/*! - Set the rotation angle of the object to \e degrees around the Y axis. -*/ - -void GLBox::setYRotation(int degrees) -{ - m_yRot = GLdouble(degrees % 360); - update(); -} - - -/*! - Set the rotation angle of the object to \e degrees around the Z axis. -*/ - -void GLBox::setZRotation(int degrees) -{ - m_zRot = GLdouble(degrees % 360); - update(); -} - -//! [1] -class ObjectSafetyImpl : public QAxAggregated, - public IObjectSafety -{ -public: -//! [1] //! [2] - explicit ObjectSafetyImpl() = default; - - long queryInterface(const QUuid &iid, void **iface) override - { - *iface = nullptr; - if (iid != IID_IObjectSafety) - return E_NOINTERFACE; - - *iface = static_cast<IObjectSafety*>(this); - AddRef(); - return S_OK; - } - -//! [2] //! [3] - QAXAGG_IUNKNOWN; - -//! [3] //! [4] - HRESULT WINAPI GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override - { - Q_UNUSED(riid); - *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER; - *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER; - return S_OK; - } - - HRESULT WINAPI SetInterfaceSafetyOptions(REFIID riid, DWORD pdwSupportedOptions, DWORD pdwEnabledOptions) override - { - Q_UNUSED(riid); - Q_UNUSED(pdwSupportedOptions); - Q_UNUSED(pdwEnabledOptions); - return S_OK; - } -}; -//! [4] //! [5] - -QAxAggregated *GLBox::createAggregate() -{ - return new ObjectSafetyImpl(); -} -//! [5] 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/opengl/opengl.def b/examples/activeqt/opengl/opengl.def deleted file mode 100644 index bc82a03..0000000 --- a/examples/activeqt/opengl/opengl.def +++ /dev/null @@ -1,6 +0,0 @@ -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - DumpIDL PRIVATE diff --git a/examples/activeqt/opengl/opengl.ico b/examples/activeqt/opengl/opengl.ico Binary files differdeleted file mode 100644 index c80d36a..0000000 --- a/examples/activeqt/opengl/opengl.ico +++ /dev/null diff --git a/examples/activeqt/opengl/opengl.inf b/examples/activeqt/opengl/opengl.inf deleted file mode 100644 index 4a79e67..0000000 --- a/examples/activeqt/opengl/opengl.inf +++ /dev/null @@ -1,9 +0,0 @@ -[version] - signature="$CHICAGO$" - AdvancedINF=2.0 - [Add.Code] - openglax.exe=openglax.exe - [openglax.exe] - file-win32-x86=thiscab - clsid={5fd9c22e-ed45-43fa-ba13-1530bb6b03e0} - RegisterServer=yes diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro deleted file mode 100644 index 1ece9b9..0000000 --- a/examples/activeqt/opengl/opengl.pro +++ /dev/null @@ -1,18 +0,0 @@ -TEMPLATE = app -TARGET = openglax - -CONFIG += warn_off -QT += widgets axserver opengl openglwidgets - -HEADERS = glbox.h \ - globjwin.h -SOURCES = glbox.cpp \ - globjwin.cpp \ - main.cpp - -RC_FILE = opengl.rc -DEF_FILE = opengl.def - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl -INSTALLS += target diff --git a/examples/activeqt/opengl/opengl.rc b/examples/activeqt/opengl/opengl.rc deleted file mode 100644 index 02c0898..0000000 --- a/examples/activeqt/opengl/opengl.rc +++ /dev/null @@ -1,2 +0,0 @@ -1 TYPELIB "opengl.rc" -1 ICON "opengl.ico" diff --git a/examples/activeqt/qutlook/CMakeLists.txt b/examples/activeqt/qutlook/CMakeLists.txt index 3373330..f561997 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: LicenseRef-Qt-Commercial OR 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..29c5fad 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: LicenseRef-Qt-Commercial OR 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 Binary files differdeleted file mode 100644 index c80d36a..0000000 --- a/examples/activeqt/simpleqml/simpleqml.ico +++ /dev/null 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..5cba1a6 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: LicenseRef-Qt-Commercial OR 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> |