diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-04 08:15:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-04 08:29:54 +0000 |
commit | 9768da0be5a09632c60c4e4035fa52b9c55376df (patch) | |
tree | d9e0d8545e08597f208cda183787b51028fa0680 /examples/xmlpatterns | |
parent | f47818b5c710aa6ae5f76809046105cb8c3d9f7f (diff) |
Remove QtScript, QtXmlPatterns
They are obsolete in Qt 6.
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Change-Id: I70816b3c3270a1db65ad3b3871a09c62d31420e5
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/xmlpatterns')
-rw-r--r-- | examples/xmlpatterns/schema/files/contact.xsd | 25 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/invalid_contact.xml | 11 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/invalid_order.xml | 13 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/invalid_recipe.xml | 14 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/order.xsd | 23 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/recipe.xsd | 40 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/valid_contact.xml | 11 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/valid_order.xml | 18 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/files/valid_recipe.xml | 13 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema.py | 286 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema.pyproject | 4 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema.qrc | 13 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema.ui | 71 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/schema_rc.py | 394 | ||||
-rw-r--r-- | examples/xmlpatterns/schema/ui_schema.py | 88 |
15 files changed, 0 insertions, 1024 deletions
diff --git a/examples/xmlpatterns/schema/files/contact.xsd b/examples/xmlpatterns/schema/files/contact.xsd deleted file mode 100644 index 3e1b5704c..000000000 --- a/examples/xmlpatterns/schema/files/contact.xsd +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - - <xsd:element name="contact"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="givenName" type="xsd:string"/> - <xsd:element name="familyName" type="xsd:string"/> - <xsd:element name="birthdate" type="xsd:date" minOccurs="0"/> - <xsd:element name="homeAddress" type="address"/> - <xsd:element name="workAddress" type="address" minOccurs="0"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - - <xsd:complexType name="address"> - <xsd:sequence> - <xsd:element name="street" type="xsd:string"/> - <xsd:element name="zipCode" type="xsd:string"/> - <xsd:element name="city" type="xsd:string"/> - <xsd:element name="country" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - -</xsd:schema> diff --git a/examples/xmlpatterns/schema/files/invalid_contact.xml b/examples/xmlpatterns/schema/files/invalid_contact.xml deleted file mode 100644 index 42f1edd67..000000000 --- a/examples/xmlpatterns/schema/files/invalid_contact.xml +++ /dev/null @@ -1,11 +0,0 @@ -<contact> - <givenName>John</givenName> - <familyName>Doe</familyName> - <title>Prof.</title> - <workAddress> - <street>Sandakerveien 116</street> - <zipCode>N-0550</zipCode> - <city>Oslo</city> - <country>Norway</country> - </workAddress> -</contact> diff --git a/examples/xmlpatterns/schema/files/invalid_order.xml b/examples/xmlpatterns/schema/files/invalid_order.xml deleted file mode 100644 index 8ffc5fda4..000000000 --- a/examples/xmlpatterns/schema/files/invalid_order.xml +++ /dev/null @@ -1,13 +0,0 @@ -<order> - <customerId>234219</customerId> - <article> - <articleId>21692</articleId> - <count>3</count> - </article> - <article> - <articleId>24749</articleId> - <count>9</count> - </article> - <deliveryDate>2009-01-23</deliveryDate> - <payed>yes</payed> -</order> diff --git a/examples/xmlpatterns/schema/files/invalid_recipe.xml b/examples/xmlpatterns/schema/files/invalid_recipe.xml deleted file mode 100644 index 4d75af6a1..000000000 --- a/examples/xmlpatterns/schema/files/invalid_recipe.xml +++ /dev/null @@ -1,14 +0,0 @@ -<recipe> - <title>Cheese on Toast</title> - <ingredient name="Bread" quantity="2" unit="slices"/> - <ingredient name="Cheese" quantity="2" unit="slices"/> - <time quantity="3" unit="days"/> - <method> - <step>1. Slice the bread and cheese.</step> - <step>2. Grill one side of each slice of bread.</step> - <step>3. Turn over the bread and place a slice of cheese on each piece.</step> - <step>4. Grill until the cheese has started to melt.</step> - <step>5. Serve and enjoy!</step> - </method> - <comment>Tell your friends about it!</comment> -</recipe> diff --git a/examples/xmlpatterns/schema/files/order.xsd b/examples/xmlpatterns/schema/files/order.xsd deleted file mode 100644 index 405cafe43..000000000 --- a/examples/xmlpatterns/schema/files/order.xsd +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - - <xsd:element name="order"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="customerId" type="xsd:positiveInteger"/> - <xsd:element name="article" type="articleType" maxOccurs="unbounded"/> - <xsd:element name="deliveryDate" type="xsd:date"/> - <xsd:element name="payed" type="xsd:boolean"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - - <xsd:complexType name="articleType"> - <xsd:sequence> - <xsd:element name="articleId" type="xsd:positiveInteger"/> - <xsd:element name="count" type="xsd:positiveInteger"/> - <xsd:element name="comment" type="xsd:string" minOccurs="0"/> - </xsd:sequence> - </xsd:complexType> - -</xsd:schema> diff --git a/examples/xmlpatterns/schema/files/recipe.xsd b/examples/xmlpatterns/schema/files/recipe.xsd deleted file mode 100644 index bbbafd9a3..000000000 --- a/examples/xmlpatterns/schema/files/recipe.xsd +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0"?> -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - - <xsd:element name="recipe"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="title" type="xsd:string"/> - <xsd:element name="ingredient" type="ingredientType" maxOccurs="unbounded"/> - <xsd:element name="time" type="timeType"/> - <xsd:element name="method"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="step" type="xsd:string" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - - <xsd:complexType name="ingredientType"> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="quantity" type="xsd:positiveInteger"/> - <xsd:attribute name="unit" type="xsd:string"/> - </xsd:complexType> - - <xsd:complexType name="timeType"> - <xsd:attribute name="quantity" type="xsd:positiveInteger"/> - <xsd:attribute name="unit"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="seconds"/> - <xsd:enumeration value="minutes"/> - <xsd:enumeration value="hours"/> - </xsd:restriction> - </xsd:simpleType> - </xsd:attribute> - </xsd:complexType> - -</xsd:schema> diff --git a/examples/xmlpatterns/schema/files/valid_contact.xml b/examples/xmlpatterns/schema/files/valid_contact.xml deleted file mode 100644 index 53c04d4b5..000000000 --- a/examples/xmlpatterns/schema/files/valid_contact.xml +++ /dev/null @@ -1,11 +0,0 @@ -<contact> - <givenName>John</givenName> - <familyName>Doe</familyName> - <birthdate>1977-12-25</birthdate> - <homeAddress> - <street>Sandakerveien 116</street> - <zipCode>N-0550</zipCode> - <city>Oslo</city> - <country>Norway</country> - </homeAddress> -</contact> diff --git a/examples/xmlpatterns/schema/files/valid_order.xml b/examples/xmlpatterns/schema/files/valid_order.xml deleted file mode 100644 index f83c36cb1..000000000 --- a/examples/xmlpatterns/schema/files/valid_order.xml +++ /dev/null @@ -1,18 +0,0 @@ -<order> - <customerId>194223</customerId> - <article> - <articleId>22242</articleId> - <count>5</count> - </article> - <article> - <articleId>32372</articleId> - <count>12</count> - <comment>without stripes</comment> - </article> - <article> - <articleId>23649</articleId> - <count>2</count> - </article> - <deliveryDate>2009-01-23</deliveryDate> - <payed>true</payed> -</order> diff --git a/examples/xmlpatterns/schema/files/valid_recipe.xml b/examples/xmlpatterns/schema/files/valid_recipe.xml deleted file mode 100644 index f6499ba21..000000000 --- a/examples/xmlpatterns/schema/files/valid_recipe.xml +++ /dev/null @@ -1,13 +0,0 @@ -<recipe> - <title>Cheese on Toast</title> - <ingredient name="Bread" quantity="2" unit="slices"/> - <ingredient name="Cheese" quantity="2" unit="slices"/> - <time quantity="3" unit="minutes"/> - <method> - <step>1. Slice the bread and cheese.</step> - <step>2. Grill one side of each slice of bread.</step> - <step>3. Turn over the bread and place a slice of cheese on each piece.</step> - <step>4. Grill until the cheese has started to melt.</step> - <step>5. Serve and enjoy!</step> - </method> -</recipe> diff --git a/examples/xmlpatterns/schema/schema.py b/examples/xmlpatterns/schema/schema.py deleted file mode 100644 index d3c22c184..000000000 --- a/examples/xmlpatterns/schema/schema.py +++ /dev/null @@ -1,286 +0,0 @@ - -############################################################################# -## -## Copyright (C) 2013 Riverbank Computing Limited. -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the Qt for Python examples of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:BSD$ -## 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$ -## -############################################################################# - -from PySide2 import QtCore, QtGui, QtWidgets, QtXmlPatterns - -import schema_rc -from ui_schema import Ui_SchemaMainWindow - - -try: - # Python v2. - unicode - - def encode_utf8(ba): - return unicode(ba, encoding='utf8') - - def decode_utf8(qs): - return QtCore.QByteArray(str(qs)) - -except NameError: - # Python v3. - - def encode_utf8(ba): - return str(ba.data(), encoding='utf8') - - def decode_utf8(qs): - return QtCore.QByteArray(bytes(qs, encoding='utf8')) - - -class XmlSyntaxHighlighter(QtGui.QSyntaxHighlighter): - - def __init__(self, parent=None): - super(XmlSyntaxHighlighter, self).__init__(parent) - - self.highlightingRules = [] - - # Tag format. - format = QtGui.QTextCharFormat() - format.setForeground(QtCore.Qt.darkBlue) - format.setFontWeight(QtGui.QFont.Bold) - pattern = QtCore.QRegularExpression(r'(<[a-zA-Z:]+\b|<\?[a-zA-Z:]+\b|\?>|>|/>|</[a-zA-Z:]+>)') - assert pattern.isValid() - self.highlightingRules.append((pattern, format)) - - # Attribute format. - format = QtGui.QTextCharFormat() - format.setForeground(QtCore.Qt.darkGreen) - pattern = QtCore.QRegularExpression('[a-zA-Z:]+=') - assert pattern.isValid() - self.highlightingRules.append((pattern, format)) - - # Attribute content format. - format = QtGui.QTextCharFormat() - format.setForeground(QtCore.Qt.red) - pattern = QtCore.QRegularExpression("(\"[^\"]*\"|'[^']*')") - assert pattern.isValid() - self.highlightingRules.append((pattern, format)) - - # Comment format. - self.commentFormat = QtGui.QTextCharFormat() - self.commentFormat.setForeground(QtCore.Qt.lightGray) - self.commentFormat.setFontItalic(True) - - self.commentStartExpression = QtCore.QRegularExpression("<!--") - assert self.commentStartExpression.isValid() - self.commentEndExpression = QtCore.QRegularExpression("-->") - assert self.commentEndExpression.isValid() - - def highlightBlock(self, text): - for pattern, format in self.highlightingRules: - match = pattern.match(text) - while match.hasMatch(): - index = match.capturedStart() - length = match.capturedLength(0) - self.setFormat(index, length, format) - match = pattern.match(text, index + length) - - self.setCurrentBlockState(0) - - startIndex = 0 - if self.previousBlockState() != 1: - match = self.commentStartExpression.match(text) - startIndex = match.capturedStart(0) if match.hasMatch() else -1 - - while startIndex >= 0: - match = self.commentEndExpression.match(text, startIndex) - endIndex = match.capturedStart(0) if match.hasMatch() else -1 - if match.hasMatch(): - endIndex = match.capturedStart(0) - length = match.capturedLength(0) - commentLength = endIndex - startIndex + length - else: - self.setCurrentBlockState(1) - commentLength = text.length() - startIndex - - self.setFormat(startIndex, commentLength, self.commentFormat) - match = self.commentStartExpression.match(text, startIndex + commentLength) - startIndex = match.capturedStart(0) if match.hasMatch() else -1 - - -class MessageHandler(QtXmlPatterns.QAbstractMessageHandler): - - def __init__(self): - super(MessageHandler, self).__init__() - - self.m_description = "" - self.m_sourceLocation = QtXmlPatterns.QSourceLocation() - - def statusMessage(self): - return self.m_description - - def line(self): - return self.m_sourceLocation.line() - - def column(self): - return self.m_sourceLocation.column() - - def handleMessage(self, type, description, identifier, sourceLocation): - self.m_description = description - self.m_sourceLocation = sourceLocation - - -class MainWindow(QtWidgets.QMainWindow, Ui_SchemaMainWindow): - - def __init__(self): - QtWidgets.QMainWindow.__init__(self) - - self.setupUi(self) - - XmlSyntaxHighlighter(self.schemaView.document()) - XmlSyntaxHighlighter(self.instanceEdit.document()) - - self.schemaSelection.addItem("Contact Schema") - self.schemaSelection.addItem("Recipe Schema") - self.schemaSelection.addItem("Order Schema") - - self.instanceSelection.addItem("Valid Contact Instance") - self.instanceSelection.addItem("Invalid Contact Instance") - - self.schemaSelection.currentIndexChanged[int].connect(self.schemaSelected) - self.instanceSelection.currentIndexChanged[int].connect(self.instanceSelected) - self.validateButton.clicked.connect(self.validate) - self.instanceEdit.textChanged.connect(self.textChanged) - - self.validationStatus.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter) - - self.schemaSelected(0) - self.instanceSelected(0) - - def schemaSelected(self, index): - self.instanceSelection.clear() - - if index == 0: - self.instanceSelection.addItem("Valid Contact Instance") - self.instanceSelection.addItem("Invalid Contact Instance") - elif index == 1: - self.instanceSelection.addItem("Valid Recipe Instance") - self.instanceSelection.addItem("Invalid Recipe Instance") - elif index == 2: - self.instanceSelection.addItem("Valid Order Instance") - self.instanceSelection.addItem("Invalid Order Instance") - - self.textChanged() - - schemaFile = QtCore.QFile(':/schema_%d.xsd' % index) - schemaFile.open(QtCore.QIODevice.ReadOnly) - schemaData = schemaFile.readAll() - self.schemaView.setPlainText(encode_utf8(schemaData)) - - self.validate() - - def instanceSelected(self, index): - if index == -1: - return - - index += 2 * self.schemaSelection.currentIndex() - instanceFile = QtCore.QFile(':/instance_%d.xml' % index) - instanceFile.open(QtCore.QIODevice.ReadOnly) - instanceData = instanceFile.readAll() - self.instanceEdit.setPlainText(encode_utf8(instanceData)) - - self.validate() - - def validate(self): - schemaData = decode_utf8(self.schemaView.toPlainText()) - instanceData = decode_utf8(self.instanceEdit.toPlainText()) - - messageHandler = MessageHandler() - - schema = QtXmlPatterns.QXmlSchema() - schema.setMessageHandler(messageHandler) - schema.load(schemaData, QtCore.QUrl()) - - errorOccurred = False - if not schema.isValid(): - errorOccurred = True - else: - validator = QtXmlPatterns.QXmlSchemaValidator(schema) - if not validator.validate(instanceData): - errorOccurred = True - - if errorOccurred: - self.validationStatus.setText(messageHandler.statusMessage()) - self.moveCursor(messageHandler.line(), messageHandler.column()) - background = QtCore.Qt.red - else: - self.validationStatus.setText("validation successful") - background = QtCore.Qt.green - - styleSheet = 'QLabel {background: %s; padding: 3px}' % QtGui.QColor(background).lighter(160).name() - self.validationStatus.setStyleSheet(styleSheet) - - def textChanged(self): - self.instanceEdit.setExtraSelections([]) - - def moveCursor(self, line, column): - self.instanceEdit.moveCursor(QtGui.QTextCursor.Start) - - for i in range(1, line): - self.instanceEdit.moveCursor(QtGui.QTextCursor.Down) - - for i in range(1, column): - self.instanceEdit.moveCursor(QtGui.QTextCursor.Right) - - extraSelections = [] - selection = QtWidgets.QTextEdit.ExtraSelection() - - lineColor = QtGui.QColor(QtCore.Qt.red).lighter(160) - selection.format.setBackground(lineColor) - selection.format.setProperty(QtGui.QTextFormat.FullWidthSelection, True) - selection.cursor = self.instanceEdit.textCursor() - selection.cursor.clearSelection() - extraSelections.append(selection) - - self.instanceEdit.setExtraSelections(extraSelections) - - self.instanceEdit.setFocus() - - -if __name__ == '__main__': - - import sys - - app = QtWidgets.QApplication(sys.argv) - window = MainWindow() - window.show() - sys.exit(app.exec_()) diff --git a/examples/xmlpatterns/schema/schema.pyproject b/examples/xmlpatterns/schema/schema.pyproject deleted file mode 100644 index 697e58d70..000000000 --- a/examples/xmlpatterns/schema/schema.pyproject +++ /dev/null @@ -1,4 +0,0 @@ -{ - "files": ["schema.qrc", "schema.py", "schema.ui", "ui_schema.py", - "schema_rc.py"] -} diff --git a/examples/xmlpatterns/schema/schema.qrc b/examples/xmlpatterns/schema/schema.qrc deleted file mode 100644 index eb7ddfd7c..000000000 --- a/examples/xmlpatterns/schema/schema.qrc +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file alias="schema_0.xsd">files/contact.xsd</file> - <file alias="schema_1.xsd">files/recipe.xsd</file> - <file alias="schema_2.xsd">files/order.xsd</file> - <file alias="instance_0.xml">files/valid_contact.xml</file> - <file alias="instance_1.xml">files/invalid_contact.xml</file> - <file alias="instance_2.xml">files/valid_recipe.xml</file> - <file alias="instance_3.xml">files/invalid_recipe.xml</file> - <file alias="instance_4.xml">files/valid_order.xml</file> - <file alias="instance_5.xml">files/invalid_order.xml</file> -</qresource> -</RCC> diff --git a/examples/xmlpatterns/schema/schema.ui b/examples/xmlpatterns/schema/schema.ui deleted file mode 100644 index b67f444d2..000000000 --- a/examples/xmlpatterns/schema/schema.ui +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>SchemaMainWindow</class> - <widget class="QMainWindow" name="SchemaMainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>417</width> - <height>594</height> - </rect> - </property> - <property name="windowTitle"> - <string>XML Schema Validation</string> - </property> - <widget class="QWidget" name="centralwidget"> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0" colspan="2"> - <widget class="QLabel" name="schemaLabel"> - <property name="text"> - <string>XML Schema Document:</string> - </property> - </widget> - </item> - <item row="0" column="2" colspan="2"> - <widget class="QComboBox" name="schemaSelection"/> - </item> - <item row="1" column="0" colspan="4"> - <widget class="QTextBrowser" name="schemaView"/> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QLabel" name="instanceLabel"> - <property name="text"> - <string>XML Instance Document:</string> - </property> - </widget> - </item> - <item row="2" column="2" colspan="2"> - <widget class="QComboBox" name="instanceSelection"/> - </item> - <item row="3" column="0" colspan="4"> - <widget class="QTextEdit" name="instanceEdit"/> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Status:</string> - </property> - </widget> - </item> - <item row="4" column="1" colspan="2"> - <widget class="QLabel" name="validationStatus"> - <property name="text"> - <string>not validated</string> - </property> - </widget> - </item> - <item row="4" column="3"> - <widget class="QPushButton" name="validateButton"> - <property name="text"> - <string>Validate</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QStatusBar" name="statusbar"/> - </widget> - <resources/> - <connections/> -</ui> diff --git a/examples/xmlpatterns/schema/schema_rc.py b/examples/xmlpatterns/schema/schema_rc.py deleted file mode 100644 index 0c607af97..000000000 --- a/examples/xmlpatterns/schema/schema_rc.py +++ /dev/null @@ -1,394 +0,0 @@ -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 5.14.0 -# WARNING! All changes made in this file will be lost! - -from PySide2 import QtCore - -qt_resource_data = b"\ -\x00\x00\x01\x81\ -\x00\ -\x00\x06\x05x\x9c\xbdT\xc1r\xc2 \x10\xbd\xfb\x15\x0c\ -\x1f`\xb4\xbd9F\xcf\x9di\xa7\x87\xf6\xd0+\x92\x1d\ -\xc3L\x80\x08\x8b\x89\x7f_\x82\x1am\x0cI\xbc\x94C\ -&\xc3\xbe\xf7\xd8]\x1e\xbb\xde\xd6\xb2 G0Vh\ -\x95\xd2\xe5|A\xb7\x9b\xd9\xba\xb6\xd9\xca\xf2\x1c$#\ ->\xae\xec\xcao\xa44G,WIRU\xd5\xbcz\ -\x9dk\xb3O^\x16\x8be\xf2\xf3\xf1\xfe\x15\xb0t3\ -\x9b\x11\xbf\x02\x1d\x0a\x90\xa0\x90(&!\xa5\x06\xb8(\ -\xc1\x03\xc8e\x05\x0c\xd7\xb2,\xa0\xfe>\x95p\x8b\xb4\ -Q\x0b\x07\x07\x8awB\x91\x03P`\x01\x94\xa0\x97J\ -i`\xa3\x11jO\x93Il\x8f4\x90\x09\xbfq\x95\ -\xb8\xed4\xd9Q\x22Y\xfd\xc9\xb936\xa5N\xed\xb4\ -S\x19d\x13\xc5Q\xc86\xb3\xe6?\x08N\xa3J\xc0\ -\x5cg\xf4\x11;\xde\xc2'\xda9\x92\x84E({:\ -;\xb9%\xadt2\x9e\xc6\x193X\xd4\x19rI\xb1\ -c\x9b\xc8\x09\x11\xd5\x8e\xd2\xcd\xbbw\xc8\x07\x83\x84\xdb\ -\xeb\xf8\x98\xa1o\xc9\xce\xe1\x15\xdd|\x87\xbd\xd8K;\ -8\xa6\xbc\x8fO\xf7\xd4R[\x81\xe2\x08o\x0aa\x0f\ -fT\xc3)\x81\xf1\xa3{\x1a1Tu\xeb\xd6\xffJ\ -\xbco\x0a\x88&\xab\x88\x15\x1a\x80\x81\xa6F\x8e~\x80\ -\x91\x1d\xb3\x7f\xeb\x1ex9\xa0\x9c\x04\xc3\x02\xef\xc8\x0a\ -\xd78\x1d\xb8V\x99\x8d\x998F\x93B\xf9:\x9e\xa6\ -\xe5\xda\xbf\x9d\xdeA\x90t\xea\xeauyO_\xce\x91\ -\xb6\xb3\xf1;\xbfH\x84\xa9\xbd\x99\xfd\x02,\xd8\xc0\x1d\ -\ -\x00\x00\x02U\ -<\ -recipe>\x0a <tit\ -le>Cheese on Toa\ -st</title>\x0a <\ -ingredient name=\ -\x22Bread\x22 quantity\ -=\x222\x22 unit=\x22slice\ -s\x22/>\x0a <ingred\ -ient name=\x22Chees\ -e\x22 quantity=\x222\x22 \ -unit=\x22slices\x22/>\x0a\ - <time quanti\ -ty=\x223\x22 unit=\x22day\ -s\x22/>\x0a <method\ ->\x0a <step>\ -1. Slice the bre\ -ad and cheese.</\ -step>\x0a <s\ -tep>2. Grill one\ - side of each sl\ -ice of bread.</s\ -tep>\x0a <st\ -ep>3. Turn over \ -the bread and pl\ -ace a slice of c\ -heese on each pi\ -ece.</step>\x0a \ - <step>4. Gri\ -ll until the che\ -ese has started \ -to melt.</step>\x0a\ - <step>5.\ - Serve and enjoy\ -!</step>\x0a </m\ -ethod>\x0a <comm\ -ent>Tell your fr\ -iends about it!<\ -/comment>\x0a</reci\ -pe>\x0a\ -\x00\x00\x03\xbb\ -<\ -?xml version=\x221.\ -0\x22?>\x0a<xsd:schema\ - xmlns:xsd=\x22http\ -://www.w3.org/20\ -01/XMLSchema\x22>\x0a\x0a\ - <xsd:element\ - name=\x22contact\x22>\ -\x0a <xsd:co\ -mplexType>\x0a \ - <xsd:sequ\ -ence>\x0a \ - <xsd:eleme\ -nt name=\x22givenNa\ -me\x22 type=\x22xsd:st\ -ring\x22/>\x0a \ - <xsd:ele\ -ment name=\x22famil\ -yName\x22 type=\x22xsd\ -:string\x22/>\x0a \ - <xsd:\ -element name=\x22bi\ -rthdate\x22 type=\x22x\ -sd:date\x22 minOccu\ -rs=\x220\x22/>\x0a \ - <xsd:el\ -ement name=\x22home\ -Address\x22 type=\x22a\ -ddress\x22/>\x0a \ - <xsd:e\ -lement name=\x22wor\ -kAddress\x22 type=\x22\ -address\x22 minOccu\ -rs=\x220\x22/>\x0a \ - </xsd:seque\ -nce>\x0a </x\ -sd:complexType>\x0a\ - </xsd:elemen\ -t>\x0a\x0a <xsd:com\ -plexType name=\x22a\ -ddress\x22>\x0a \ - <xsd:sequence>\x0a\ - <xsd\ -:element name=\x22s\ -treet\x22 type=\x22xsd\ -:string\x22/>\x0a \ - <xsd:elem\ -ent name=\x22zipCod\ -e\x22 type=\x22xsd:str\ -ing\x22/>\x0a \ - <xsd:element \ -name=\x22city\x22 type\ -=\x22xsd:string\x22/>\x0a\ - <xsd\ -:element name=\x22c\ -ountry\x22 type=\x22xs\ -d:string\x22/>\x0a \ - </xsd:sequen\ -ce>\x0a </xsd:co\ -mplexType>\x0a\x0a</xs\ -d:schema>\x0a\ -\x00\x00\x02%\ -<\ -recipe>\x0a <tit\ -le>Cheese on Toa\ -st</title>\x0a <\ -ingredient name=\ -\x22Bread\x22 quantity\ -=\x222\x22 unit=\x22slice\ -s\x22/>\x0a <ingred\ -ient name=\x22Chees\ -e\x22 quantity=\x222\x22 \ -unit=\x22slices\x22/>\x0a\ - <time quanti\ -ty=\x223\x22 unit=\x22min\ -utes\x22/>\x0a <met\ -hod>\x0a <st\ -ep>1. Slice the \ -bread and cheese\ -.</step>\x0a \ - <step>2. Grill \ -one side of each\ - slice of bread.\ -</step>\x0a \ -<step>3. Turn ov\ -er the bread and\ - place a slice o\ -f cheese on each\ - piece.</step>\x0a \ - <step>4. \ -Grill until the \ -cheese has start\ -ed to melt.</ste\ -p>\x0a <step\ ->5. Serve and en\ -joy!</step>\x0a \ -</method>\x0a</reci\ -pe>\x0a\ -\x00\x00\x01\x1d\ -<\ -contact>\x0a <gi\ -venName>John</gi\ -venName>\x0a <fa\ -milyName>Doe</fa\ -milyName>\x0a <t\ -itle>Prof.</titl\ -e>\x0a <workAddr\ -ess>\x0a <st\ -reet>Sandakervei\ -en 116</street>\x0a\ - <zipCode\ ->N-0550</zipCode\ ->\x0a <city>\ -Oslo</city>\x0a \ - <country>Nor\ -way</country>\x0a \ - </workAddress>\ -\x0a</contact>\x0a\ -\x00\x00\x01.\ -<\ -order>\x0a <cust\ -omerId>234219</c\ -ustomerId>\x0a <\ -article>\x0a \ - <articleId>2169\ -2</articleId>\x0a \ - <count>3</\ -count>\x0a </art\ -icle>\x0a <artic\ -le>\x0a <art\ -icleId>24749</ar\ -ticleId>\x0a \ - <count>9</count\ ->\x0a </article>\ -\x0a <deliveryDa\ -te>2009-01-23</d\ -eliveryDate>\x0a \ - <payed>yes</pay\ -ed>\x0a</order>\x0a\ -\x00\x00\x01*\ -<\ -contact>\x0a <gi\ -venName>John</gi\ -venName>\x0a <fa\ -milyName>Doe</fa\ -milyName>\x0a <b\ -irthdate>1977-12\ --25</birthdate>\x0a\ - <homeAddress\ ->\x0a <stree\ -t>Sandakerveien \ -116</street>\x0a \ - <zipCode>N-\ -0550</zipCode>\x0a \ - <city>Osl\ -o</city>\x0a \ - <country>Norway\ -</country>\x0a <\ -/homeAddress>\x0a</\ -contact>\x0a\ -\x00\x00\x03g\ -<\ -?xml version=\x221.\ -0\x22?>\x0a<xsd:schema\ - xmlns:xsd=\x22http\ -://www.w3.org/20\ -01/XMLSchema\x22>\x0a\x0a\ - <xsd:element\ - name=\x22order\x22>\x0a \ - <xsd:comp\ -lexType>\x0a \ - <xsd:sequen\ -ce>\x0a \ - <xsd:element\ - name=\x22customerI\ -d\x22 type=\x22xsd:pos\ -itiveInteger\x22/>\x0a\ - \ -<xsd:element nam\ -e=\x22article\x22 type\ -=\x22articleType\x22 m\ -axOccurs=\x22unboun\ -ded\x22/>\x0a \ - <xsd:elem\ -ent name=\x22delive\ -ryDate\x22 type=\x22xs\ -d:date\x22/>\x0a \ - <xsd:e\ -lement name=\x22pay\ -ed\x22 type=\x22xsd:bo\ -olean\x22/>\x0a \ - </xsd:seque\ -nce>\x0a </x\ -sd:complexType>\x0a\ - </xsd:elemen\ -t>\x0a\x0a <xsd:com\ -plexType name=\x22a\ -rticleType\x22>\x0a \ - <xsd:sequen\ -ce>\x0a \ -<xsd:element nam\ -e=\x22articleId\x22 ty\ -pe=\x22xsd:positive\ -Integer\x22/>\x0a \ - <xsd:elem\ -ent name=\x22count\x22\ - type=\x22xsd:posit\ -iveInteger\x22/>\x0a \ - <xsd:e\ -lement name=\x22com\ -ment\x22 type=\x22xsd:\ -string\x22 minOccur\ -s=\x220\x22/>\x0a \ -</xsd:sequence>\x0a\ - </xsd:comple\ -xType>\x0a\x0a</xsd:sc\ -hema>\x0a\ -\x00\x00\x01\xb6\ -<\ -order>\x0a <cust\ -omerId>194223</c\ -ustomerId>\x0a <\ -article>\x0a \ - <articleId>2224\ -2</articleId>\x0a \ - <count>5</\ -count>\x0a </art\ -icle>\x0a <artic\ -le>\x0a <art\ -icleId>32372</ar\ -ticleId>\x0a \ - <count>12</coun\ -t>\x0a <comm\ -ent>without stri\ -pes</comment>\x0a \ - </article>\x0a \ - <article>\x0a \ - <articleId>23\ -649</articleId>\x0a\ - <count>2\ -</count>\x0a </a\ -rticle>\x0a <del\ -iveryDate>2009-0\ -1-23</deliveryDa\ -te>\x0a <payed>t\ -rue</payed>\x0a</or\ -der>\x0a\ -" - -qt_resource_name = b"\ -\x00\x0c\ -\x08\x13\x87\xf4\ -\x00s\ -\x00c\x00h\x00e\x00m\x00a\x00_\x001\x00.\x00x\x00s\x00d\ -\x00\x0e\ -\x00sJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x003\x00.\x00x\x00m\x00l\ -\x00\x0c\ -\x08\x10\x87\xf4\ -\x00s\ -\x00c\x00h\x00e\x00m\x00a\x00_\x000\x00.\x00x\x00s\x00d\ -\x00\x0e\ -\x00pJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x002\x00.\x00x\x00m\x00l\ -\x00\x0e\ -\x00yJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x001\x00.\x00x\x00m\x00l\ -\x00\x0e\ -\x00uJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x005\x00.\x00x\x00m\x00l\ -\x00\x0e\ -\x00vJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x000\x00.\x00x\x00m\x00l\ -\x00\x0c\ -\x08\x16\x87\xf4\ -\x00s\ -\x00c\x00h\x00e\x00m\x00a\x00_\x002\x00.\x00x\x00s\x00d\ -\x00\x0e\ -\x00rJ\x1c\ -\x00i\ -\x00n\x00s\x00t\x00a\x00n\x00c\x00e\x00_\x004\x00.\x00x\x00m\x00l\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x09\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00^\x00\x00\x00\x00\x00\x01\x00\x00\x07\x9d\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x01\x04\x00\x00\x00\x00\x00\x01\x00\x00\x10\xb2\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x01\x85\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x0a\xe7\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x0c\x19\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x09\xc6\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00@\x00\x00\x00\x00\x00\x01\x00\x00\x03\xde\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -\x00\x00\x00\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x0dG\ -\x00\x00\x01e\xaf\x16\xd2\xa1\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() diff --git a/examples/xmlpatterns/schema/ui_schema.py b/examples/xmlpatterns/schema/ui_schema.py deleted file mode 100644 index f9cc751eb..000000000 --- a/examples/xmlpatterns/schema/ui_schema.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- - -################################################################################ -## Form generated from reading UI file 'schema.ui' -## -## Created by: Qt User Interface Compiler version 5.14.0 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ - -from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint, - QRect, QSize, QUrl, Qt) -from PySide2.QtGui import (QColor, QFont, QIcon, QPixmap) -from PySide2.QtWidgets import * - -class Ui_SchemaMainWindow(object): - def setupUi(self, SchemaMainWindow): - if SchemaMainWindow.objectName(): - SchemaMainWindow.setObjectName(u"SchemaMainWindow") - SchemaMainWindow.resize(417, 594) - self.centralwidget = QWidget(SchemaMainWindow) - self.centralwidget.setObjectName(u"centralwidget") - self.gridLayout = QGridLayout(self.centralwidget) - self.gridLayout.setObjectName(u"gridLayout") - self.schemaLabel = QLabel(self.centralwidget) - self.schemaLabel.setObjectName(u"schemaLabel") - - self.gridLayout.addWidget(self.schemaLabel, 0, 0, 1, 2) - - self.schemaSelection = QComboBox(self.centralwidget) - self.schemaSelection.setObjectName(u"schemaSelection") - - self.gridLayout.addWidget(self.schemaSelection, 0, 2, 1, 2) - - self.schemaView = QTextBrowser(self.centralwidget) - self.schemaView.setObjectName(u"schemaView") - - self.gridLayout.addWidget(self.schemaView, 1, 0, 1, 4) - - self.instanceLabel = QLabel(self.centralwidget) - self.instanceLabel.setObjectName(u"instanceLabel") - - self.gridLayout.addWidget(self.instanceLabel, 2, 0, 1, 2) - - self.instanceSelection = QComboBox(self.centralwidget) - self.instanceSelection.setObjectName(u"instanceSelection") - - self.gridLayout.addWidget(self.instanceSelection, 2, 2, 1, 2) - - self.instanceEdit = QTextEdit(self.centralwidget) - self.instanceEdit.setObjectName(u"instanceEdit") - - self.gridLayout.addWidget(self.instanceEdit, 3, 0, 1, 4) - - self.label = QLabel(self.centralwidget) - self.label.setObjectName(u"label") - - self.gridLayout.addWidget(self.label, 4, 0, 1, 1) - - self.validationStatus = QLabel(self.centralwidget) - self.validationStatus.setObjectName(u"validationStatus") - - self.gridLayout.addWidget(self.validationStatus, 4, 1, 1, 2) - - self.validateButton = QPushButton(self.centralwidget) - self.validateButton.setObjectName(u"validateButton") - - self.gridLayout.addWidget(self.validateButton, 4, 3, 1, 1) - - SchemaMainWindow.setCentralWidget(self.centralwidget) - self.statusbar = QStatusBar(SchemaMainWindow) - self.statusbar.setObjectName(u"statusbar") - SchemaMainWindow.setStatusBar(self.statusbar) - - self.retranslateUi(SchemaMainWindow) - - QMetaObject.connectSlotsByName(SchemaMainWindow) - # setupUi - - def retranslateUi(self, SchemaMainWindow): - SchemaMainWindow.setWindowTitle(QCoreApplication.translate("SchemaMainWindow", u"XML Schema Validation", None)) - self.schemaLabel.setText(QCoreApplication.translate("SchemaMainWindow", u"XML Schema Document:", None)) - self.instanceLabel.setText(QCoreApplication.translate("SchemaMainWindow", u"XML Instance Document:", None)) - self.label.setText(QCoreApplication.translate("SchemaMainWindow", u"Status:", None)) - self.validationStatus.setText(QCoreApplication.translate("SchemaMainWindow", u"not validated", None)) - self.validateButton.setText(QCoreApplication.translate("SchemaMainWindow", u"Validate", None)) - # retranslateUi - |