diff options
84 files changed, 323 insertions, 1409 deletions
diff --git a/examples/axcontainer/axviewer.py b/examples/axcontainer/axviewer.py index e9083d8f4..50e50ee1c 100644 --- a/examples/axcontainer/axviewer.py +++ b/examples/axcontainer/axviewer.py @@ -43,7 +43,8 @@ import sys from PySide2.QtAxContainer import QAxSelect, QAxWidget -from PySide2.QtWidgets import (QAction, QApplication, QDialog, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QDialog, QMainWindow, QMessageBox, QToolBar) class MainWindow(QMainWindow): diff --git a/examples/corelib/tools/codecs/codecs.py b/examples/corelib/tools/codecs/codecs.py deleted file mode 100644 index a3c063c04..000000000 --- a/examples/corelib/tools/codecs/codecs.py +++ /dev/null @@ -1,250 +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$ -## -############################################################################# - -"""PySide2 port of the widgets/tools/codecs example from Qt v5.x""" - -from PySide2 import QtCore, QtWidgets - - -def codec_name(codec): - try: - # Python v3. - name = str(codec.name(), encoding='ascii') - except TypeError: - # Python v2. - name = str(codec.name()) - - return name - - -class MainWindow(QtWidgets.QMainWindow): - def __init__(self): - super(MainWindow, self).__init__() - - self.textEdit = QtWidgets.QTextEdit() - self.textEdit.setLineWrapMode(QtWidgets.QTextEdit.NoWrap) - self.setCentralWidget(self.textEdit) - - self.codecs = [] - self.findCodecs() - - self.previewForm = PreviewForm(self) - self.previewForm.setCodecList(self.codecs) - - self.saveAsActs = [] - self.createActions() - self.createMenus() - - self.setWindowTitle("Codecs") - self.resize(500, 400) - - def open(self): - fileName, _ = QtWidgets.QFileDialog.getOpenFileName(self) - if fileName: - inFile = QtCore.QFile(fileName) - if not inFile.open(QtCore.QFile.ReadOnly): - QtWidgets.QMessageBox.warning(self, "Codecs", - "Cannot read file %s:\n%s" % (fileName, inFile.errorString())) - return - - data = inFile.readAll() - - self.previewForm.setEncodedData(data) - if self.previewForm.exec_(): - self.textEdit.setPlainText(self.previewForm.decodedString()) - - def save(self): - fileName = QtWidgets.QFileDialog.getSaveFileName(self) - if fileName: - outFile = QtCore.QFile(fileName) - if not outFile.open(QtCore.QFile.WriteOnly|QtCore.QFile.Text): - QtWidgets.QMessageBox.warning(self, "Codecs", - "Cannot write file %s:\n%s" % (fileName, outFile.errorString())) - return - - action = self.sender() - codecName = action.data() - - out = QtCore.QTextStream(outFile) - out.setCodec(codecName) - out << self.textEdit.toPlainText() - - def about(self): - QtWidgets.QMessageBox.about(self, "About Codecs", - "The <b>Codecs</b> example demonstrates how to read and " - "write files using various encodings.") - - def aboutToShowSaveAsMenu(self): - currentText = self.textEdit.toPlainText() - - for action in self.saveAsActs: - codecName = str(action.data()) - codec = QtCore.QTextCodec.codecForName(codecName) - action.setVisible(codec and codec.canEncode(currentText)) - - def findCodecs(self): - codecMap = [] - iso8859RegExp = QtCore.QRegExp('ISO[- ]8859-([0-9]+).*') - - for mib in QtCore.QTextCodec.availableMibs(): - codec = QtCore.QTextCodec.codecForMib(mib) - sortKey = codec_name(codec).upper() - rank = 0 - - if sortKey.startswith('UTF-8'): - rank = 1 - elif sortKey.startswith('UTF-16'): - rank = 2 - elif iso8859RegExp.exactMatch(sortKey): - if len(iso8859RegExp.cap(1)) == 1: - rank = 3 - else: - rank = 4 - else: - rank = 5 - - codecMap.append((str(rank) + sortKey, codec)) - - codecMap.sort() - self.codecs = [item[-1] for item in codecMap] - - def createActions(self): - self.openAct = QtWidgets.QAction("&Open...", self, shortcut="Ctrl+O", - triggered=self.open) - - for codec in self.codecs: - name = codec_name(codec) - - action = QtWidgets.QAction(name + '...', self, triggered=self.save) - action.setData(name) - self.saveAsActs.append(action) - - self.exitAct = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+Q", - triggered=self.close) - - self.aboutAct = QtWidgets.QAction("&About", self, triggered=self.about) - - self.aboutQtAct = QtWidgets.QAction("About &Qt", self, - triggered=qApp.aboutQt) - - def createMenus(self): - self.saveAsMenu = QtWidgets.QMenu("&Save As", self) - for action in self.saveAsActs: - self.saveAsMenu.addAction(action) - - self.saveAsMenu.aboutToShow.connect(self.aboutToShowSaveAsMenu) - - self.fileMenu = QtWidgets.QMenu("&File", self) - self.fileMenu.addAction(self.openAct) - self.fileMenu.addMenu(self.saveAsMenu) - self.fileMenu.addSeparator() - self.fileMenu.addAction(self.exitAct) - - self.helpMenu = QtWidgets.QMenu("&Help", self) - self.helpMenu.addAction(self.aboutAct) - self.helpMenu.addAction(self.aboutQtAct) - - self.menuBar().addMenu(self.fileMenu) - self.menuBar().addSeparator() - self.menuBar().addMenu(self.helpMenu) - - -class PreviewForm(QtWidgets.QDialog): - def __init__(self, parent): - super(PreviewForm, self).__init__(parent) - - self.encodingComboBox = QtWidgets.QComboBox() - encodingLabel = QtWidgets.QLabel("&Encoding:") - encodingLabel.setBuddy(self.encodingComboBox) - - self.textEdit = QtWidgets.QTextEdit() - self.textEdit.setLineWrapMode(QtWidgets.QTextEdit.NoWrap) - self.textEdit.setReadOnly(True) - - buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) - - self.encodingComboBox.activated.connect(self.updateTextEdit) - buttonBox.accepted.connect(self.accept) - buttonBox.rejected.connect(self.reject) - - mainLayout = QtWidgets.QGridLayout() - mainLayout.addWidget(encodingLabel, 0, 0) - mainLayout.addWidget(self.encodingComboBox, 0, 1) - mainLayout.addWidget(self.textEdit, 1, 0, 1, 2) - mainLayout.addWidget(buttonBox, 2, 0, 1, 2) - self.setLayout(mainLayout) - - self.setWindowTitle("Choose Encoding") - self.resize(400, 300) - - def setCodecList(self, codecs): - self.encodingComboBox.clear() - for codec in codecs: - self.encodingComboBox.addItem(codec_name(codec), codec.mibEnum()) - - def setEncodedData(self, data): - self.encodedData = data - self.updateTextEdit() - - def decodedString(self): - return self.decodedStr - - def updateTextEdit(self): - mib = self.encodingComboBox.itemData(self.encodingComboBox.currentIndex()) - codec = QtCore.QTextCodec.codecForMib(mib) - - data = QtCore.QTextStream(self.encodedData) - data.setAutoDetectUnicode(False) - data.setCodec(codec) - - self.decodedStr = data.readAll() - self.textEdit.setPlainText(self.decodedStr) - - -if __name__ == '__main__': - - import sys - - app = QtWidgets.QApplication(sys.argv) - mainWin = MainWindow() - mainWin.show() - sys.exit(app.exec_()) diff --git a/examples/corelib/tools/settingseditor/settingseditor.py b/examples/corelib/tools/settingseditor/settingseditor.py index 4cd262568..5b141880a 100644 --- a/examples/corelib/tools/settingseditor/settingseditor.py +++ b/examples/corelib/tools/settingseditor/settingseditor.py @@ -111,41 +111,41 @@ class MainWindow(QtWidgets.QMainWindow): "application settings using Qt.") def createActions(self): - self.openSettingsAct = QtWidgets.QAction("&Open Application Settings...", + self.openSettingsAct = QtGui.QAction("&Open Application Settings...", self, shortcut="Ctrl+O", triggered=self.openSettings) - self.openIniFileAct = QtWidgets.QAction("Open I&NI File...", self, + self.openIniFileAct = QtGui.QAction("Open I&NI File...", self, shortcut="Ctrl+N", triggered=self.openIniFile) - self.openPropertyListAct = QtWidgets.QAction("Open macOS &Property List...", + self.openPropertyListAct = QtGui.QAction("Open macOS &Property List...", self, shortcut="Ctrl+P", triggered=self.openPropertyList) if sys.platform != 'darwin': self.openPropertyListAct.setEnabled(False) - self.openRegistryPathAct = QtWidgets.QAction( + self.openRegistryPathAct = QtGui.QAction( "Open Windows &Registry Path...", self, shortcut="Ctrl+G", triggered=self.openRegistryPath) if sys.platform != 'win32': self.openRegistryPathAct.setEnabled(False) - self.refreshAct = QtWidgets.QAction("&Refresh", self, shortcut="Ctrl+R", + self.refreshAct = QtGui.QAction("&Refresh", self, shortcut="Ctrl+R", enabled=False, triggered=self.settingsTree.refresh) - self.exitAct = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+Q", + self.exitAct = QtGui.QAction("E&xit", self, shortcut="Ctrl+Q", triggered=self.close) - self.autoRefreshAct = QtWidgets.QAction("&Auto-Refresh", self, + self.autoRefreshAct = QtGui.QAction("&Auto-Refresh", self, shortcut="Ctrl+A", checkable=True, enabled=False) self.autoRefreshAct.triggered[bool].connect(self.settingsTree.setAutoRefresh) self.autoRefreshAct.triggered[bool].connect(self.refreshAct.setDisabled) - self.fallbacksAct = QtWidgets.QAction("&Fallbacks", self, + self.fallbacksAct = QtGui.QAction("&Fallbacks", self, shortcut="Ctrl+F", checkable=True, enabled=False) self.fallbacksAct.triggered[bool].connect(self.settingsTree.setFallbacksEnabled) - self.aboutAct = QtWidgets.QAction("&About", self, triggered=self.about) + self.aboutAct = QtGui.QAction("&About", self, triggered=self.about) - self.aboutQtAct = QtWidgets.QAction("About &Qt", self, + self.aboutQtAct = QtGui.QAction("About &Qt", self, triggered=qApp.aboutQt) def createMenus(self): diff --git a/examples/external/matplotlib/widget_3dplot.py b/examples/external/matplotlib/widget_3dplot.py index b96405661..6f47da31b 100644 --- a/examples/external/matplotlib/widget_3dplot.py +++ b/examples/external/matplotlib/widget_3dplot.py @@ -45,8 +45,8 @@ from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.figure import Figure from mpl_toolkits.mplot3d import axes3d from PySide2.QtCore import Qt, Slot -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import (QAction, QApplication, QComboBox, QHBoxLayout, +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import (QApplication, QComboBox, QHBoxLayout, QHeaderView, QLabel, QMainWindow, QSlider, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) diff --git a/examples/external/opencv/webcam_pattern_detection.py b/examples/external/opencv/webcam_pattern_detection.py index 553261615..664ba2111 100644 --- a/examples/external/opencv/webcam_pattern_detection.py +++ b/examples/external/opencv/webcam_pattern_detection.py @@ -44,8 +44,8 @@ import time import cv2 from PySide2.QtCore import Qt, QThread, Signal, Slot -from PySide2.QtGui import QImage, QKeySequence, QPixmap -from PySide2.QtWidgets import (QAction, QApplication, QComboBox, QGroupBox, +from PySide2.QtGui import QAction, QImage, QKeySequence, QPixmap +from PySide2.QtWidgets import (QApplication, QComboBox, QGroupBox, QHBoxLayout, QLabel, QMainWindow, QPushButton, QSizePolicy, QVBoxLayout, QWidget) diff --git a/examples/external/scikit/staining_colors_separation.py b/examples/external/scikit/staining_colors_separation.py index 051b2bc25..d21453927 100644 --- a/examples/external/scikit/staining_colors_separation.py +++ b/examples/external/scikit/staining_colors_separation.py @@ -45,8 +45,8 @@ from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.colors import LinearSegmentedColormap from matplotlib.figure import Figure from PySide2.QtCore import Qt, Slot -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import (QAction, QApplication, QHBoxLayout, QLabel, +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import (QApplication, QHBoxLayout, QLabel, QMainWindow, QPushButton, QSizePolicy, QVBoxLayout, QWidget) from skimage import data diff --git a/examples/multimedia/camera.py b/examples/multimedia/camera.py index d58b526d9..644b5340c 100644 --- a/examples/multimedia/camera.py +++ b/examples/multimedia/camera.py @@ -43,9 +43,9 @@ import os, sys from PySide2.QtCore import QDate, QDir, QStandardPaths, Qt, QUrl -from PySide2.QtGui import QGuiApplication, QDesktopServices, QIcon +from PySide2.QtGui import QAction, QGuiApplication, QDesktopServices, QIcon from PySide2.QtGui import QImage, QPixmap -from PySide2.QtWidgets import (QAction, QApplication, QHBoxLayout, QLabel, +from PySide2.QtWidgets import (QApplication, QHBoxLayout, QLabel, QMainWindow, QPushButton, QTabWidget, QToolBar, QVBoxLayout, QWidget) from PySide2.QtMultimedia import QCamera, QCameraImageCapture, QCameraInfo from PySide2.QtMultimediaWidgets import QCameraViewfinder diff --git a/examples/multimedia/player.py b/examples/multimedia/player.py index 454f852ce..762d26b7e 100644 --- a/examples/multimedia/player.py +++ b/examples/multimedia/player.py @@ -43,8 +43,8 @@ import sys from PySide2.QtCore import QStandardPaths, Qt -from PySide2.QtGui import QIcon, QKeySequence -from PySide2.QtWidgets import (QAction, QApplication, QDialog, QFileDialog, +from PySide2.QtGui import QAction, QIcon, QKeySequence +from PySide2.QtWidgets import (QApplication, QDialog, QFileDialog, QMainWindow, QSlider, QStyle, QToolBar) from PySide2.QtMultimedia import QMediaPlayer, QMediaPlaylist from PySide2.QtMultimediaWidgets import QVideoWidget diff --git a/examples/opengl/grabber.py b/examples/opengl/grabber.py index d4b625718..9b5358a85 100644 --- a/examples/opengl/grabber.py +++ b/examples/opengl/grabber.py @@ -355,21 +355,21 @@ class MainWindow(QtWidgets.QMainWindow): "rendering OpenGL into a Qt pixmap.") def createActions(self): - self.renderIntoPixmapAct = QtWidgets.QAction("&Render into Pixmap...", + self.renderIntoPixmapAct = QtGui.QAction("&Render into Pixmap...", self, shortcut="Ctrl+R", triggered=self.renderIntoPixmap) - self.grabFrameBufferAct = QtWidgets.QAction("&Grab Frame Buffer", self, + self.grabFrameBufferAct = QtGui.QAction("&Grab Frame Buffer", self, shortcut="Ctrl+G", triggered=self.grabFrameBuffer) - self.clearPixmapAct = QtWidgets.QAction("&Clear Pixmap", self, + self.clearPixmapAct = QtGui.QAction("&Clear Pixmap", self, shortcut="Ctrl+L", triggered=self.clearPixmap) - self.exitAct = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+Q", + self.exitAct = QtGui.QAction("E&xit", self, shortcut="Ctrl+Q", triggered=self.close) - self.aboutAct = QtWidgets.QAction("&About", self, triggered=self.about) + self.aboutAct = QtGui.QAction("&About", self, triggered=self.about) - self.aboutQtAct = QtWidgets.QAction("About &Qt", self, + self.aboutQtAct = QtGui.QAction("About &Qt", self, triggered=qApp.aboutQt) def createMenus(self): diff --git a/examples/scriptableapplication/mainwindow.cpp b/examples/scriptableapplication/mainwindow.cpp index ef4a2f2e0..0811990de 100644 --- a/examples/scriptableapplication/mainwindow.cpp +++ b/examples/scriptableapplication/mainwindow.cpp @@ -51,7 +51,7 @@ #include "mainwindow.h" #include "pythonutils.h" -#include <QtWidgets/QAction> +#include <QtGui.QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QMenu> #include <QtWidgets/QMenuBar> diff --git a/examples/webenginewidgets/tabbedbrowser/main.py b/examples/webenginewidgets/tabbedbrowser/main.py index 438dd5c9d..086946bac 100644 --- a/examples/webenginewidgets/tabbedbrowser/main.py +++ b/examples/webenginewidgets/tabbedbrowser/main.py @@ -49,8 +49,8 @@ from findtoolbar import FindToolBar from webengineview import WebEngineView from PySide2 import QtCore from PySide2.QtCore import Qt, QUrl -from PySide2.QtGui import QKeySequence, QIcon -from PySide2.QtWidgets import (QAction, QApplication, QDockWidget, QLabel, +from PySide2.QtGui import QAction, QKeySequence, QIcon +from PySide2.QtWidgets import (QApplication, QDockWidget, QLabel, QLineEdit, QMainWindow, QToolBar) from PySide2.QtWebEngineWidgets import QWebEngineDownloadItem, QWebEnginePage diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.py b/examples/widgets/graphicsview/diagramscene/diagramscene.py index 3890782c4..048681bdb 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramscene.py +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.py @@ -607,38 +607,38 @@ class MainWindow(QtWidgets.QMainWindow): self.toolBox.addItem(backgroundWidget, "Backgrounds") def createActions(self): - self.toFrontAction = QtWidgets.QAction( + self.toFrontAction = QtGui.QAction( QtGui.QIcon(':/images/bringtofront.png'), "Bring to &Front", self, shortcut="Ctrl+F", statusTip="Bring item to front", triggered=self.bringToFront) - self.sendBackAction = QtWidgets.QAction( + self.sendBackAction = QtGui.QAction( QtGui.QIcon(':/images/sendtoback.png'), "Send to &Back", self, shortcut="Ctrl+B", statusTip="Send item to back", triggered=self.sendToBack) - self.deleteAction = QtWidgets.QAction(QtGui.QIcon(':/images/delete.png'), + self.deleteAction = QtGui.QAction(QtGui.QIcon(':/images/delete.png'), "&Delete", self, shortcut="Delete", statusTip="Delete item from diagram", triggered=self.deleteItem) - self.exitAction = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+X", + self.exitAction = QtGui.QAction("E&xit", self, shortcut="Ctrl+X", statusTip="Quit Scenediagram example", triggered=self.close) - self.boldAction = QtWidgets.QAction(QtGui.QIcon(':/images/bold.png'), + self.boldAction = QtGui.QAction(QtGui.QIcon(':/images/bold.png'), "Bold", self, checkable=True, shortcut="Ctrl+B", triggered=self.handleFontChange) - self.italicAction = QtWidgets.QAction(QtGui.QIcon(':/images/italic.png'), + self.italicAction = QtGui.QAction(QtGui.QIcon(':/images/italic.png'), "Italic", self, checkable=True, shortcut="Ctrl+I", triggered=self.handleFontChange) - self.underlineAction = QtWidgets.QAction( + self.underlineAction = QtGui.QAction( QtGui.QIcon(':/images/underline.png'), "Underline", self, checkable=True, shortcut="Ctrl+U", triggered=self.handleFontChange) - self.aboutAction = QtWidgets.QAction("A&bout", self, shortcut="Ctrl+B", + self.aboutAction = QtGui.QAction("A&bout", self, shortcut="Ctrl+B", triggered=self.about) def createMenus(self): @@ -780,7 +780,7 @@ class MainWindow(QtWidgets.QMainWindow): colorMenu = QtWidgets.QMenu(self) for color, name in zip(colors, names): - action = QtWidgets.QAction(self.createColorIcon(color), name, self, + action = QtGui.QAction(self.createColorIcon(color), name, self, triggered=slot) action.setData(QtGui.QColor(color)) colorMenu.addAction(action) diff --git a/examples/widgets/itemviews/addressbook/addressbook.py b/examples/widgets/itemviews/addressbook/addressbook.py index 262027a64..35d095287 100644 --- a/examples/widgets/itemviews/addressbook/addressbook.py +++ b/examples/widgets/itemviews/addressbook/addressbook.py @@ -40,7 +40,8 @@ ## ############################################################################# -from PySide2.QtWidgets import (QMainWindow, QAction, QFileDialog, QApplication) +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QMainWindow, QFileDialog, QApplication) from addresswidget import AddressWidget diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py index 8c4626f9b..d68e77b41 100644 --- a/examples/widgets/mainwindows/application/application.py +++ b/examples/widgets/mainwindows/application/application.py @@ -106,46 +106,46 @@ class MainWindow(QtWidgets.QMainWindow): self.setWindowModified(self.textEdit.document().isModified()) def createActions(self): - self.newAct = QtWidgets.QAction(QtGui.QIcon(':/images/new.png'), "&New", + self.newAct = QtGui.QAction(QtGui.QIcon(':/images/new.png'), "&New", self, shortcut=QtGui.QKeySequence.New, statusTip="Create a new file", triggered=self.newFile) - self.openAct = QtWidgets.QAction(QtGui.QIcon(':/images/open.png'), + self.openAct = QtGui.QAction(QtGui.QIcon(':/images/open.png'), "&Open...", self, shortcut=QtGui.QKeySequence.Open, statusTip="Open an existing file", triggered=self.open) - self.saveAct = QtWidgets.QAction(QtGui.QIcon(':/images/save.png'), + self.saveAct = QtGui.QAction(QtGui.QIcon(':/images/save.png'), "&Save", self, shortcut=QtGui.QKeySequence.Save, statusTip="Save the document to disk", triggered=self.save) - self.saveAsAct = QtWidgets.QAction("Save &As...", self, + self.saveAsAct = QtGui.QAction("Save &As...", self, shortcut=QtGui.QKeySequence.SaveAs, statusTip="Save the document under a new name", triggered=self.saveAs) - self.exitAct = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+Q", + self.exitAct = QtGui.QAction("E&xit", self, shortcut="Ctrl+Q", statusTip="Exit the application", triggered=self.close) - self.cutAct = QtWidgets.QAction(QtGui.QIcon(':/images/cut.png'), "Cu&t", + self.cutAct = QtGui.QAction(QtGui.QIcon(':/images/cut.png'), "Cu&t", self, shortcut=QtGui.QKeySequence.Cut, statusTip="Cut the current selection's contents to the clipboard", triggered=self.textEdit.cut) - self.copyAct = QtWidgets.QAction(QtGui.QIcon(':/images/copy.png'), + self.copyAct = QtGui.QAction(QtGui.QIcon(':/images/copy.png'), "&Copy", self, shortcut=QtGui.QKeySequence.Copy, statusTip="Copy the current selection's contents to the clipboard", triggered=self.textEdit.copy) - self.pasteAct = QtWidgets.QAction(QtGui.QIcon(':/images/paste.png'), + self.pasteAct = QtGui.QAction(QtGui.QIcon(':/images/paste.png'), "&Paste", self, shortcut=QtGui.QKeySequence.Paste, statusTip="Paste the clipboard's contents into the current selection", triggered=self.textEdit.paste) - self.aboutAct = QtWidgets.QAction("&About", self, + self.aboutAct = QtGui.QAction("&About", self, statusTip="Show the application's About box", triggered=self.about) - self.aboutQtAct = QtWidgets.QAction("About &Qt", self, + self.aboutQtAct = QtGui.QAction("About &Qt", self, statusTip="Show the Qt library's About box", triggered=qApp.aboutQt) diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py index 53f6f7818..3f8e7dbf7 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py @@ -43,10 +43,10 @@ """PySide2 port of the widgets/mainwindows/dockwidgets example from Qt v5.x, originating from PyQt""" from PySide2.QtCore import QDate, QFile, Qt, QTextStream -from PySide2.QtGui import (QFont, QIcon, QKeySequence, QTextCharFormat, - QTextCursor, QTextTableFormat) +from PySide2.QtGui import (QAction, QFont, QIcon, QKeySequence, + QTextCharFormat, QTextTableFormat) from PySide2.QtPrintSupport import QPrintDialog, QPrinter -from PySide2.QtWidgets import (QAction, QApplication, QDialog, QDockWidget, +from PySide2.QtWidgets import (QApplication, QDialog, QDockWidget, QFileDialog, QListWidget, QMainWindow, QMessageBox, QTextEdit) import dockwidgets_rc diff --git a/examples/widgets/mainwindows/mdi/mdi.py b/examples/widgets/mainwindows/mdi/mdi.py index 9daca826d..f9d90767e 100644 --- a/examples/widgets/mainwindows/mdi/mdi.py +++ b/examples/widgets/mainwindows/mdi/mdi.py @@ -44,8 +44,8 @@ from PySide2.QtCore import (QFile, QFileInfo, QPoint, QSettings, QSignalMapper, QSaveFile, QSize, QTextStream, Qt) -from PySide2.QtGui import QIcon, QKeySequence -from PySide2.QtWidgets import (QAction, QApplication, QFileDialog, QMainWindow, +from PySide2.QtGui import QAction, QIcon, QKeySequence +from PySide2.QtWidgets import (QApplication, QFileDialog, QMainWindow, QMdiArea, QMessageBox, QTextEdit, QWidget) import mdi_rc diff --git a/examples/widgets/systray/window.py b/examples/widgets/systray/window.py index ca65f04e1..634646327 100644 --- a/examples/widgets/systray/window.py +++ b/examples/widgets/systray/window.py @@ -39,8 +39,8 @@ ############################################################################# from PySide2.QtCore import Slot -from PySide2.QtGui import QIcon -from PySide2.QtWidgets import (QAction, QCheckBox, QComboBox, QDialog, +from PySide2.QtGui import QAction, QIcon +from PySide2.QtWidgets import (QCheckBox, QComboBox, QDialog, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit, QMenu, QMessageBox, QPushButton, QSpinBox, QStyle, QSystemTrayIcon, QTextEdit, diff --git a/examples/xml/dombookmarks/dombookmarks.py b/examples/xml/dombookmarks/dombookmarks.py index 20ec09e2d..f645bedce 100644 --- a/examples/xml/dombookmarks/dombookmarks.py +++ b/examples/xml/dombookmarks/dombookmarks.py @@ -100,18 +100,18 @@ class MainWindow(QtWidgets.QMainWindow): "DOM classes to read and write XML documents.") def createActions(self): - self.openAct = QtWidgets.QAction("&Open...", self, shortcut="Ctrl+O", + self.openAct = QtGui.QAction("&Open...", self, shortcut="Ctrl+O", triggered=self.open) - self.saveAsAct = QtWidgets.QAction("&Save As...", self, shortcut="Ctrl+S", + self.saveAsAct = QtGui.QAction("&Save As...", self, shortcut="Ctrl+S", triggered=self.saveAs) - self.exitAct = QtWidgets.QAction("E&xit", self, shortcut="Ctrl+Q", + self.exitAct = QtGui.QAction("E&xit", self, shortcut="Ctrl+Q", triggered=self.close) - self.aboutAct = QtWidgets.QAction("&About", self, triggered=self.about) + self.aboutAct = QtGui.QAction("&About", self, triggered=self.about) - self.aboutQtAct = QtWidgets.QAction("About &Qt", self, + self.aboutQtAct = QtGui.QAction("About &Qt", self, triggered=qApp.aboutQt) def createMenus(self): diff --git a/sources/cmake_helpers/helpers.cmake b/sources/cmake_helpers/helpers.cmake index fed96b5cd..ae35e1116 100644 --- a/sources/cmake_helpers/helpers.cmake +++ b/sources/cmake_helpers/helpers.cmake @@ -26,7 +26,6 @@ macro(collect_optional_modules) # Collect all optional modules. set(ALL_OPTIONAL_MODULES Xml - XmlPatterns Help Multimedia MultimediaWidgets OpenGL @@ -39,8 +38,6 @@ set(ALL_OPTIONAL_MODULES QuickWidgets RemoteObjects Scxml - Script - ScriptTools Sensors SerialPort TextToSpeech @@ -179,8 +176,7 @@ macro(COLLECT_MODULE_IF_FOUND shortname) get_target_property(Qt6${shortname}_PRIVATE_INCLUDE_DIRS Qt6::${shortname}Private INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(Qt6${shortname}_LIBRARIES Qt6::${shortname} - INTERFACE_LINK_LIBRARIES) + set(Qt6${shortname}_LIBRARIES Qt::${shortname}) endif() else() if("${module_state}" STREQUAL "optional") diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 484f02f0d..254139aff 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_policy(VERSION 3.1) # Don't ignore targets that do not exist, inside add_dependencies calls. cmake_policy(SET CMP0046 NEW) -set (QT_MAJOR_VERSION 5) +set (QT_MAJOR_VERSION 6) project(pysidebindings) diff --git a/sources/pyside2/PySide2/QtCore/CMakeLists.txt b/sources/pyside2/PySide2/QtCore/CMakeLists.txt index 20ed65a67..3820d439e 100644 --- a/sources/pyside2/PySide2/QtCore/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtCore/CMakeLists.txt @@ -26,22 +26,26 @@ ${QtCore_GEN_DIR}/qbasicmutex_wrapper.cpp ${QtCore_GEN_DIR}/qbasictimer_wrapper.cpp ${QtCore_GEN_DIR}/qbitarray_wrapper.cpp ${QtCore_GEN_DIR}/qbuffer_wrapper.cpp +${QtCore_GEN_DIR}/qbytearray_frombase64result_wrapper.cpp ${QtCore_GEN_DIR}/qbytearray_wrapper.cpp ${QtCore_GEN_DIR}/qbytearraymatcher_wrapper.cpp -${QtCore_GEN_DIR}/qchildevent_wrapper.cpp +${QtCore_GEN_DIR}/qcalendar_wrapper.cpp +${QtCore_GEN_DIR}/qcalendar_yearmonthday_wrapper.cpp ${QtCore_GEN_DIR}/qcborarray_wrapper.cpp ${QtCore_GEN_DIR}/qcborerror_wrapper.cpp ${QtCore_GEN_DIR}/qcbormap_wrapper.cpp ${QtCore_GEN_DIR}/qcborparsererror_wrapper.cpp ${QtCore_GEN_DIR}/qcborstreamreader_wrapper.cpp -${QtCore_GEN_DIR}/qcborstringresultstring_wrapper.cpp -${QtCore_GEN_DIR}/qcborstringresultbytearray_wrapper.cpp ${QtCore_GEN_DIR}/qcborstreamwriter_wrapper.cpp +${QtCore_GEN_DIR}/qcborstringresultbytearray_wrapper.cpp +${QtCore_GEN_DIR}/qcborstringresultstring_wrapper.cpp ${QtCore_GEN_DIR}/qcborvalue_wrapper.cpp +${QtCore_GEN_DIR}/qchildevent_wrapper.cpp ${QtCore_GEN_DIR}/qcollator_wrapper.cpp ${QtCore_GEN_DIR}/qcollatorsortkey_wrapper.cpp ${QtCore_GEN_DIR}/qcommandlineoption_wrapper.cpp ${QtCore_GEN_DIR}/qcommandlineparser_wrapper.cpp +${QtCore_GEN_DIR}/qconcatenatetablesproxymodel_wrapper.cpp ${QtCore_GEN_DIR}/qcoreapplication_wrapper.cpp ${QtCore_GEN_DIR}/qcryptographichash_wrapper.cpp ${QtCore_GEN_DIR}/qdatastream_wrapper.cpp @@ -58,9 +62,9 @@ ${QtCore_GEN_DIR}/qeventloop_wrapper.cpp ${QtCore_GEN_DIR}/qeventtransition_wrapper.cpp ${QtCore_GEN_DIR}/qfactoryinterface_wrapper.cpp ${QtCore_GEN_DIR}/qfile_wrapper.cpp -${QtCore_GEN_DIR}/qfileselector_wrapper.cpp ${QtCore_GEN_DIR}/qfiledevice_wrapper.cpp ${QtCore_GEN_DIR}/qfileinfo_wrapper.cpp +${QtCore_GEN_DIR}/qfileselector_wrapper.cpp ${QtCore_GEN_DIR}/qfilesystemwatcher_wrapper.cpp ${QtCore_GEN_DIR}/qfinalstate_wrapper.cpp ${QtCore_GEN_DIR}/qgenericargument_wrapper.cpp @@ -68,13 +72,13 @@ ${QtCore_GEN_DIR}/qgenericreturnargument_wrapper.cpp ${QtCore_GEN_DIR}/qhistorystate_wrapper.cpp ${QtCore_GEN_DIR}/qidentityproxymodel_wrapper.cpp ${QtCore_GEN_DIR}/qiodevice_wrapper.cpp +${QtCore_GEN_DIR}/qitemselection_wrapper.cpp +${QtCore_GEN_DIR}/qitemselectionmodel_wrapper.cpp +${QtCore_GEN_DIR}/qitemselectionrange_wrapper.cpp ${QtCore_GEN_DIR}/qjsonarray_wrapper.cpp ${QtCore_GEN_DIR}/qjsondocument_wrapper.cpp ${QtCore_GEN_DIR}/qjsonparseerror_wrapper.cpp ${QtCore_GEN_DIR}/qjsonvalue_wrapper.cpp -${QtCore_GEN_DIR}/qitemselection_wrapper.cpp -${QtCore_GEN_DIR}/qitemselectionmodel_wrapper.cpp -${QtCore_GEN_DIR}/qitemselectionrange_wrapper.cpp ${QtCore_GEN_DIR}/qlibraryinfo_wrapper.cpp ${QtCore_GEN_DIR}/qline_wrapper.cpp ${QtCore_GEN_DIR}/qlinef_wrapper.cpp @@ -107,13 +111,13 @@ ${QtCore_GEN_DIR}/qpointf_wrapper.cpp ${QtCore_GEN_DIR}/qprocess_wrapper.cpp ${QtCore_GEN_DIR}/qprocessenvironment_wrapper.cpp ${QtCore_GEN_DIR}/qpropertyanimation_wrapper.cpp -${QtCore_GEN_DIR}/qrandomgenerator_wrapper.cpp ${QtCore_GEN_DIR}/qrandomgenerator64_wrapper.cpp +${QtCore_GEN_DIR}/qrandomgenerator_wrapper.cpp ${QtCore_GEN_DIR}/qreadlocker_wrapper.cpp ${QtCore_GEN_DIR}/qreadwritelock_wrapper.cpp ${QtCore_GEN_DIR}/qrect_wrapper.cpp ${QtCore_GEN_DIR}/qrectf_wrapper.cpp -${QtCore_GEN_DIR}/qregexp_wrapper.cpp +${QtCore_GEN_DIR}/qrecursivemutex_wrapper.cpp ${QtCore_GEN_DIR}/qregularexpression_wrapper.cpp ${QtCore_GEN_DIR}/qregularexpressionmatch_wrapper.cpp ${QtCore_GEN_DIR}/qregularexpressionmatchiterator_wrapper.cpp @@ -132,8 +136,8 @@ ${QtCore_GEN_DIR}/qsizef_wrapper.cpp ${QtCore_GEN_DIR}/qsocketdescriptor_wrapper.cpp ${QtCore_GEN_DIR}/qsocketnotifier_wrapper.cpp ${QtCore_GEN_DIR}/qsortfilterproxymodel_wrapper.cpp -${QtCore_GEN_DIR}/qstate_wrapper.cpp ${QtCore_GEN_DIR}/qstandardpaths_wrapper.cpp +${QtCore_GEN_DIR}/qstate_wrapper.cpp ${QtCore_GEN_DIR}/qstatemachine_signalevent_wrapper.cpp ${QtCore_GEN_DIR}/qstatemachine_wrappedevent_wrapper.cpp ${QtCore_GEN_DIR}/qstatemachine_wrapper.cpp @@ -145,10 +149,6 @@ ${QtCore_GEN_DIR}/qt_wrapper.cpp ${QtCore_GEN_DIR}/qtemporarydir_wrapper.cpp ${QtCore_GEN_DIR}/qtemporaryfile_wrapper.cpp ${QtCore_GEN_DIR}/qtextboundaryfinder_wrapper.cpp -${QtCore_GEN_DIR}/qtextcodec_converterstate_wrapper.cpp -${QtCore_GEN_DIR}/qtextcodec_wrapper.cpp -${QtCore_GEN_DIR}/qtextdecoder_wrapper.cpp -${QtCore_GEN_DIR}/qtextencoder_wrapper.cpp ${QtCore_GEN_DIR}/qtextstream_wrapper.cpp ${QtCore_GEN_DIR}/qtextstreammanipulator_wrapper.cpp ${QtCore_GEN_DIR}/qthread_wrapper.cpp @@ -157,9 +157,10 @@ ${QtCore_GEN_DIR}/qtime_wrapper.cpp ${QtCore_GEN_DIR}/qtimeline_wrapper.cpp ${QtCore_GEN_DIR}/qtimer_wrapper.cpp ${QtCore_GEN_DIR}/qtimerevent_wrapper.cpp -${QtCore_GEN_DIR}/qtimezone_wrapper.cpp ${QtCore_GEN_DIR}/qtimezone_offsetdata_wrapper.cpp +${QtCore_GEN_DIR}/qtimezone_wrapper.cpp ${QtCore_GEN_DIR}/qtranslator_wrapper.cpp +${QtCore_GEN_DIR}/qtransposeproxymodel_wrapper.cpp ${QtCore_GEN_DIR}/qurl_wrapper.cpp ${QtCore_GEN_DIR}/qurlquery_wrapper.cpp ${QtCore_GEN_DIR}/quuid_wrapper.cpp @@ -176,33 +177,11 @@ ${QtCore_GEN_DIR}/qxmlstreamnotationdeclaration_wrapper.cpp ${QtCore_GEN_DIR}/qxmlstreamreader_wrapper.cpp ${QtCore_GEN_DIR}/qxmlstreamwriter_wrapper.cpp - ${SPECIFIC_OS_FILES} # module is always needed ${QtCore_GEN_DIR}/qtcore_module_wrapper.cpp ) -if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.13.0 - OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.13.0) - list(APPEND QtCore_SRC - ${QtCore_GEN_DIR}/qconcatenatetablesproxymodel_wrapper.cpp - ${QtCore_GEN_DIR}/qtransposeproxymodel_wrapper.cpp) -endif() - -if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.14.0 - OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.14.0) - list(APPEND QtCore_SRC - ${QtCore_GEN_DIR}/qcalendar_wrapper.cpp - ${QtCore_GEN_DIR}/qcalendar_yearmonthday_wrapper.cpp - ${QtCore_GEN_DIR}/qrecursivemutex_wrapper.cpp) -endif() - -if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.15.0 - OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.15.0) - list(APPEND QtCore_SRC - ${QtCore_GEN_DIR}/qbytearray_frombase64result_wrapper.cpp) -endif() - set(QtCore_glue_sources "${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.cpp" "${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.h" diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 986356720..720cddcc6 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -170,7 +170,6 @@ <enum-type name="QtMsgType"/> - <enum-type name="QCborSimpleType" since="5.12"/> <enum-type name="QCborKnownTags" since="5.12"/> @@ -189,6 +188,8 @@ <primitive-type name="long long"/> <primitive-type name="qlonglong" target-lang-api-name="PyLong"/> <primitive-type name="qulonglong" target-lang-api-name="PyLong"/> + <primitive-type name="qsizetype" target-lang-api-name="PyLong"/> + <primitive-type name="size_t" target-lang-api-name="PyLong"/> <primitive-type name="short"/> <primitive-type name="signed short"/> <primitive-type name="signed short int"/> @@ -354,7 +355,7 @@ <include file-name="qcborstream.h" location="global"/> <value-type name="StringResult" generate="no"/> <!-- 64bit (qsizetype = long long) --> - <modify-function signature="readStringChunk(char*,long long)" remove="all"/> + <modify-function signature="readStringChunk(char*,qsizetype)" remove="all"/> <!-- 32bit (qsizetype = int) --> <modify-function signature="readStringChunk(char*,int)" remove="all"/> </object-type> @@ -405,6 +406,7 @@ </conversion-rule> </container-type> + <!-- FIXME: Which one is it going to be? --> <container-type name="QList" type="list"> <include file-name="QList" location="global"/> <conversion-rule> @@ -419,21 +421,6 @@ </conversion-rule> </container-type> - <container-type name="QVector" type="vector"> - <include file-name="QVector" location="global"/> - <conversion-rule> - <native-to-target> - <insert-template name="cppvector_to_pylist_conversion"/> - </native-to-target> - <target-to-native> - <add-conversion type="PySequence"> - <insert-template name="pyseq_to_cppvector_conversion"/> - </add-conversion> - </target-to-native> - </conversion-rule> - - </container-type> - <container-type name="QStack" type="stack"> <include file-name="QStack" location="global"/> <conversion-rule> @@ -462,20 +449,6 @@ </conversion-rule> </container-type> - <container-type name="QLinkedList" type="linked-list"> - <include file-name="QLinkedList" location="global"/> - <conversion-rule> - <native-to-target> - <insert-template name="cpplist_to_pylist_conversion"/> - </native-to-target> - <target-to-native> - <add-conversion type="PySequence"> - <insert-template name="pyseq_to_cpplist_conversion"/> - </add-conversion> - </target-to-native> - </conversion-rule> - </container-type> - <container-type name="QHash" type="hash"> <include file-name="QHash" location="global"/> <!-- Include to make enum flags work. --> @@ -634,6 +607,7 @@ <enum-type name="PenCapStyle"/> <enum-type name="PenJoinStyle"/> <enum-type name="PenStyle"/> + <enum-type name="ReturnByValueConstant" since="6.0"/> <enum-type name="ScreenOrientation" flags="ScreenOrientations" since="5.0"/> <enum-type name="ScrollBarPolicy"/> <enum-type name="ScrollPhase" since="5.2"/> @@ -827,7 +801,6 @@ <extra-includes> <include file-name="datetime.h" location="global"/> </extra-includes> - <enum-type name="MonthNameType"/> <add-function signature="__repr__" return-type="PyObject"> <inject-code class="target" position="beginning"> <insert-template name="repr_code"> @@ -848,7 +821,7 @@ <add-function signature="toPython()" return-type="PyObject"> <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdate-topython"/> </add-function> - <modify-function signature="getDate(int*,int*,int*)" > + <modify-function signature="getDate(int*,int*,int*)const" > <modify-argument index="1"> <remove-argument/> </modify-argument> @@ -1310,8 +1283,6 @@ <rename to="format"/> </modify-argument> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toUInt(QStringRef,bool*)const" remove="all"/> <modify-function signature="toUInt(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1324,8 +1295,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toULongLong(QStringRef,bool*)const" remove="all"/> <modify-function signature="toULongLong(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1338,8 +1307,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions --> - <modify-function signature="toDouble(QStringRef,bool*)const" remove="all"/> <modify-function signature="toDouble(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1352,8 +1319,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions --> - <modify-function signature="toFloat(QStringRef,bool*)const" remove="all"/> <modify-function signature="toFloat(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1366,8 +1331,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toInt(QStringRef,bool*)const" remove="all"/> <modify-function signature="toInt(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1379,8 +1342,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toLongLong(QStringRef,bool*)const" remove="all"/> <modify-function signature="toLongLong(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1392,8 +1353,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toShort(QStringRef,bool*)const" remove="all"/> <modify-function signature="toShort(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1405,8 +1364,6 @@ <insert-template name="fix_args,bool*"/> </inject-code> </modify-function> - <!-- Qt5: ignore the new QStringRef versions, int arg is gone --> - <modify-function signature="toUShort(QStringRef,bool*)const" remove="all"/> <modify-function signature="toUShort(QString,bool*)const"> <modify-argument index="2"> <remove-argument /> @@ -1505,7 +1462,7 @@ <enum-type name="CheckIndexOption" flags="CheckIndexOptions" since="5.11"/> <enum-type name="LayoutChangeHint"/> <!-- This function was replaced by a added function --> - <modify-function signature="createIndex(int,int,void*)const" remove="all"/> + <modify-function signature="createIndex(int,int,const void*)const" remove="all"/> <!-- This function is the same as createIndex(int, int, int)const --> <modify-function signature="createIndex(int,int,quintptr)const"> <modify-argument index="3"> @@ -1586,10 +1543,6 @@ <reference-count action="set"/> </modify-argument> </modify-function> - <!--### Obsolete in 4.3--> - <modify-function signature="clear()" remove="all"/> - <modify-function signature="filterChanged()" remove="all"/> - <!--### End of obsolete section --> </object-type> <object-type name="QIdentityProxyModel"/> <object-type name="QTransposeProxyModel" since="5.13"/> @@ -1731,12 +1684,6 @@ <replace-default-expression with="QString()"/> </modify-argument> </add-function> - <add-function signature="findChildren(PyTypeObject*,const QRegExp&)" return-type="PySequence*" > - <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/> - <modify-argument index="return"> - <parent index="this" action="add"/> - </modify-argument> - </add-function> <add-function signature="findChildren(PyTypeObject*,const QRegularExpression&)" return-type="PySequence*" > <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/> <modify-argument index="return"> @@ -1819,64 +1766,8 @@ </inject-code> </add-function> </value-type> - <value-type name="QRegExp"> - <enum-type name="CaretMode"/> - <enum-type name="PatternSyntax"/> - <extra-includes> - <include file-name="QStringList" location="global"/> - </extra-includes> - <add-function signature="__repr__" return-type="PyObject*"> - <inject-code class="target" position="beginning"> - <insert-template name="repr_code"> - <replace from="%REPR_FORMAT" to="'%s', %i, %i"/> - <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/> - </insert-template> - </inject-code> - </add-function> - - <add-function signature="__reduce__" return-type="PyObject*"> - <inject-code class="target" position="beginning"> - <insert-template name="reduce_code"> - <replace from="%REDUCE_FORMAT" to="sii"/> - <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/> - </insert-template> - </inject-code> - </add-function> - <add-function signature="replace(QString,QString)" return-type="QString"> - <modify-argument index="1"> - <rename to="sourceString"/> - </modify-argument> - <modify-argument index="2"> - <rename to="after"/> - </modify-argument> - <inject-documentation format="target" mode="append"> - Replaces every occurrence of the regular expression in *sourceString* with *after*. - Returns a new Python string with the modified contents. For example: - - :: - - s = "Banana" - re = QRegExp("a[mn]") - s = re.replace(s, "ox") - # s == "Boxoxa" - - - For regular expressions containing capturing parentheses, occurrences of \1, \2, ..., in *after* - are replaced with rx.cap(1), cap(2), ... - - :: - - t = "A <i>bon mot</i>." - re = QRegExp("<i>([^<]*)</i>") - t = re.replace(t, "\\emph{\\1}") - # t == "A \\emph{bon mot}." - - </inject-documentation> - <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qregexp-replace"/> - </add-function> - </value-type> - <value-type name="QRegularExpression"> + <enum-type name="WildcardConversionOption" flags="WildcardConversionOptions" since="6.0"/> <enum-type name="MatchOption" flags="MatchOptions"/> <enum-type name="MatchType"/> <enum-type name="PatternOption" flags="PatternOptions"/> @@ -1918,56 +1809,41 @@ <!-- ### These overloads must be removed accept strings with \x00 in their contents --> <modify-function signature="append(const char*,int)" remove="all"/> <modify-function signature="append(const char*)" remove="all"/> - <modify-function signature="append(QString)" remove="all"/> <modify-function signature="contains(const char*)const" remove="all"/> <modify-function signature="count(const char*)const" remove="all"/> <modify-function signature="endsWith(const char*)const" remove="all"/> <modify-function signature="indexOf(const char*,int)const" remove="all"/> <modify-function signature="indexOf(char,int)const" remove="all"/> - <modify-function signature="indexOf(QString,int)const" remove="all"/> <modify-function signature="insert(int,const char*)" remove="all"/> <modify-function signature="insert(int,char)" remove="all"/> <modify-function signature="insert(int,const char*,int)" since="4.6" remove="all"/> - <modify-function signature="insert(int,QString)" remove="all"/> <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/> - <modify-function signature="lastIndexOf(QString,int)const" remove="all"/> <modify-function signature="lastIndexOf(char,int)const" remove="all"/> <modify-function signature="prepend(const char*)" remove="all"/> <modify-function signature="prepend(const char*,int)" since="4.6" remove="all"/> <modify-function signature="replace(QByteArray,const char*)" remove="all"/> <modify-function signature="replace(const char*,int,const char*,int)" remove="all"/> - <modify-function signature="replace(QString,const char*)" remove="all"/> <modify-function signature="replace(const char*,QByteArray)" remove="all"/> <modify-function signature="replace(const char*,const char*)" remove="all"/> <modify-function signature="replace(int,int,const char*)" remove="all"/> <modify-function signature="replace(int,int,const char*,int)" since="4.6" remove="all"/> <modify-function signature="replace(char,const char*)" remove="all"/> - <modify-function signature="replace(char,QString)" remove="all"/> <modify-function signature="startsWith(const char*)const" remove="all"/> - <modify-function signature="operator==(QString)const" remove="all"/> <modify-function signature="operator==(const char*,QByteArray)" remove="all"/> <modify-function signature="operator==(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator>(QString)const" remove="all"/> <modify-function signature="operator>(const char*,QByteArray)" remove="all"/> <modify-function signature="operator>(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator>=(QString)const" remove="all"/> <modify-function signature="operator>=(const char*,QByteArray)" remove="all"/> <modify-function signature="operator>=(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator<(QString)const" remove="all"/> <modify-function signature="operator<(const char*,QByteArray)" remove="all"/> - <modify-function signature="operator<=(QString)const" remove="all"/> <modify-function signature="operator<=(const char*,QByteArray)" remove="all"/> <modify-function signature="operator<=(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator!=(QString)const" remove="all"/> <modify-function signature="operator!=(const char*,QByteArray)" remove="all"/> <modify-function signature="operator!=(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator+=(QString)" remove="all"/> <modify-function signature="operator+=(const char*)" remove="all"/> <modify-function signature="operator+(QByteArray,const char*)" remove="all"/> <modify-function signature="operator+(const char*,QByteArray)" remove="all"/> <modify-function signature="operator+(QByteArray,const char*)" remove="all"/> - <modify-function signature="operator+(QString,QByteArray)" remove="all"/> - <modify-function signature="operator+(QByteArray,QString)" remove="all"/> <add-function signature="operator+(PyBytes,QByteArray)"> <inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplus-1"/> </add-function> @@ -2053,7 +1929,6 @@ <modify-function signature="operator>(const char*,QByteArray)" remove="all"/> <modify-function signature="operator>=(const char*,QByteArray)" remove="all"/> <modify-function signature="operator[](int)const" remove="all"/> - <modify-function signature="operator[](uint)const" remove="all"/> <!-- Those types have the same representation in Python, an overload would be useless. --> <modify-function signature="setNum(uint,int)" remove="all"/> <modify-function signature="setNum(ushort,int)" remove="all"/> @@ -2196,7 +2071,7 @@ <!-- Qt5: had to move QAbstractEventDispatcher into os-specific files because of Windows --> <object-type name="QAbstractNativeEventFilter"> <!-- see QWidget::nativeEvent(), QWindow::nativeEvent() --> - <modify-function signature="nativeEventFilter(const QByteArray&,void*,long*)"> + <modify-function signature="nativeEventFilter(const QByteArray&,void*,qintptr*)"> <modify-argument index="3"> <remove-argument/> <conversion-rule class="native"> @@ -2310,7 +2185,7 @@ </object-type> <object-type name="QCryptographicHash"> <enum-type name="Algorithm"/> - <modify-function signature="addData(const char*,int)"> + <modify-function signature="addData(const char*,qsizetype)"> <modify-argument index="2"> <remove-argument /> </modify-argument> @@ -2406,38 +2281,6 @@ <include file-name="QUrl" location="global"/> </extra-includes> </object-type> - <object-type name="QTextCodec"> - <enum-type name="ConversionFlag" flags="ConversionFlags"/> - - <object-type name="ConverterState"> - <include file-name="QTextCodec" location="global"/> - <modify-function signature="ConverterState(QFlags<QTextCodec::ConversionFlag>)"> - <modify-argument index="1"> - <replace-default-expression with="QTextCodec::DefaultConversion"/> - </modify-argument> - </modify-function> - </object-type> - - <modify-function signature="setCodecForLocale(QTextCodec*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <!-- fromUnicode(QString) does the job --> - <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/> - <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/> - <!-- this causes a warning that I cannot avoid. See suppressed warning at the end. --> - </object-type> - <object-type name="QTextDecoder"> - <!-- ### toUnicode(QByteArray) does the job --> - <modify-function signature="toUnicode(const char*,int)" remove="all"/> - <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/> - <!-- ### --> - </object-type> - <object-type name="QTextEncoder"> - <!-- fromUnicode(QString) does the job --> - <modify-function signature="fromUnicode(const QChar*,int)" remove="all"/> - </object-type> <object-type name="QTimeLine"> <enum-type name="CurveShape"/> <enum-type name="Direction"/> @@ -2493,7 +2336,6 @@ <modify-function signature="readAllStandardOutput()" allow-thread="yes"/> <modify-function signature="readAllStandardError()" allow-thread="yes"/> <modify-function signature="execute(QString,QStringList)" allow-thread="yes"/> - <modify-function signature="execute(QString)" allow-thread="yes"/> <modify-function signature="startDetached(QString,QStringList,QString,qint64*)"> <modify-argument index="4"> <remove-argument /> @@ -2508,10 +2350,6 @@ <add-function signature="pid()" return-type="long"> <inject-code file="../glue/qtcore.cpp" snippet="qprocess-pid"/> </add-function> - <!--### Obsolete in 4.3--> - <modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/> - <modify-function signature="readChannelMode()const" remove="all"/> - <!-- ### --> </object-type> <object-type name="QSignalMapper"/> @@ -2590,12 +2428,6 @@ <!--### Obsolete in 4.3--> <modify-function signature="setSystemIniPath(const QString&)" remove="all"/> <modify-function signature="setUserIniPath(const QString&)" remove="all"/> - <!--### Obsolete in 4.3--> - <modify-function signature="iniCodec()const"> - <modify-argument index="return"> - <define-ownership class="target" owner="default"/> - </modify-argument> - </modify-function> <!-- PYSIDE-1010: We remove the original implementation of value() to include the optional parameter --> <modify-function signature="value(const QString&,const QVariant&)const" remove="all"/> @@ -2882,11 +2714,6 @@ <object-type name="QXmlStreamWriter"> <!-- Removed because it expect QString to be mutable --> <modify-function signature="QXmlStreamWriter(QString*)" remove="all"/> - <modify-function signature="codec()const"> - <modify-argument index="return"> - <define-ownership class="target" owner="default"/> - </modify-argument> - </modify-function> </object-type> <value-type name="QModelIndex" hash-function="qHash"> <modify-function signature="internalPointer()const"> diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt index dcc5e29cf..f574b8081 100644 --- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt @@ -1,10 +1,6 @@ project(QtGui) -if (${QT_MAJOR_VERSION} GREATER_EQUAL 6) - qt6_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h") -else() - qt5_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h") -endif() +qt_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h") set(QtGui_DROPPED_ENTRIES) @@ -12,7 +8,6 @@ get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui PROPERTY QT_ENABLED_PUBLIC_FEATURES) set(QtGui_SRC -${QtGui_GEN_DIR}/qabstractopenglfunctions_wrapper.cpp ${QtGui_GEN_DIR}/qabstracttextdocumentlayout_paintcontext_wrapper.cpp ${QtGui_GEN_DIR}/qabstracttextdocumentlayout_selection_wrapper.cpp ${QtGui_GEN_DIR}/qabstracttextdocumentlayout_wrapper.cpp @@ -31,13 +26,16 @@ ${QtGui_GEN_DIR}/qaccessibletextselectionevent_wrapper.cpp ${QtGui_GEN_DIR}/qaccessibletextupdateevent_wrapper.cpp ${QtGui_GEN_DIR}/qaccessiblevaluechangeevent_wrapper.cpp ${QtGui_GEN_DIR}/qaccessiblevalueinterface_wrapper.cpp +${QtGui_GEN_DIR}/qaction_wrapper.cpp ${QtGui_GEN_DIR}/qactionevent_wrapper.cpp +${QtGui_GEN_DIR}/qactiongroup_wrapper.cpp ${QtGui_GEN_DIR}/qbackingstore_wrapper.cpp ${QtGui_GEN_DIR}/qbitmap_wrapper.cpp ${QtGui_GEN_DIR}/qbrush_wrapper.cpp ${QtGui_GEN_DIR}/qclipboard_wrapper.cpp ${QtGui_GEN_DIR}/qcloseevent_wrapper.cpp ${QtGui_GEN_DIR}/qcolor_wrapper.cpp +${QtGui_GEN_DIR}/qcolorspace_wrapper.cpp ${QtGui_GEN_DIR}/qconicalgradient_wrapper.cpp ${QtGui_GEN_DIR}/qcontextmenuevent_wrapper.cpp ${QtGui_GEN_DIR}/qcursor_wrapper.cpp @@ -70,6 +68,7 @@ ${QtGui_GEN_DIR}/qimage_wrapper.cpp ${QtGui_GEN_DIR}/qimageiohandler_wrapper.cpp ${QtGui_GEN_DIR}/qimagereader_wrapper.cpp ${QtGui_GEN_DIR}/qimagewriter_wrapper.cpp +${QtGui_GEN_DIR}/qinputdevice_wrapper.cpp ${QtGui_GEN_DIR}/qinputevent_wrapper.cpp ${QtGui_GEN_DIR}/qinputmethod_wrapper.cpp ${QtGui_GEN_DIR}/qinputmethodevent_attribute_wrapper.cpp @@ -79,7 +78,6 @@ ${QtGui_GEN_DIR}/qintvalidator_wrapper.cpp ${QtGui_GEN_DIR}/qkeyevent_wrapper.cpp ${QtGui_GEN_DIR}/qkeysequence_wrapper.cpp ${QtGui_GEN_DIR}/qlineargradient_wrapper.cpp -${QtGui_GEN_DIR}/qmatrix_wrapper.cpp ${QtGui_GEN_DIR}/qmatrix2x2_wrapper.cpp ${QtGui_GEN_DIR}/qmatrix2x3_wrapper.cpp ${QtGui_GEN_DIR}/qmatrix2x4_wrapper.cpp @@ -95,20 +93,8 @@ ${QtGui_GEN_DIR}/qmovie_wrapper.cpp ${QtGui_GEN_DIR}/qnativegestureevent_wrapper.cpp ${QtGui_GEN_DIR}/qoffscreensurface_wrapper.cpp ${QtGui_GEN_DIR}/qopenglcontextgroup_wrapper.cpp -${QtGui_GEN_DIR}/qopengldebuglogger_wrapper.cpp -${QtGui_GEN_DIR}/qopengldebugmessage_wrapper.cpp ${QtGui_GEN_DIR}/qopenglextrafunctions_wrapper.cpp -${QtGui_GEN_DIR}/qopenglframebufferobjectformat_wrapper.cpp ${QtGui_GEN_DIR}/qopenglfunctions_wrapper.cpp -# Compile error on Windows: ${QtGui_GEN_DIR}/qopenglpaintdevice_wrapper.cpp -${QtGui_GEN_DIR}/qopenglpixeltransferoptions_wrapper.cpp -${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp -${QtGui_GEN_DIR}/qopengltexture_wrapper.cpp -${QtGui_GEN_DIR}/qopengltextureblitter_wrapper.cpp -${QtGui_GEN_DIR}/qopenglversionprofile_wrapper.cpp -${QtGui_GEN_DIR}/qopenglvertexarrayobject_wrapper.cpp -${QtGui_GEN_DIR}/qopenglvertexarrayobject_binder_wrapper.cpp -${QtGui_GEN_DIR}/qopenglwindow_wrapper.cpp ${QtGui_GEN_DIR}/qpagedpaintdevice_margins_wrapper.cpp ${QtGui_GEN_DIR}/qpagedpaintdevice_wrapper.cpp ${QtGui_GEN_DIR}/qpagelayout_wrapper.cpp @@ -127,18 +113,18 @@ ${QtGui_GEN_DIR}/qpalette_wrapper.cpp ${QtGui_GEN_DIR}/qpdfwriter_wrapper.cpp ${QtGui_GEN_DIR}/qpen_wrapper.cpp ${QtGui_GEN_DIR}/qpicture_wrapper.cpp -${QtGui_GEN_DIR}/qpictureio_wrapper.cpp ${QtGui_GEN_DIR}/qpixmap_wrapper.cpp ${QtGui_GEN_DIR}/qpixmapcache_key_wrapper.cpp ${QtGui_GEN_DIR}/qpixmapcache_wrapper.cpp ${QtGui_GEN_DIR}/qpixelformat_wrapper.cpp +${QtGui_GEN_DIR}/qpointerevent_wrapper.cpp +${QtGui_GEN_DIR}/qpointingdevice_wrapper.cpp ${QtGui_GEN_DIR}/qpointingdeviceuniqueid_wrapper.cpp ${QtGui_GEN_DIR}/qpolygon_wrapper.cpp ${QtGui_GEN_DIR}/qpolygonf_wrapper.cpp ${QtGui_GEN_DIR}/qpytextobject_wrapper.cpp ${QtGui_GEN_DIR}/qquaternion_wrapper.cpp ${QtGui_GEN_DIR}/qradialgradient_wrapper.cpp -${QtGui_GEN_DIR}/qregexpvalidator_wrapper.cpp ${QtGui_GEN_DIR}/qregularexpressionvalidator_wrapper.cpp ${QtGui_GEN_DIR}/qregion_wrapper.cpp ${QtGui_GEN_DIR}/qresizeevent_wrapper.cpp @@ -148,14 +134,11 @@ ${QtGui_GEN_DIR}/qshowevent_wrapper.cpp ${QtGui_GEN_DIR}/qstandarditem_wrapper.cpp ${QtGui_GEN_DIR}/qstandarditemmodel_wrapper.cpp ${QtGui_GEN_DIR}/qstatustipevent_wrapper.cpp -${QtGui_GEN_DIR}/qopenglbuffer_wrapper.cpp ${QtGui_GEN_DIR}/qopenglcontext_wrapper.cpp ${QtGui_GEN_DIR}/qaccessible_state_wrapper.cpp ${QtGui_GEN_DIR}/qaccessibleinterface_wrapper.cpp ${QtGui_GEN_DIR}/qscreen_wrapper.cpp -${QtGui_GEN_DIR}/qopenglshader_wrapper.cpp -#${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp -${QtGui_GEN_DIR}/qopenglframebufferobject_wrapper.cpp +${QtGui_GEN_DIR}/qshortcut_wrapper.cpp ${QtGui_GEN_DIR}/qrasterwindow_wrapper.cpp ${QtGui_GEN_DIR}/qrawfont_wrapper.cpp ${QtGui_GEN_DIR}/qscrollevent_wrapper.cpp @@ -199,11 +182,13 @@ ${QtGui_GEN_DIR}/qtexttablecell_wrapper.cpp ${QtGui_GEN_DIR}/qtexttablecellformat_wrapper.cpp ${QtGui_GEN_DIR}/qtexttableformat_wrapper.cpp ${QtGui_GEN_DIR}/qtoolbarchangeevent_wrapper.cpp -${QtGui_GEN_DIR}/qtouchdevice_wrapper.cpp ${QtGui_GEN_DIR}/qtouchevent_touchpoint_wrapper.cpp ${QtGui_GEN_DIR}/qtouchevent_wrapper.cpp ${QtGui_GEN_DIR}/qtransform_wrapper.cpp ${QtGui_GEN_DIR}/qt_wrapper.cpp +${QtGui_GEN_DIR}/qundocommand_wrapper.cpp +${QtGui_GEN_DIR}/qundogroup_wrapper.cpp +${QtGui_GEN_DIR}/qundostack_wrapper.cpp ${QtGui_GEN_DIR}/qvalidator_wrapper.cpp ${QtGui_GEN_DIR}/qvector2d_wrapper.cpp ${QtGui_GEN_DIR}/qvector3d_wrapper.cpp @@ -216,24 +201,6 @@ ${QtGui_GEN_DIR}/qwindowstatechangeevent_wrapper.cpp ${QtGui_GEN_DIR}/qtgui_module_wrapper.cpp ) -if (Qt${QT_MAJOR_VERSION}Gui_VERSION VERSION_EQUAL 5.14.0 - OR Qt${QT_MAJOR_VERSION}Gui_VERSION VERSION_GREATER 5.14.0) - list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qcolorspace_wrapper.cpp) -endif() - -# cf qtbase/src/gui/opengl/opengl.pri -list(FIND QtGui_enabled_features "opengles2" _opengles2Index) -# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtGui_enabled_features) -if(_opengles2Index GREATER -1) - list(APPEND QtGui_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery) - message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Dropping Desktop OpenGL classes (GLES2)") -else() - list(APPEND QtGui_SRC - ${QtGui_GEN_DIR}/qopengltimemonitor_wrapper.cpp - ${QtGui_GEN_DIR}/qopengltimerquery_wrapper.cpp) - message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Adding Desktop OpenGL classes") -endif() - configure_file("${QtGui_SOURCE_DIR}/typesystem_gui.xml.in" "${QtGui_BINARY_DIR}/typesystem_gui.xml" @ONLY) diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 4be4fc8f3..3819c2a42 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -247,6 +247,42 @@ <object-type name="QAccessibleTextUpdateEvent" copyable="false" polymorphic-id-expression="%1->type() == QAccessible::TextUpdated"/> <object-type name="QAccessibleValueChangeEvent" copyable="false" polymorphic-id-expression="%1->type() == QAccessible::ValueChanged"/> + <object-type name="QAction"> + <enum-type name="ActionEvent"/> + <enum-type name="MenuRole"/> + <enum-type name="Priority" since="4.6"/> + <modify-function signature="setMenu(QMenu*)"> + <modify-argument index="1"> + <parent index="this" action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="triggered(bool)" allow-thread="yes"/> + </object-type> + <object-type name="QActionGroup"> + <enum-type name="ExclusionPolicy" since="5.14"/> + <modify-function signature="addAction(QAction*)"> + <modify-argument index="1"> + <parent index="this" action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="removeAction(QAction*)"> + <modify-argument index="1"> + <parent index="this" action="remove"/> + </modify-argument> + </modify-function> + </object-type> + <object-type name="QShortcut"> +<!-- FIXME: Qt 6 + <add-function signature="QShortcut(QKeySequence&,QWidget*,PyCallable*,Qt::ShortcutContext)"> + <modify-argument index="4"> + <replace-default-expression with="Qt::WindowShortcut"/> + </modify-argument> + <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qshortcut-1"/> + <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qshortcut-2"/> + </add-function> +--> + </object-type> + <value-type name="QTransform"> <enum-type name="TransformationType"/> <add-function signature="__repr__" return-type="PyObject*"> @@ -405,10 +441,10 @@ <modify-function signature="operator QVariant()const" remove="all"/> </value-type> <value-type name="QPicture" > - <modify-function signature="load(QIODevice*,const char*)" allow-thread="yes"/> - <modify-function signature="load(const QString&,const char*)" allow-thread="yes"/> - <modify-function signature="save(QIODevice*,const char*)" allow-thread="yes"/> - <modify-function signature="save(const QString&,const char*)" allow-thread="yes"/> + <modify-function signature="load(QIODevice*)" allow-thread="yes"/> + <modify-function signature="load(const QString&)" allow-thread="yes"/> + <modify-function signature="save(QIODevice*)" allow-thread="yes"/> + <modify-function signature="save(const QString&)" allow-thread="yes"/> <!-- See bug 759 --> <modify-function signature="data()const"> <modify-argument index="return"> @@ -501,7 +537,6 @@ </value-type> <value-type name="QPolygon"> <extra-includes> - <include file-name="QMatrix" location="global"/> <include file-name="QTransform" location="global"/> </extra-includes> <add-function signature="__reduce__" return-type="PyObject*"> @@ -527,7 +562,6 @@ </value-type> <value-type name="QPolygonF"> <extra-includes> - <include file-name="QMatrix" location="global"/> <include file-name="QTransform" location="global"/> </extra-includes> <!-- ### A QVector parameter, for no defined type, will generate wrong code. --> @@ -655,70 +689,6 @@ </modify-function> </value-type> - <!-- Qt5: this _should_ be obsolete, but QImage is still using it... --> - <value-type name="QMatrix"> - <extra-includes> - <include file-name="QPainterPath" location="global"/> - </extra-includes> - <add-function signature="__repr__" return-type="PyObject*"> - <inject-code class="target" position="beginning"> - <insert-template name="repr_code"> - <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f"/> - <replace from="%REPR_ARGS" - to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/> - </insert-template> - </inject-code> - </add-function> - - <add-function signature="__reduce__" return-type="PyObject*"> - <inject-code class="target" position="beginning"> - <insert-template name="reduce_code"> - <replace from="%REDUCE_FORMAT" to="dddddd"/> - <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/> - </insert-template> - </inject-code> - </add-function> - <modify-function signature="map(int,int,int*,int*)const"> - <modify-argument index="3"> - <remove-argument /> - </modify-argument> - <modify-argument index="4"> - <remove-argument /> - </modify-argument> - <inject-code> - <insert-template name="qmatrix_map"/> - </inject-code> - </modify-function> - <modify-function signature="map(qreal,qreal,qreal*,qreal*)const"> - <modify-argument index="3"> - <remove-argument /> - </modify-argument> - <modify-argument index="4"> - <remove-argument /> - </modify-argument> - <inject-code> - <insert-template name="qmatrix_map"/> - </inject-code> - </modify-function> - <modify-function signature="map(const QPoint&)const"> - <modify-argument index="return"> - <replace-type modified-type="QPoint"/> - </modify-argument> - <inject-code file="../glue/qtgui.cpp" snippet="qmatrix-map-point" /> - </modify-function> - <modify-function signature="inverted(bool*)const"> - <modify-argument index="1"> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PyTuple"/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_bool*"/> - </inject-code> - </modify-function> - </value-type> - <value-type name="QConicalGradient" polymorphic-id-expression="%1->type() == QGradient::ConicalGradient"/> <value-type name="QFontInfo"/> <value-type name="QRadialGradient" polymorphic-id-expression="%1->type() == QGradient::RadialGradient"/> @@ -756,7 +726,6 @@ <enum-type name="InvertMode"/> <extra-includes> <include file-name="QStringList" location="global"/> - <include file-name="QMatrix" location="global"/> </extra-includes> <modify-function signature="load(const QString&, const char*)" allow-thread="yes"/> @@ -764,7 +733,7 @@ <modify-function signature="save(const QString&,const char*,int)const" allow-thread="yes"/> <modify-function signature="save(QIODevice*,const char*,int)const" allow-thread="yes"/> - <modify-function signature="QImage(uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)"> + <modify-function signature="QImage(uchar*,int,int,qsizetype,QImage::Format,QImageCleanupFunction,void*)"> <modify-argument index="1"> <replace-type modified-type="PyBuffer"/> </modify-argument> @@ -801,7 +770,7 @@ </add-function> <!-- The non-const versions are already used --> - <modify-function signature="QImage(const uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/> + <modify-function signature="QImage(const uchar*,int,int,qsizetype,QImage::Format,QImageCleanupFunction,void*)" remove="all"/> <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/> <!-- ### --> @@ -909,7 +878,7 @@ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor"/> </add-function> <!-- get* methods. Inject code --> - <modify-function signature="getCmyk(int*,int*,int*,int*,int*)"> + <modify-function signature="getCmyk(int*,int*,int*,int*,int*)const"> <modify-argument index="0"> <replace-type modified-type="PyObject*"/> </modify-argument> @@ -936,7 +905,7 @@ </insert-template> </inject-code> </modify-function> - <modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)"> + <modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)const"> <modify-argument index="0"> <replace-type modified-type="PyObject*"/> </modify-argument> @@ -1120,7 +1089,7 @@ </inject-code> </modify-function> - <modify-function signature="width(QChar)const" rename="widthChar"> + <modify-function signature="horizontalAdvance(QChar)const" rename="horizontalAdvanceChar"> <modify-argument index="1"> <replace-type modified-type="char"/> </modify-argument> @@ -1156,7 +1125,7 @@ </inject-code> </modify-function> - <modify-function signature="width(QChar)const" rename="widthChar"> + <modify-function signature="horizontalAdvance(QChar)const" rename="horizontalAdvanceChar"> <modify-argument index="1"> <replace-type modified-type="char"/> </modify-argument> @@ -1258,15 +1227,6 @@ <object-type name="QIntValidator"/> <object-type name="QPainterPathStroker" copyable="false"/> - <object-type name="QPictureIO"> - <modify-function signature="setIODevice(QIODevice*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="read()" allow-thread="yes"/> - <modify-function signature="write()" allow-thread="yes"/> - </object-type> <object-type name="QPixmapCache"> <value-type name="Key"/> <add-function signature="find(QPixmapCache::Key&)"> @@ -1274,7 +1234,6 @@ </add-function> </object-type> - <object-type name="QRegExpValidator"/> <object-type name="QRegularExpressionValidator"/> <object-type name="QStandardItem"> @@ -1454,10 +1413,7 @@ </object-type> <object-type name="QShowEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::Show"/> <object-type name="QStatusTipEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::StatusTip"/> - <object-type name="QTabletEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::TabletMove || %1->type() == QEvent::TabletPress || %1->type() == QEvent::TabletRelease"> - <enum-type name="PointerType"/> - <enum-type name="TabletDevice"/> - </object-type> + <object-type name="QTabletEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::TabletMove || %1->type() == QEvent::TabletPress || %1->type() == QEvent::TabletRelease"/> <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1->type() == QEvent::ToolBarChange"/> <object-type name="QWhatsThisClickedEvent" copyable="false" polymorphic-id-expression="%1->type() == QEvent::WhatsThisClicked"/> <object-type name="QWheelEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::Wheel"/> @@ -1476,6 +1432,7 @@ <object-type name="QScrollEvent" copyable="false" polymorphic-id-expression="%1->type() == QEvent::Scroll"> <enum-type name="ScrollState"/> </object-type> + <object-type name="QPointerEvent" copyable= "false" since="6.0"/> <object-type name="QScrollPrepareEvent" copyable="false" polymorphic-id-expression="%1->type() == QEvent::ScrollPrepare"/> <object-type name="QTextFrame" > @@ -1892,14 +1849,6 @@ <insert-template name="qpainter_drawlist"/> </inject-code> </add-function> - <modify-function signature="drawRoundRect(int,int,int,int,int,int)"> - <modify-argument index="5"> - <rename to="xRound"/> - </modify-argument> - <modify-argument index="6"> - <rename to="yRound"/> - </modify-argument> - </modify-function> <modify-function signature="drawTiledPixmap(const QRect&,const QPixmap&,const QPoint&)"> <modify-argument index="3"> <rename to="pos"/> @@ -1915,16 +1864,6 @@ <no-null-pointer/> </modify-argument> </modify-function> - <modify-function signature="setRedirected(const QPaintDevice*,QPaintDevice*,const QPoint&)"> - <modify-argument index="1"> - <no-null-pointer/> - </modify-argument> - </modify-function> - <modify-function signature="restoreRedirected(const QPaintDevice*)"> - <modify-argument index="1"> - <no-null-pointer/> - </modify-argument> - </modify-function> <modify-function signature="drawText(QRectF,int,QString,QRectF*)"> <modify-argument index="4"> <remove-argument/> @@ -2258,6 +2197,7 @@ </value-type> <value-type name="QMatrix4x4" since="4.6"> + <enum-type name="Flag" flags="Flags" since="6.0"/> <!-- Qt5: HAIRY TRICK ALERT ahead! Qt5 partially replaced 'qreal' by float. @@ -2381,9 +2321,9 @@ </value-type> </object-type> - <object-type name="QTouchDevice"> - <enum-type name="CapabilityFlag" flags="Capabilities"/> - <enum-type name="DeviceType"/> + <object-type name="QInputDevice"> + <enum-type name="Capability" flags="Capabilities"/> + <enum-type name="DeviceType" flags="DeviceTypes"/> </object-type> <value-type name="QVector2D" since="4.6"> @@ -2527,7 +2467,7 @@ <enum-type name="Visibility"/> <modify-function signature="raise()" rename="raise_"/> <!-- see QWidget::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() --> - <modify-function signature="nativeEvent(const QByteArray &,void*,long*)"> + <modify-function signature="nativeEvent(const QByteArray &,void*,qintptr*)"> <modify-argument index="3"> <remove-argument/> <conversion-rule class="native"> @@ -2578,29 +2518,10 @@ </object-type> - <object-type name="QOpenGLBuffer" since="5.0"> - <enum-type name="Access"/> - <enum-type name="RangeAccessFlag" flags="RangeAccessFlags"/> - <enum-type name="Type"/> - <enum-type name="UsagePattern"/> - </object-type> <object-type name="QOpenGLContext"> <enum-type name="OpenGLModuleType"/> </object-type> <object-type name="QOpenGLContextGroup" since="5.0"/> - <object-type name="QOpenGLDebugLogger" since="5.1"> - <enum-type name="LoggingMode"/> - </object-type> - <value-type name="QOpenGLDebugMessage" since="5.1"> - <enum-type name="Source" flags="Sources"/> - <enum-type name="Type" flags="Types"/> - <enum-type name="Severity" flags="Severities"/> - </value-type> - <object-type name="QOpenGLFramebufferObject" since="5.0"> - <enum-type name="Attachment"/> - <enum-type name="FramebufferRestorePolicy" since="5.7"/> - </object-type> - <value-type name="QOpenGLFramebufferObjectFormat"/> <!-- Compile error on Windows: QOpenGLPaintDevice::QOpenGLPaintDevice(const QOpenGLPaintDevice &)': attempting to reference a deleted function <object-type name="QOpenGLPaintDevice" since="5.0"/> --> @@ -2887,7 +2808,6 @@ <modify-argument index="2"><array/></modify-argument> </modify-function> </object-type> - <object-type name="QAbstractOpenGLFunctions" since="5.1"/> <!-- Classes are result of a macro expansion in src/gui/opengl/qopenglversionfunctions.h <object-type name="QOpenGLFunctions_1_0" since="5.1"/> <object-type name="QOpenGLFunctions_1_1" since="5.1"/> @@ -2917,98 +2837,6 @@ <object-type name="QOpenGLFunctions_4_5_Core" since="5.5"/> <object-type name="QOpenGLFunctions_ES2" since="5.1"/> --> - <value-type name="QOpenGLPixelTransferOptions"/> - <object-type name="QOpenGLShader" since="5.0"> - <enum-type name="ShaderTypeBit" flags="ShaderType"/> - </object-type> - <object-type name="QOpenGLShaderProgram" since="5.0"> - <modify-function signature="setAttributeArray(int,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setAttributeArray(const char*,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setAttributeArray(int,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setAttributeValue(int,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setAttributeValue(const char*,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(int,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(int,const int*,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(int,const unsigned int*,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(const char*,const float*,int,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(const char*,const int*,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <modify-function signature="setUniformValueArray(const char*,const unsigned int*,int)"> - <modify-argument index="2"><array/></modify-argument> - </modify-function> - <!-- Add explicit signatures for the setUniformValue functions --> - <modify-function signature="^setUniformValue\(const char\*,(float|int|uint)\)$" remove="all"/> - <!-- No need for a signature for GLuint, since Qt (internally) calls the same function: glUniform1i --> - <add-function signature="setUniformValue1f(const char*, float)" return-type="void"> - <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/> - </add-function> - <add-function signature="setUniformValue1i(const char*, int)" return-type="void"> - <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/> - </add-function> - <add-function signature="setUniformValue1f(int, float)" return-type="void"> - <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/> - </add-function> - <add-function signature="setUniformValue1i(int, int)" return-type="void"> - <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/> - </add-function> - </object-type> - <object-type name="QOpenGLTexture" since="5.2"> - <enum-type name="BindingTarget"/> - <enum-type name="CoordinateDirection"/> - <enum-type name="ComparisonFunction"/> - <enum-type name="ComparisonMode"/> - <enum-type name="CubeMapFace"/> - <enum-type name="DepthStencilMode"/> - <enum-type name="Feature" flags="Features"/> - <enum-type name="Filter"/> - <enum-type name="MipMapGeneration"/> - <enum-type name="PixelFormat"/> - <enum-type name="PixelType"/> - <enum-type name="SwizzleComponent"/> - <enum-type name="SwizzleValue"/> - <enum-type name="Target"/> - <enum-type name="TextureFormat"/> - <enum-type name="TextureFormatClass"/> - <enum-type name="TextureUnitReset"/> - <enum-type name="WrapMode"/> - <modify-function signature="borderColor(unsigned int*)const" remove="all"/> - <modify-function signature="borderColor(int*)const" remove="all"/> - <modify-function signature="borderColor(float*)const" remove="all"/> - <!-- Work around link error introduced by qtbase/d15b02ff291e3124d9bb8ac3b06b704c292f52ab, can be removed once - qtbase/1bfabe35d8178c93e66acef21c01e08980f9ed0d has landed --> - <modify-function signature="setData(int,int,int,int,int,int,int,QOpenGLTexture::PixelFormat,QOpenGLTexture::PixelType,const void*,QOpenGLPixelTransferOptions*const)" remove="all"/> - </object-type> - <object-type name="QOpenGLTextureBlitter"> - <enum-type name="Origin"/> - </object-type> - <object-type name="QOpenGLTimeMonitor" since="5.1"/> - <object-type name="QOpenGLTimerQuery" since="5.1"/> - <object-type name="QOpenGLWindow" since="5.4"> - <enum-type name="UpdateBehavior"/> - </object-type> - <value-type name="QOpenGLVersionProfile" since="5.1"/> - <object-type name="QOpenGLVertexArrayObject"> - <object-type name="Binder"/> - </object-type> <value-type name="QPageLayout"> <enum-type name="Mode"/> <enum-type name="Orientation"/> @@ -3030,6 +2858,9 @@ <enum-type name="YUVLayout"/> </value-type> <object-type name="QPdfWriter"/> + <object-type name="QPointingDevice" since="6.0"> + <enum-type name="PointerType" flags="PointerTypes"/> + </object-type> <value-type name="QPointingDeviceUniqueId"/> <value-type name="QRawFont"> <enum-type name="AntialiasingType"/> @@ -3051,4 +2882,38 @@ </object-type> <object-type name="QStyleHints"/> + <object-type name="QUndoCommand"> + <modify-function signature="mergeWith(const QUndoCommand*)"> + <modify-argument index="1" invalidate-after-use="yes"/> + </modify-function> + </object-type> + <object-type name="QUndoGroup"> + <modify-function signature="addStack(QUndoStack*)"> + <modify-argument index="1"> + <parent index="this" action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="removeStack(QUndoStack*)"> + <modify-argument index="1"> + <parent index="this" action="add"/> + </modify-argument> + </modify-function> + </object-type> + <object-type name="QUndoStack"> + <modify-function signature="createUndoAction(QObject*,const QString&)const"> + <modify-argument index="return"> + <parent index="1" action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="createRedoAction(QObject*,const QString&)const"> + <modify-argument index="return"> + <parent index="1" action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="push(QUndoCommand*)"> + <modify-argument index="1"> + <parent index="this" action="add"/> + </modify-argument> + </modify-function> + </object-type> </typesystem> diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt index 9557c4a26..fca44d92c 100644 --- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt @@ -23,8 +23,6 @@ ${QtNetwork_GEN_DIR}/qlocalsocket_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkaccessmanager_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkaddressentry_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkcachemetadata_wrapper.cpp -${QtNetwork_GEN_DIR}/qnetworkconfiguration_wrapper.cpp -${QtNetwork_GEN_DIR}/qnetworkconfigurationmanager_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkcookie_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkcookiejar_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkdatagram_wrapper.cpp @@ -35,7 +33,6 @@ ${QtNetwork_GEN_DIR}/qnetworkproxyfactory_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkproxyquery_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkreply_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkrequest_wrapper.cpp -${QtNetwork_GEN_DIR}/qnetworksession_wrapper.cpp ${QtNetwork_GEN_DIR}/qpassworddigestor_wrapper.cpp ${QtNetwork_GEN_DIR}/qssl_wrapper.cpp ${QtNetwork_GEN_DIR}/qsslcertificate_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml index dc60a509d..f078b9bf7 100644 --- a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml +++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml @@ -42,6 +42,8 @@ <typesystem package="PySide2.QtNetwork"> <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> + <rejection class="dtlsopenssl"/> + <enum-type name="QDtlsError" since="5.12"/> <enum-type name="QOcspCertificateStatus" since="5.13"/> <enum-type name="QOcspRevocationReason" since="5.13"/> @@ -53,6 +55,8 @@ </namespace-type> <namespace-type name="QSsl"> + <enum-type name="AlertLevel" since="6.0"/> + <enum-type name="AlertType" since="6.0"/> <enum-type name="AlternativeNameEntryType"/> <enum-type name="EncodingFormat"/> <enum-type name="KeyAlgorithm"/> @@ -172,7 +176,6 @@ <enum-type name="LocalSocketState"/> </object-type> <object-type name="QNetworkAccessManager"> - <enum-type name="NetworkAccessibility" since="4.7"/> <enum-type name="Operation"/> <modify-function signature="createRequest(QNetworkAccessManager::Operation,const QNetworkRequest&,QIODevice*)"> <modify-argument index="3" invalidate-after-use="yes"/> @@ -262,21 +265,6 @@ <enum-type name="TransferTimeoutConstant" since="5.15"/> </value-type> - <value-type name="QNetworkConfiguration" since="4.7"> - <enum-type name="BearerType"/> - <enum-type name="Purpose" since="4.7"/> - <enum-type name="StateFlag" flags="StateFlags" since="4.7"/> - <enum-type name="Type" since="4.7"/> - </value-type> - <object-type name="QNetworkConfigurationManager" since="4.7"> - <enum-type name="Capability" flags="Capabilities" since="4.7"/> - </object-type> - <object-type name="QNetworkSession" since="4.7"> - <enum-type name="SessionError" since="4.7"/> - <enum-type name="State" since="4.7"/> - <enum-type name="UsagePolicy" flags="UsagePolicies"/> - </object-type> - <object-type name="QAbstractNetworkCache"/> <object-type name="QNetworkDiskCache"/> <value-type name="QNetworkCacheMetaData"/> diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp index efc86a048..4218678bf 100644 --- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp +++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp @@ -132,7 +132,6 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, Q_ASSERT(metaObject); QQmlPrivate::RegisterType type; - type.version = 0; // Allow registering Qt Quick items. bool registered = false; @@ -153,8 +152,8 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, pyTypes[nextType] = pyObj; // FIXME: Fix this to assign new type ids each time. - type.typeId = qMetaTypeId<QObject *>(); - type.listId = qMetaTypeId<QQmlListProperty<QObject> >(); + type.typeId = QMetaType(QMetaType::QObjectStar); + type.listId = QMetaType::fromType<QQmlListProperty<QObject> >(); type.attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<QObject>(); type.attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<QObject>(); @@ -170,8 +169,7 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, type.objectSize = objectSize; type.create = createFuncs[nextType]; type.uri = uri; - type.versionMajor = versionMajor; - type.versionMinor = versionMinor; + type.version = QTypeRevision::fromVersion(versionMajor, versionMinor); type.elementName = qmlName; type.extensionObjectCreate = 0; diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml index b61b28c07..4ebc4b417 100644 --- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml +++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml @@ -54,9 +54,18 @@ in generator tests folder. --> </primitive-type> + <enum-type name="QQmlModuleImportSpecialVersions" since="6.0"/> + <!-- For qmlEngine(const QObject*), qmlContext(const QObject*) in qqml.h --> <namespace-type name="QtQml"/> + <!-- FIXME Qt 6: expose QQmlIncubationController::incubateWhile() + (see QtQml_VolatileBoolTypeF in pysideqmlregistertype.h) + <namespace-type name="std" generate="no"> + <value-type name="atomic" generate="no"/> + </namespace-type> + --> + <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int"> <inject-documentation format="target" mode="append"> This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor. @@ -93,6 +102,7 @@ <object-type name="QJSEngine"> <enum-type name="Extension" flags="Extensions" since="5.6"/> + <enum-type name="ObjectOwnership" since="6.0"/> <add-function signature="toScriptValue(const QVariant&)" return-type="QJSValue"> <inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="qjsengine-toscriptvalue"/> </add-function> @@ -116,7 +126,6 @@ <enum-type name="StartMode"/> </object-type> <object-type name="QQmlEngine"> - <enum-type name="ObjectOwnership"/> <modify-function signature="addImageProvider(const QString&,QQmlImageProviderBase*)"> <modify-argument index="2"> <define-ownership owner="c++"/> @@ -153,10 +162,11 @@ <enum-type name="Status"/> </object-type> <object-type name="QQmlIncubationController"> - <modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes"> + <!-- FIXME Qt 6 + <modify-function signature="incubateWhile(std::atomic<bool>*,int)" allow-thread="yes"> <modify-argument index="1"> - <!-- The replace type is needed to use the VolatileBool_Check macro instead of - a template conversion function with "volatile bool" as argument. --> + The replace type is needed to use the VolatileBool_Check macro instead of + a template conversion function with "volatile bool" as argument. <replace-type modified-type="VolatileBool"/> <conversion-rule class="native"> volatile bool * %out = @@ -164,6 +174,7 @@ </conversion-rule> </modify-argument> </modify-function> + --> </object-type> <!-- TODO: QQmlListProperty is a template class, and thus should probably be treated like a diff --git a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt index 0f453c90e..25f54679f 100644 --- a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt @@ -3,10 +3,12 @@ project(QtQuick) set(QtQuick_registerType "${QtQuick_SOURCE_DIR}/pysidequickregistertype.cpp") set(QtQuick_SRC +${QtQuick_GEN_DIR}/qquickasyncimageprovider_wrapper.cpp ${QtQuick_GEN_DIR}/qquickframebufferobject_wrapper.cpp ${QtQuick_GEN_DIR}/qquickframebufferobject_renderer_wrapper.cpp ${QtQuick_GEN_DIR}/qquicktexturefactory_wrapper.cpp ${QtQuick_GEN_DIR}/qquickimageprovider_wrapper.cpp +${QtQuick_GEN_DIR}/qquickimageresponse_wrapper.cpp ${QtQuick_GEN_DIR}/qquicktransform_wrapper.cpp ${QtQuick_GEN_DIR}/qquickitem_wrapper.cpp ${QtQuick_GEN_DIR}/qquickitem_updatepaintnodedata_wrapper.cpp @@ -17,11 +19,9 @@ ${QtQuick_GEN_DIR}/qquickrendercontrol_wrapper.cpp ${QtQuick_GEN_DIR}/qquicktextdocument_wrapper.cpp ${QtQuick_GEN_DIR}/qquickview_wrapper.cpp ${QtQuick_GEN_DIR}/qquickwindow_wrapper.cpp -${QtQuick_GEN_DIR}/qsgabstractrenderer_wrapper.cpp ${QtQuick_GEN_DIR}/qsgbasicgeometrynode_wrapper.cpp ${QtQuick_GEN_DIR}/qsgclipnode_wrapper.cpp ${QtQuick_GEN_DIR}/qsgdynamictexture_wrapper.cpp -${QtQuick_GEN_DIR}/qsgengine_wrapper.cpp #${QtQuick_GEN_DIR}/qsgflatcolormaterial_wrapper.cpp ${QtQuick_GEN_DIR}/qsggeometry_attribute_wrapper.cpp ${QtQuick_GEN_DIR}/qsggeometry_attributeset_wrapper.cpp @@ -51,13 +51,6 @@ ${QtQuick_GEN_DIR}/qsgtransformnode_wrapper.cpp ${QtQuick_GEN_DIR}/qtquick_module_wrapper.cpp ) -if (Qt${QT_MAJOR_VERSION}Quick_VERSION VERSION_GREATER 5.5.1) - set(QtQuick_SRC ${QtQuick_SRC} - ${QtQuick_GEN_DIR}/qquickasyncimageprovider_wrapper.cpp - ${QtQuick_GEN_DIR}/qquickimageresponse_wrapper.cpp - ) -endif() - set(QtQuick_include_dirs ${QtQuick_SOURCE_DIR} ${QtQml_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} diff --git a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp index a042ac2cc..8e48c3d7f 100644 --- a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp +++ b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp @@ -130,6 +130,7 @@ void registerTypeIfInheritsFromClass( bool shouldRegister = !registered && pyTypeObjectInheritsFromClass(typeToRegister, className); if (shouldRegister) { int ptrType = +#if 0 // FIXME Qt 6 QMetaType::registerNormalizedType( typePointerName.constData(), QtMetaTypePrivate::QMetaTypeFunctionHelper<WrapperClass *>::Destruct, @@ -143,8 +144,11 @@ void registerTypeIfInheritsFromClass( typePointerName.constData()); return; } - +#else + -1; +#endif int lstType = +#if 0 // FIXME Qt 6 QMetaType::registerNormalizedType( typeListName.constData(), QtMetaTypePrivate::QMetaTypeFunctionHelper<QQmlListProperty<WrapperClass> > @@ -155,14 +159,17 @@ void registerTypeIfInheritsFromClass( static_cast< ::QFlags<QMetaType::TypeFlag> >( QtPrivate::QMetaTypeTypeFlags<QQmlListProperty<WrapperClass> >::Flags), nullptr); +#else + -1; +#endif if (lstType == -1) { PyErr_Format(PyExc_TypeError, "Meta type registration of \"%s\" for QML usage failed.", typeListName.constData()); return; } - type->typeId = ptrType; - type->listId = lstType; + type->typeId = QMetaType(ptrType); + type->listId = QMetaType(lstType); type->attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<WrapperClass>(); type->attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<WrapperClass>(); @@ -228,10 +235,8 @@ bool quickRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int v return false; type->create = createFuncs[nextType]; - type->version = 0; type->uri = uri; - type->versionMajor = versionMajor; - type->versionMinor = versionMinor; + type->version = QTypeRevision::fromVersion(versionMajor, versionMinor); type->elementName = qmlName; type->metaObject = metaObject; diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml index 223eff773..31e05979b 100644 --- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml +++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml @@ -107,16 +107,9 @@ <enum-type name="TextRenderType" since="5.10"/> </object-type> - <object-type name="QSGAbstractRenderer"> - <enum-type name="ClearModeBit" flags="ClearMode"/> - <enum-type name="MatrixTransformFlag" flags="MatrixTransformFlags" since="5.14"/> - </object-type> <object-type name="QSGBasicGeometryNode"/> <object-type name="QSGClipNode"/> <object-type name="QSGDynamicTexture"/> - <object-type name="QSGEngine"> - <enum-type name="CreateTextureOption" flags="CreateTextureOptions"/> - </object-type> <!-- <object-type name="QSGFlatColorMaterial"/> --> <object-type name="QSGGeometry"> <enum-type name="DataPattern"/> diff --git a/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in index 65daf1b84..da5534b82 100644 --- a/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in +++ b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in @@ -1,5 +1,5 @@ // QT_WIDGETS_LIB changes code generation in pysideqtesttouch.h -#if @Qt5Widgets_FOUND@ +#if @Qt6Widgets_FOUND@ # define QT_WIDGETS_LIB #endif diff --git a/sources/pyside2/PySide2/QtTest/typesystem_test.xml b/sources/pyside2/PySide2/QtTest/typesystem_test.xml index f7facaf7d..b22289149 100644 --- a/sources/pyside2/PySide2/QtTest/typesystem_test.xml +++ b/sources/pyside2/PySide2/QtTest/typesystem_test.xml @@ -89,14 +89,14 @@ The problem that costed my days of bug hunting is the fact that shiboken gives misleading error messages. The messages that I could not get rid of were - signature 'generateTouchEvent(QWidget*,QTouchDevice*,bool)' for function modification in 'QTest' not found. Possible candidates: - signature 'generateTouchEvent(QWindow*,QTouchDevice*,bool)' for function modification in 'QTest' not found. Possible candidates: + signature 'generateTouchEvent(QWidget*,QInputDevice*,bool)' for function modification in 'QTest' not found. Possible candidates: + signature 'generateTouchEvent(QWindow*,QInputDevice*,bool)' for function modification in 'QTest' not found. Possible candidates: I always thought that for some reason the functions were not recognized, or the arguments somehow do not match their declaration. Only late in the project, I learnt that also a simply missing type name in the argument list leads to this message. - <object-type name="QTouchDevice"> + <object-type name="QInputDevice"> <enum-type name="CapabilityFlag" flags="Capabilities"/> <enum-type name="DeviceType"/> </object-type> @@ -151,12 +151,12 @@ </modify-argument> </modify-function> </object-type> - <modify-function signature="generateTouchEvent(QWidget*,QTouchDevice*,bool)" rename="touchEvent" since="4.6"> + <modify-function signature="generateTouchEvent(QWidget*,QInputDevice*,bool)" rename="touchEvent" since="4.6"> <modify-argument index="return"> <define-ownership class="target" owner="target"/> </modify-argument> </modify-function> - <modify-function signature="generateTouchEvent(QWindow*,QTouchDevice*,bool)" rename="touchEvent" since="4.6"> + <modify-function signature="generateTouchEvent(QWindow*,QInputDevice*,bool)" rename="touchEvent" since="4.6"> <modify-argument index="return"> <define-ownership class="target" owner="target"/> </modify-argument> diff --git a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt index 506a6fc78..5383d9410 100644 --- a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt @@ -9,8 +9,6 @@ ${QtWidgets_GEN_DIR}/qabstractitemview_wrapper.cpp ${QtWidgets_GEN_DIR}/qabstractscrollarea_wrapper.cpp ${QtWidgets_GEN_DIR}/qabstractslider_wrapper.cpp ${QtWidgets_GEN_DIR}/qabstractspinbox_wrapper.cpp -${QtWidgets_GEN_DIR}/qaction_wrapper.cpp -${QtWidgets_GEN_DIR}/qactiongroup_wrapper.cpp ${QtWidgets_GEN_DIR}/qapplication_wrapper.cpp ${QtWidgets_GEN_DIR}/qboxlayout_wrapper.cpp ${QtWidgets_GEN_DIR}/qbuttongroup_wrapper.cpp @@ -26,11 +24,9 @@ ${QtWidgets_GEN_DIR}/qcompleter_wrapper.cpp ${QtWidgets_GEN_DIR}/qdatawidgetmapper_wrapper.cpp ${QtWidgets_GEN_DIR}/qdateedit_wrapper.cpp ${QtWidgets_GEN_DIR}/qdatetimeedit_wrapper.cpp -${QtWidgets_GEN_DIR}/qdesktopwidget_wrapper.cpp ${QtWidgets_GEN_DIR}/qdial_wrapper.cpp ${QtWidgets_GEN_DIR}/qdialog_wrapper.cpp ${QtWidgets_GEN_DIR}/qdialogbuttonbox_wrapper.cpp -${QtWidgets_GEN_DIR}/qdirmodel_wrapper.cpp ${QtWidgets_GEN_DIR}/qdockwidget_wrapper.cpp ${QtWidgets_GEN_DIR}/qdoublespinbox_wrapper.cpp ${QtWidgets_GEN_DIR}/qerrormessage_wrapper.cpp @@ -109,7 +105,6 @@ ${QtWidgets_GEN_DIR}/qmenu_wrapper.cpp ${QtWidgets_GEN_DIR}/qmenubar_wrapper.cpp ${QtWidgets_GEN_DIR}/qmessagebox_wrapper.cpp ${QtWidgets_GEN_DIR}/qmouseeventtransition_wrapper.cpp -${QtWidgets_GEN_DIR}/qopenglwidget_wrapper.cpp ${QtWidgets_GEN_DIR}/qpangesture_wrapper.cpp ${QtWidgets_GEN_DIR}/qpinchgesture_wrapper.cpp ${QtWidgets_GEN_DIR}/qplaintextdocumentlayout_wrapper.cpp @@ -124,7 +119,6 @@ ${QtWidgets_GEN_DIR}/qscrollarea_wrapper.cpp ${QtWidgets_GEN_DIR}/qscrollbar_wrapper.cpp ${QtWidgets_GEN_DIR}/qscroller_wrapper.cpp ${QtWidgets_GEN_DIR}/qscrollerproperties_wrapper.cpp -${QtWidgets_GEN_DIR}/qshortcut_wrapper.cpp ${QtWidgets_GEN_DIR}/qsizegrip_wrapper.cpp ${QtWidgets_GEN_DIR}/qsizepolicy_wrapper.cpp ${QtWidgets_GEN_DIR}/qslider_wrapper.cpp @@ -190,9 +184,6 @@ ${QtWidgets_GEN_DIR}/qtreeview_wrapper.cpp ${QtWidgets_GEN_DIR}/qtreewidget_wrapper.cpp ${QtWidgets_GEN_DIR}/qtreewidgetitem_wrapper.cpp ${QtWidgets_GEN_DIR}/qtreewidgetitemiterator_wrapper.cpp -${QtWidgets_GEN_DIR}/qundocommand_wrapper.cpp -${QtWidgets_GEN_DIR}/qundogroup_wrapper.cpp -${QtWidgets_GEN_DIR}/qundostack_wrapper.cpp ${QtWidgets_GEN_DIR}/qundoview_wrapper.cpp ${QtWidgets_GEN_DIR}/qvboxlayout_wrapper.cpp ${QtWidgets_GEN_DIR}/qwhatsthis_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index d2fc0705e..160082d07 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -235,7 +235,7 @@ <object-type name="QLayoutItem"> - <modify-function signature="widget()"> + <modify-function signature="widget()const"> <modify-argument index="return"> <define-ownership class="target" owner="default"/> </modify-argument> @@ -461,19 +461,6 @@ <enum-type name="SliderAction"/> <enum-type name="SliderChange"/> </object-type> - <object-type name="QActionGroup"> - <enum-type name="ExclusionPolicy" since="5.14"/> - <modify-function signature="addAction(QAction*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="removeAction(QAction*)"> - <modify-argument index="1"> - <parent index="this" action="remove"/> - </modify-argument> - </modify-function> - </object-type> <object-type name="QCheckBox"/> <object-type name="QCommonStyle"> </object-type> @@ -525,14 +512,6 @@ </modify-argument> </modify-function> </object-type> - <object-type name="QDirModel" polymorphic-id-expression="qobject_cast<QDirModel*>(%1)"> - <enum-type name="Roles"/> - <modify-function signature="setIconProvider(QFileIconProvider*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - </object-type> <object-type name="QFileIconProvider"> <enum-type name="IconType"/> <enum-type name="Option" flags="Options"/> @@ -638,8 +617,6 @@ <object-type name="QItemDelegate"> <!-- ### "doLayout(...)" is an internal method. --> <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const" remove="all"/> - <!-- ### "selected(QPixmap,QPalette,bool)" is an internal method. --> - <modify-function signature="selected(QPixmap,QPalette,bool)const" remove="all"/> <!-- ### --> <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const"> <modify-argument index="1" invalidate-after-use="yes"/> @@ -963,15 +940,6 @@ </modify-function> </object-type> - <object-type name="QShortcut"> - <add-function signature="QShortcut(QKeySequence&,QWidget*,PyCallable*,Qt::ShortcutContext)"> - <modify-argument index="4"> - <replace-default-expression with="Qt::WindowShortcut"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qshortcut-1"/> - <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qshortcut-2"/> - </add-function> - </object-type> <object-type name="QSpacerItem"/> <object-type name="QStatusBar"> <modify-function signature="addWidget(QWidget*,int)"> @@ -1078,40 +1046,6 @@ </modify-argument> </modify-function> </object-type> - <object-type name="QUndoCommand"> - <modify-function signature="mergeWith(const QUndoCommand*)"> - <modify-argument index="1" invalidate-after-use="yes"/> - </modify-function> - </object-type> - <object-type name="QUndoGroup"> - <modify-function signature="addStack(QUndoStack*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="removeStack(QUndoStack*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - </object-type> - <object-type name="QUndoStack"> - <modify-function signature="createUndoAction(QObject*,const QString&)const"> - <modify-argument index="return"> - <parent index="1" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="createRedoAction(QObject*,const QString&)const"> - <modify-argument index="return"> - <parent index="1" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="push(QUndoCommand*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - </object-type> <object-type name="QUndoView"> <modify-function signature="setGroup(QUndoGroup*)"> <modify-argument index="1"> @@ -1252,8 +1186,6 @@ <object-type name="QColorDialog"> <enum-type name="ColorDialogOption" flags="ColorDialogOptions"/> <modify-function signature="getColor(const QColor&,QWidget*,const QString&,QFlags<QColorDialog::ColorDialogOption>)" allow-thread="yes"/> - <!-- Qt5: obsolete --> - <modify-function signature="getRgba(unsigned int,bool*,QWidget*)" remove="all"/> </object-type> <object-type name="QLayout"> @@ -1562,16 +1494,6 @@ </inject-code> </modify-function> - <modify-function signature="getDouble(QWidget*,const QString&,const QString&,double,double,double,int,bool*,QFlags<Qt::WindowType>)" allow-thread="yes"> - <modify-argument index="8"> - <remove-default-expression/> - <remove-argument/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg"/> - </inject-code> - </modify-function> - <modify-function signature="getDouble(QWidget*,const QString&,const QString&,double,double,double,int,bool*,QFlags<Qt::WindowType>,double)" allow-thread="yes"> <modify-argument index="8"> <remove-default-expression/> @@ -2024,7 +1946,7 @@ <object-type name="QWidget" delete-in-main-thread="true"> <!-- see QWindow::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() --> - <modify-function signature="nativeEvent(const QByteArray &,void*,long*)"> + <modify-function signature="nativeEvent(const QByteArray &,void*,qintptr*)"> <modify-argument index="3"> <remove-argument/> <conversion-rule class="native"> @@ -2225,33 +2147,6 @@ </modify-argument> </modify-function> - <modify-function signature="getContentsMargins(int*,int*,int*,int*)const"> - <modify-argument index="0"> - <replace-type modified-type="PyObject"/> - </modify-argument> - <modify-argument index="1"> - <remove-argument/> - </modify-argument> - <modify-argument index="2"> - <remove-argument/> - </modify-argument> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <modify-argument index="4"> - <remove-argument/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_number*,number*,number*,number*"> - <replace from="$TYPE" to="int"/> - </insert-template> - </inject-code> - <inject-code class="native" position="end"> - <insert-template name="fix_native_return_number*,number*,number*,number*"> - <replace from="$TYPE" to="int"/> - </insert-template> - </inject-code> - </modify-function> <modify-function signature="insertAction(QAction*,QAction*)"> <modify-argument index="2"> <parent index="this" action="add"/> @@ -2706,28 +2601,6 @@ </modify-argument> </modify-function> <modify-function signature="del()" rename="del_"/> - <modify-function signature="getTextMargins(int*,int*,int*,int*)const"> - <modify-argument index="0"> - <replace-type modified-type="PyObject*"/> - </modify-argument> - <modify-argument index="1"> - <remove-argument/> - </modify-argument> - <modify-argument index="2"> - <remove-argument/> - </modify-argument> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <modify-argument index="4"> - <remove-argument/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_number*,number*,number*,number*"> - <replace from="$TYPE" to="int"/> - </insert-template> - </inject-code> - </modify-function> <add-function signature="addAction(QAction*)"> <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlineedit-addaction"/> @@ -2738,9 +2611,6 @@ <enum-type name="Mode"/> <enum-type name="SegmentStyle"/> </object-type> - <object-type name="QOpenGLWidget"> - <enum-type name="UpdateBehavior"/> - </object-type> <object-type name="QSplashScreen"> <!-- Override QWidget.painter --> <modify-function signature="repaint()" remove="all"/> @@ -2761,7 +2631,6 @@ </modify-argument> </modify-function> </object-type> - <object-type name="QDesktopWidget"/> <object-type name="QFrame"> <enum-type name="Shadow"/> <enum-type name="Shape"/> @@ -2782,7 +2651,7 @@ sys.exit(app.exec_()) </inject-documentation> </modify-function> - <modify-function signature="valueChanged(QString)"> + <modify-function signature="textChanged(QString)"> <inject-documentation mode="append" format="target"> :: @@ -2943,20 +2812,8 @@ </modify-function> <modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/> </object-type> - <object-type name="QAction"> - <enum-type name="ActionEvent"/> - <enum-type name="MenuRole"/> - <enum-type name="Priority" since="4.6"/> - <modify-function signature="setMenu(QMenu*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="triggered(bool)" allow-thread="yes"/> - </object-type> <object-type name="QApplication"> - <enum-type name="ColorSpec"/> <extra-includes> <include file-name="QBasicTimer" location="global"/> <include file-name="QFont" location="global"/> diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index a0ca23662..6d8c0876d 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -647,8 +647,10 @@ if (%PYARG_0 == Py_None) // @snippet qline-hash namespace PySide { - template<> inline Py_ssize_t hash(const QLine &v) { - return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2()))); + template<> inline Py_ssize_t hash(const QLine &l) + { + const int v[4] = {l.x1(), l.y1(), l.x2(), l.y2()}; + return qHashRange(v, v + 4); } }; // @snippet qline-hash @@ -723,8 +725,9 @@ namespace PySide { // @snippet qrect namespace PySide { - template<> inline Py_ssize_t hash(const QRect &v) { - return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height()))); + template<> inline Py_ssize_t hash(const QRect &r) { + const int v[4] = {r.x(), r.y(), r.width(), r.height()}; + return qHashRange(v, v + 4); } }; // @snippet qrect @@ -801,11 +804,6 @@ static QObject *_findChildHelper(const QObject *parent, const QString &name, PyT return nullptr; } -static inline bool _findChildrenComparator(const QObject *&child, const QRegExp &name) -{ - return name.indexIn(child->objectName()) != -1; -} - static inline bool _findChildrenComparator(const QObject *&child, const QRegularExpression &name) { return name.match(child->objectName()).hasMatch(); diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp index a6b45b7c0..2a139fe69 100644 --- a/sources/pyside2/PySide2/glue/qtgui.cpp +++ b/sources/pyside2/PySide2/glue/qtgui.cpp @@ -144,7 +144,7 @@ for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){ // @snippet qpixmap // @snippet qimage-constbits -%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount()); +%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.sizeInBytes()); // @snippet qimage-constbits // @snippet qimage-bits diff --git a/sources/pyside2/PySide2/pysideqtesttouch.h b/sources/pyside2/PySide2/pysideqtesttouch.h index 115c7835e..7c08fbc02 100644 --- a/sources/pyside2/PySide2/pysideqtesttouch.h +++ b/sources/pyside2/PySide2/pysideqtesttouch.h @@ -142,12 +142,12 @@ namespace QTest private: #ifdef QT_WIDGETS_LIB - PySideQTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit) + PySideQTouchEventSequence(QWidget *widget, QInputDevice *aDevice, bool autoCommit) : targetWidget(widget), targetWindow(0), device(aDevice), commitWhenDestroyed(autoCommit) { } #endif - PySideQTouchEventSequence(QWindow *window, QTouchDevice *aDevice, bool autoCommit) + PySideQTouchEventSequence(QWindow *window, QInputDevice *aDevice, bool autoCommit) : #ifdef QT_WIDGETS_LIB targetWidget(0), @@ -195,18 +195,18 @@ private: QWidget *targetWidget; #endif QWindow *targetWindow; - QTouchDevice *device; + QInputDevice *device; bool commitWhenDestroyed; #ifdef QT_WIDGETS_LIB - friend PySideQTouchEventSequence *generateTouchEvent(QWidget *, QTouchDevice *, bool); + friend PySideQTouchEventSequence *generateTouchEvent(QWidget *, QInputDevice *, bool); #endif - friend PySideQTouchEventSequence *generateTouchEvent(QWindow *, QTouchDevice *, bool); + friend PySideQTouchEventSequence *generateTouchEvent(QWindow *, QInputDevice *, bool); }; #ifdef QT_WIDGETS_LIB inline PySideQTouchEventSequence *generateTouchEvent(QWidget *widget, - QTouchDevice *device, + QInputDevice *device, bool autoCommit = true) { return new PySideQTouchEventSequence(widget, device, autoCommit); @@ -214,7 +214,7 @@ private: #endif inline PySideQTouchEventSequence *generateTouchEvent(QWindow *window, - QTouchDevice *device, + QInputDevice *device, bool autoCommit = true) { return new PySideQTouchEventSequence(window, device, autoCommit); diff --git a/sources/pyside2/PySide2/templates/core_common.xml b/sources/pyside2/PySide2/templates/core_common.xml index 6d02428ad..b6fb72a2f 100644 --- a/sources/pyside2/PySide2/templates/core_common.xml +++ b/sources/pyside2/PySide2/templates/core_common.xml @@ -242,8 +242,8 @@ <!-- Helpers for modifying "bool nativeEventFilter(QByteArray, void*, long *result)" to return a tuple of bool,long --> <template name="return_native_eventfilter_conversion_variables"> - long resultVar{0}; - long *%out = &resultVar; + qintptr resultVar{0}; + qintptr *%out = &resultVar; </template> <template name="return_native_eventfilter_conversion"> %RETURN_TYPE %out = false; diff --git a/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h b/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h index bdb7bcf22..d2cda4aa2 100644 --- a/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h +++ b/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h @@ -48,7 +48,8 @@ ** ****************************************************************************/ -from PySide2.QtWidgets import (QAction, QApplication, QMainWindow, QMenu, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QMainWindow, QMenu, QPlainTextEdit, QSessionManager) diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py index 64f831e5d..656609a55 100644 --- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py +++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py @@ -39,8 +39,8 @@ ############################################################################# from PySide2.QtCore import Slot, qApp -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import QMainWindow, QAction +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import QMainWindow class MainWindow(QMainWindow): diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py index 9f7c6814f..2157b7b15 100644 --- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py +++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py @@ -39,8 +39,8 @@ ############################################################################# from PySide2.QtCore import Slot, qApp -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import QMainWindow, QAction +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import QMainWindow class MainWindow(QMainWindow): diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py index 4786365e8..30d6582ba 100644 --- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py +++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py @@ -39,8 +39,8 @@ ############################################################################# from PySide2.QtCore import Slot, qApp -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import QMainWindow, QAction +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import QMainWindow class MainWindow(QMainWindow): diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py index c223aa69b..9e9ea8472 100644 --- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py +++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py @@ -39,8 +39,8 @@ ############################################################################# from PySide2.QtCore import Slot, qApp -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import QMainWindow, QAction +from PySide2.QtGui import QAction, QKeySequence +from PySide2.QtWidgets import QMainWindow class MainWindow(QMainWindow): diff --git a/sources/pyside2/doc/tutorials/expenses/main.py b/sources/pyside2/doc/tutorials/expenses/main.py index 6cc911671..d927f126c 100644 --- a/sources/pyside2/doc/tutorials/expenses/main.py +++ b/sources/pyside2/doc/tutorials/expenses/main.py @@ -40,8 +40,8 @@ import sys from PySide2.QtCore import Qt, Slot -from PySide2.QtGui import QPainter -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction, QPainter +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) from PySide2.QtCharts import QtCharts diff --git a/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py index 0546bc9f3..9ffb2f9d0 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py @@ -39,7 +39,8 @@ ############################################################################# import sys -from PySide2.QtWidgets import QAction, QApplication, QMainWindow +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QApplication, QMainWindow class MainWindow(QMainWindow): diff --git a/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py index bc753309f..1cb2f0035 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import QAction, QApplication, QMainWindow +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QApplication, QMainWindow from PySide2.QtCharts import QtCharts diff --git a/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py index 78e9b1d1d..80a5cb16f 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import QAction, QApplication, QMainWindow, QWidget +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QApplication, QMainWindow, QWidget class Widget(QWidget): diff --git a/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py index 6fd515f40..a72f8d990 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QMainWindow, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QMainWindow, QTableWidget, QTableWidgetItem, QWidget) diff --git a/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py index 38fa881bf..e2c32e5c6 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) diff --git a/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py index 6b915806d..acc7edc7c 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) diff --git a/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py index 2f18dff9f..a6003cb35 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py @@ -40,7 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) diff --git a/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py index 6b5d87e2e..3f1aed2c9 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py @@ -40,8 +40,8 @@ import sys from PySide2.QtCore import Slot -from PySide2.QtGui import QPainter -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction, QPainter +from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) from PySide2.QtCharts import QtCharts diff --git a/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py index 6cc911671..2a7bddab0 100644 --- a/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py +++ b/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py @@ -40,8 +40,8 @@ import sys from PySide2.QtCore import Qt, Slot -from PySide2.QtGui import QPainter -from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, +from PySide2.QtGui import QAction, QPainter +from PySide2.QtWidgets import (QQApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) from PySide2.QtCharts import QtCharts diff --git a/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py b/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py index 4bc4cf48b..8b0c7a6ad 100644 --- a/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py +++ b/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py @@ -40,7 +40,8 @@ from __future__ import print_function, absolute_import -from PySide2.QtWidgets import (QAction, QAbstractItemView, qApp, QDataWidgetMapper, +from PySide2.QtGui import QAction +from PySide2.QtWidgets import (QAbstractItemView, qApp, QDataWidgetMapper, QHeaderView, QMainWindow, QMessageBox) from PySide2.QtGui import QKeySequence from PySide2.QtSql import (QSqlRelation, QSqlRelationalTableModel, QSqlTableModel, diff --git a/sources/pyside2/plugins/CMakeLists.txt b/sources/pyside2/plugins/CMakeLists.txt index c9e652800..4daf81944 100644 --- a/sources/pyside2/plugins/CMakeLists.txt +++ b/sources/pyside2/plugins/CMakeLists.txt @@ -11,11 +11,7 @@ set(ui_plugin_moc ) include_directories(${Qt${QT_MAJOR_VERSION}Designer_INCLUDE_DIRS}) -if (${QT_MAJOR_VERSION} GREATER_EQUAL 6) - qt6_wrap_cpp(MOC_FILES ${ui_plugin_moc}) -else() - qt5_wrap_cpp(MOC_FILES ${ui_plugin_moc}) -endif() +qt_wrap_cpp(MOC_FILES ${ui_plugin_moc}) add_library(uiplugin STATIC ${ui_plugin_src} ${MOC_FILES}) if(CMAKE_HOST_UNIX AND NOT CYGWIN) diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt index a151e6d11..419d5131b 100644 --- a/sources/pyside2/tests/QtCore/CMakeLists.txt +++ b/sources/pyside2/tests/QtCore/CMakeLists.txt @@ -97,7 +97,6 @@ PYSIDE_TEST(qpoint_test.py) PYSIDE_TEST(qprocess_test.py) PYSIDE_TEST(qproperty_decorator.py) PYSIDE_TEST(qrect_test.py) -PYSIDE_TEST(qregexp_test.py) PYSIDE_TEST(qregularexpression_test.py) PYSIDE_TEST(qresource_test.py) PYSIDE_TEST(qsettings_test.py) @@ -111,7 +110,6 @@ PYSIDE_TEST(qstate_test.py) PYSIDE_TEST(qstorageinfo_test.py) PYSIDE_TEST(qstring_test.py) PYSIDE_TEST(qsysinfo_test.py) -PYSIDE_TEST(qtext_codec_test.py) PYSIDE_TEST(qtextstream_test.py) PYSIDE_TEST(qthread_prod_cons_test.py) PYSIDE_TEST(qthread_signal_test.py) diff --git a/sources/pyside2/tests/QtCore/qobject_parent_test.py b/sources/pyside2/tests/QtCore/qobject_parent_test.py index 0a02fbc26..386209e8a 100644 --- a/sources/pyside2/tests/QtCore/qobject_parent_test.py +++ b/sources/pyside2/tests/QtCore/qobject_parent_test.py @@ -148,10 +148,6 @@ class ParentCase(unittest.TestCase): res = parent.findChildren(QObject, QRegularExpression("^fo+")) self.assertEqual(res, test_children) - # test findChildren with a QRegExp (deprecated) - res = parent.findChildren(QObject, QRegExp("^fo+")) - self.assertEqual(res, test_children) - def testParentEquality(self): #QObject.parent() == parent parent = QObject() diff --git a/sources/pyside2/tests/QtCore/qregexp_test.py b/sources/pyside2/tests/QtCore/qregexp_test.py deleted file mode 100644 index a031137fd..000000000 --- a/sources/pyside2/tests/QtCore/qregexp_test.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide2.QtCore import QRegExp - -class QRegExpTest(unittest.TestCase): - - def testReplace1(self): - re = QRegExp('a[mn]') - string = re.replace('Banana', 'ox') - self.assertEqual(string, 'Boxoxa') - - def testReplace2(self): - re = QRegExp('<i>([^<]*)</i>') - string = re.replace('A <i>bon mot</i>.', '\\emph{\\1}') - self.assertEqual(string, 'A \\emph{bon mot}.') - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtCore/qtext_codec_test.py b/sources/pyside2/tests/QtCore/qtext_codec_test.py deleted file mode 100644 index 9e41c38c6..000000000 --- a/sources/pyside2/tests/QtCore/qtext_codec_test.py +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import gc -import os -import sys -import unittest - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide2.QtCore import QTextCodec - -class TestCodecGetters(unittest.TestCase): - - def testCodecsNames(self): - for codec_name in QTextCodec.availableCodecs(): - codec = QTextCodec.codecForName(codec_name) - self.assertTrue(type(codec), QTextCodec) - - def testCodecsMibs(self): - for codec_num in QTextCodec.availableMibs(): - codec = QTextCodec.codecForMib(codec_num) - self.assertTrue(type(codec), QTextCodec) - - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtCore/qtextstream_test.py b/sources/pyside2/tests/QtCore/qtextstream_test.py index bd25367c3..d4bbd8479 100644 --- a/sources/pyside2/tests/QtCore/qtextstream_test.py +++ b/sources/pyside2/tests/QtCore/qtextstream_test.py @@ -38,7 +38,7 @@ init_test_paths(False) import py3kcompat as py3k -from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QTextCodec, QFile +from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QFile class QTextStreamShiftTest(unittest.TestCase): @@ -61,14 +61,6 @@ class QTextStreamGetSet(unittest.TestCase): def setUp(self): self.obj = QTextStream() - - def testCodec(self): - '''QTextStream set/get Codec''' - - codec = QTextCodec.codecForName('ISO8859-1') - self.obj.setCodec(codec) - self.assertEqual(codec, self.obj.codec()) - def testDevice(self): '''QTextStream get/set Device''' device = QFile() @@ -83,7 +75,6 @@ class QTextStreamInitialization(unittest.TestCase): '''QTextStream construction''' obj = QTextStream() - self.assertEqual(obj.codec(), QTextCodec.codecForLocale()) self.assertEqual(obj.device(), None) self.assertEqual(obj.string(), None) diff --git a/sources/pyside2/tests/QtCore/qurlquery_test.py b/sources/pyside2/tests/QtCore/qurlquery_test.py index ac7ab69b0..6e538c919 100644 --- a/sources/pyside2/tests/QtCore/qurlquery_test.py +++ b/sources/pyside2/tests/QtCore/qurlquery_test.py @@ -45,8 +45,6 @@ class QUrlQueryTest(unittest.TestCase): def testConstructing(self): empty = QUrlQuery() self.assertTrue(empty.isEmpty()) - self.assertEqual(empty.queryPairDelimiter(), QUrlQuery.defaultQueryPairDelimiter()) - self.assertEqual(empty.queryValueDelimiter(), QUrlQuery.defaultQueryValueDelimiter()) empty.clear(); self.assertTrue(empty.isEmpty()) diff --git a/sources/pyside2/tests/QtGui/CMakeLists.txt b/sources/pyside2/tests/QtGui/CMakeLists.txt index 172703ab9..179e88fd6 100644 --- a/sources/pyside2/tests/QtGui/CMakeLists.txt +++ b/sources/pyside2/tests/QtGui/CMakeLists.txt @@ -26,8 +26,6 @@ PYSIDE_TEST(qfontmetrics_test.py) PYSIDE_TEST(qguiapplication_test.py) PYSIDE_TEST(qicon_test.py) PYSIDE_TEST(qitemselection_test.py) -PYSIDE_TEST(qmatrix_test.py) -PYSIDE_TEST(qopenglbuffer_test.py) PYSIDE_TEST(qpainter_test.py) PYSIDE_TEST(qpdfwriter_test.py) PYSIDE_TEST(qpixelformat_test.py) @@ -37,7 +35,6 @@ PYSIDE_TEST(qpolygonf_test.py) PYSIDE_TEST(qkeysequence_test.py) PYSIDE_TEST(qradialgradient_test.py) PYSIDE_TEST(qrasterwindow_test.py) -PYSIDE_TEST(qopenglwindow_test.py) PYSIDE_TEST(qregion_test.py) PYSIDE_TEST(qstylehints_test.py) PYSIDE_TEST(qtextdocument_functions.py) diff --git a/sources/pyside2/tests/QtGui/deepcopy_test.py b/sources/pyside2/tests/QtGui/deepcopy_test.py index d4dcdd64c..0fa82150f 100644 --- a/sources/pyside2/tests/QtGui/deepcopy_test.py +++ b/sources/pyside2/tests/QtGui/deepcopy_test.py @@ -36,7 +36,6 @@ from init_paths import init_test_paths init_test_paths(False) from PySide2.QtCore import QPoint -from PySide2.QtGui import QMatrix from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4 from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4 from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4 @@ -81,7 +80,7 @@ class QColorCMYKDeepCopy(DeepCopyColorHelperF, unittest.TestCase): class QTransformDeepCopy(DeepCopyHelper, unittest.TestCase): def setUp(self): - self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8) + self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8, 9) class QKeySequenceDeepCopy(DeepCopyHelper, unittest.TestCase): def setUp(self): @@ -107,10 +106,6 @@ class QPolygonDeepCopy(DeepCopyHelper, unittest.TestCase): def setUp(self): self.original = QPolygon([QPoint(1, 2), QPoint(3, 4), QPoint(5, 6)]) -class QMatrixDeepCopy(DeepCopyHelper, unittest.TestCase): - def setUp(self): - self.original = QMatrix(1, 2, 3, 4, 5, 6) - # Avoid these tests until get gcc fixed # Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247 diff --git a/sources/pyside2/tests/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py deleted file mode 100644 index 48380faf6..000000000 --- a/sources/pyside2/tests/QtGui/qmatrix_test.py +++ /dev/null @@ -1,106 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -import os -import sys -import unittest - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide2.QtCore import QPoint -from PySide2.QtGui import QMatrix, QMatrix2x2, QMatrix4x4 - - -def qpointTimesQMatrix(point, matrix): - '''As seen in "QPoint QMatrix::map(const QPoint &p) const" C++ implementation.''' - return QPoint(matrix.m11() * point.x() + matrix.m21() * point.y() + matrix.dx(), - matrix.m12() * point.x() + matrix.m22() * point.y() + matrix.dy()) - -class QMatrixTest(unittest.TestCase): - - def testMatrix(self): - matrix = QMatrix(11, 12, 21, 22, 100, 200) - point = QPoint(3, 3) - self.assertEqual(matrix.map(point), qpointTimesQMatrix(point, matrix)) - - def testMatrixWithWrongType(self): - matrix = QMatrix(11, 12, 21, 22, 100, 200) - point = QPoint(3, 3) - # This exception may move from a TypeError to a ValueError. - self.assertRaises((TypeError, ValueError), matrix.__mul__, point) - - def testMatrix2x2(self): - matrix = QMatrix2x2([1.0, 2.0, 3.0, 4.0]) - - expectedTransposed = QMatrix2x2([1.0, 3.0, 2.0, 4.0]) - self.assertEqual(matrix.transposed(), expectedTransposed) - - expectedMultiplied = QMatrix2x2([2.0, 4.0, 6.0, 8.0]) - matrix *= 2.0 - self.assertEqual(matrix, expectedMultiplied) - - matrix.setToIdentity() - self.assertTrue(matrix.isIdentity()) - - def testMatrix4x4(self): - self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0]) - self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I', - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 'N', 11.0, - 12.0, 'd', 14.0, 'T']) - - my_data = [0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 11.0, - 12.0, 13.0, 14.0, 15.0] - my_datac = [0.0, 4.0, 8.0, 12.0, - 1.0, 5.0, 9.0, 13.0, - 2.0, 6.0, 10.0, 14.0, - 3.0, 7.0, 11.0, 15.0] - - m = QMatrix4x4(my_data) - d = m.data() - self.assertTrue(my_datac, d) - - d = m.copyDataTo() - self.assertTrue(my_data == list(d)) - - def testMatrixMapping(self): - m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0) - res = m.map(5, 5) - self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0) - self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0) - res = m.map(5.0, 5.0) - self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0) - self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0) - -if __name__ == '__main__': - unittest.main() - diff --git a/sources/pyside2/tests/QtGui/qtextdocument_functions.py b/sources/pyside2/tests/QtGui/qtextdocument_functions.py index 765a6b5b7..bd1462049 100644 --- a/sources/pyside2/tests/QtGui/qtextdocument_functions.py +++ b/sources/pyside2/tests/QtGui/qtextdocument_functions.py @@ -35,7 +35,6 @@ from init_paths import init_test_paths init_test_paths(False) from PySide2.QtGui import Qt -from PySide2.QtCore import QTextCodec class QTextDocumentFunctions(unittest.TestCase): @@ -45,8 +44,6 @@ class QTextDocumentFunctions(unittest.TestCase): self.assertTrue(Qt.mightBeRichText('<html><head/><body><p>bla</p></body></html>')) html = Qt.convertFromPlainText("A & B", Qt.WhiteSpaceNormal) self.assertEqual(html, '<p>A & B</p>') - codec = Qt.codecForHtml(b'bla') - self.assertTrue(codec) if __name__ == '__main__': diff --git a/sources/pyside2/tests/QtGui/repr_test.py b/sources/pyside2/tests/QtGui/repr_test.py index e06f4d487..770c9d5bd 100644 --- a/sources/pyside2/tests/QtGui/repr_test.py +++ b/sources/pyside2/tests/QtGui/repr_test.py @@ -36,7 +36,6 @@ init_test_paths(False) import PySide2 from PySide2.QtCore import QPoint -from PySide2.QtGui import QMatrix from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4 from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4 from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4 @@ -52,7 +51,7 @@ class ReprCopyHelper: class QTransformReprCopy(ReprCopyHelper, unittest.TestCase): def setUp(self): - self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8) + self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8, 9) class QKeySequenceReprCopy(ReprCopyHelper, unittest.TestCase): def setUp(self): @@ -74,10 +73,6 @@ class QVector4DReprCopy(ReprCopyHelper, unittest.TestCase): def setUp(self): self.original = QVector4D(1, 2, 3, 4) -class QMatrixReprCopy(ReprCopyHelper, unittest.TestCase): - def setUp(self): - self.original = QMatrix(1, 2, 3, 4, 5, 6) - # Avoid these tests until get gcc fixed # Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247 diff --git a/sources/pyside2/tests/QtNetwork/bug_446.py b/sources/pyside2/tests/QtNetwork/bug_446.py index f15ff01f9..e94bef510 100644 --- a/sources/pyside2/tests/QtNetwork/bug_446.py +++ b/sources/pyside2/tests/QtNetwork/bug_446.py @@ -49,7 +49,7 @@ class HttpSignalsCase(UsesQCoreApplication): def onNewConnection(self): self.serverConnection = self.server.nextPendingConnection() - self.serverConnection.error.connect(self.onError) + self.serverConnection.errorOccurred.connect(self.onError) self.serverConnection.write(HttpSignalsCase.DATA) self.server.close() diff --git a/sources/pyside2/tests/QtOpenGL/CMakeLists.txt b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt index b37a9ddce..a0e8d0053 100644 --- a/sources/pyside2/tests/QtOpenGL/CMakeLists.txt +++ b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt @@ -1,2 +1,4 @@ PYSIDE_TEST(qglbuffer_test.py) PYSIDE_TEST(qglwidget_test.py) +PYSIDE_TEST(qopenglbuffer_test.py) +PYSIDE_TEST(qopenglwindow_test.py) diff --git a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py b/sources/pyside2/tests/QtOpenGL/qopenglbuffer_test.py index a5d8385c9..a5d8385c9 100644 --- a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py +++ b/sources/pyside2/tests/QtOpenGL/qopenglbuffer_test.py diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py index 2439e7203..07db9802e 100644 --- a/sources/pyside2/tests/QtUiTools/bug_392.py +++ b/sources/pyside2/tests/QtUiTools/bug_392.py @@ -53,7 +53,7 @@ class BugTest(UsesQApplication): filePath = os.path.join(os.path.dirname(__file__), 'action.ui') result = loader.load(filePath, w) - self.assertTrue(isinstance(result.actionFoo, QtWidgets.QAction)) + self.assertTrue(isinstance(result.actionFoo, QtGui.QAction)) def testPythonCustomWidgets(self): w = QtWidgets.QWidget() diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py index e84da0382..15cfeee2b 100644 --- a/sources/pyside2/tests/QtUiTools/bug_426.py +++ b/sources/pyside2/tests/QtUiTools/bug_426.py @@ -42,7 +42,7 @@ class Window(object): loader = QUiLoader() filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui') self.widget = loader.load(filePath) - self.group = QtWidgets.QActionGroup(self.widget) + self.group = QtGui.QActionGroup(self.widget) self.widget.show() QtCore.QTimer.singleShot(0, self.widget.close) diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt index 6682136ea..695749a92 100644 --- a/sources/pyside2/tests/QtWidgets/CMakeLists.txt +++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt @@ -9,7 +9,6 @@ PYSIDE_TEST(bug_243.py) PYSIDE_TEST(bug_307.py) PYSIDE_TEST(bug_324.py) PYSIDE_TEST(bug_338.py) -PYSIDE_TEST(bug_363.py) PYSIDE_TEST(bug_389.py) PYSIDE_TEST(bug_400.py) PYSIDE_TEST(bug_416.py) diff --git a/sources/pyside2/tests/QtWidgets/add_action_test.py b/sources/pyside2/tests/QtWidgets/add_action_test.py index c8a7c2269..d4af8b5d1 100644 --- a/sources/pyside2/tests/QtWidgets/add_action_test.py +++ b/sources/pyside2/tests/QtWidgets/add_action_test.py @@ -37,7 +37,8 @@ from init_paths import init_test_paths init_test_paths(False) from PySide2.QtCore import SLOT -from PySide2.QtWidgets import QMenuBar, QAction, QPushButton +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QMenuBar, QPushButton from helper.usesqapplication import UsesQApplication diff --git a/sources/pyside2/tests/QtWidgets/bug_363.py b/sources/pyside2/tests/QtWidgets/bug_363.py deleted file mode 100644 index 910525fed..000000000 --- a/sources/pyside2/tests/QtWidgets/bug_363.py +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the test suite of Qt for Python. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363''' - -import os -import sys -import unittest - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from init_paths import init_test_paths -init_test_paths(False) - -from helper.usesqapplication import UsesQApplication -from PySide2 import QtCore, QtWidgets - -# Check for desktop object lifetime -class BugTest(UsesQApplication): - def mySlot(self): - pass - - # test if it is possible to connect with a desktop object after storing that on an auxiliar variable - def testCase1(self): - desktop = QtWidgets.QApplication.desktop() - desktop.resized[int].connect(self.mySlot) - self.assertTrue(True) - - # test if it is possible to connect with a desktop object without storing that on an auxiliar variable - def testCase2(self): - QtWidgets.QApplication.desktop().resized[int].connect(self.mySlot) - self.assertTrue(True) - -if __name__ == '__main__': - unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_711.py b/sources/pyside2/tests/QtWidgets/bug_711.py index 43e4b7bb2..3898e23f5 100644 --- a/sources/pyside2/tests/QtWidgets/bug_711.py +++ b/sources/pyside2/tests/QtWidgets/bug_711.py @@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(False) -from PySide2.QtWidgets import QToolBar, QApplication, QAction, QToolButton +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QToolBar, QApplication, QToolButton try: xrange diff --git a/sources/pyside2/tests/QtWidgets/bug_860.py b/sources/pyside2/tests/QtWidgets/bug_860.py index 8cdab2e45..483973fdb 100644 --- a/sources/pyside2/tests/QtWidgets/bug_860.py +++ b/sources/pyside2/tests/QtWidgets/bug_860.py @@ -52,7 +52,7 @@ class MultipleSlotTest(UsesQApplication): box.stateChanged.connect(checkboxMapper.map) checkboxMapper.setMapping(box, box.text()) - checkboxMapper.mapped[str].connect(self.cb_changed) + checkboxMapper.mappedString[str].connect(self.cb_changed) self._changed = False box.setChecked(True) self.assertTrue(self._changed) diff --git a/sources/pyside2/tests/QtWidgets/qaction_test.py b/sources/pyside2/tests/QtWidgets/qaction_test.py index 8fc8f6c05..d587a59b1 100644 --- a/sources/pyside2/tests/QtWidgets/qaction_test.py +++ b/sources/pyside2/tests/QtWidgets/qaction_test.py @@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(False) -from PySide2.QtWidgets import QAction, QWidget +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QWidget from helper.usesqapplication import UsesQApplication class QPainterDrawText(UsesQApplication): diff --git a/sources/pyside2/tests/QtWidgets/qshortcut_test.py b/sources/pyside2/tests/QtWidgets/qshortcut_test.py index 18aec285d..030021475 100644 --- a/sources/pyside2/tests/QtWidgets/qshortcut_test.py +++ b/sources/pyside2/tests/QtWidgets/qshortcut_test.py @@ -38,11 +38,13 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(False) -from PySide2 import QtCore, QtGui, QtWidgets +from PySide2.QtCore import Qt, QTimer +from PySide2.QtGui import QKeySequence, QShortcut +from PySide2.QtWidgets import QApplication, QWidget -class Foo(QtWidgets.QWidget): +class Foo(QWidget): def __init__(self): - QtWidgets.QWidget.__init__(self) + QWidget.__init__(self) self.ok = False self.copy = False @@ -52,9 +54,9 @@ class Foo(QtWidgets.QWidget): def slot_of_copy(self): self.copy = True -class MyShortcut(QtWidgets.QShortcut): +class MyShortcut(QShortcut): def __init__(self, keys, wdg, slot): - QtWidgets.QShortcut.__init__(self, keys, wdg, slot) + QShortcut.__init__(self, keys, wdg, slot) def emit_signal(self): self.emit(QtCore.SIGNAL("activated()")) @@ -62,12 +64,12 @@ class MyShortcut(QtWidgets.QShortcut): class QAppPresence(unittest.TestCase): def testQShortcut(self): - self.qapp = QtWidgets.QApplication([]) + self.qapp = QApplication([]) f = Foo() - self.sc = MyShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), f, f.slot_of_foo) - self.scstd = MyShortcut(QtGui.QKeySequence.Copy, f, f.slot_of_copy) - QtCore.QTimer.singleShot(0, self.init); + self.sc = MyShortcut(QKeySequence(Qt.Key_Return), f, f.slot_of_foo) + self.scstd = MyShortcut(QKeySequence.Copy, f, f.slot_of_copy) + QTimer.singleShot(0, self.init); self.qapp.exec_() self.assertEqual(f.ok, True) self.assertEqual(f.copy, True) diff --git a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py index 0321b69a4..79842aac2 100644 --- a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py +++ b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py @@ -42,8 +42,8 @@ init_test_paths(False) import py3kcompat as py3k from helper.usesqapplication import UsesQApplication -from PySide2.QtGui import QKeySequence -from PySide2.QtWidgets import QAction +from PySide2.QtGui import QAction, QKeySequence + class QStringQKeySequenceTest(UsesQApplication): '''Tests conversions of QString to and from QKeySequence.''' diff --git a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py index 856bf07f3..a70305c4a 100644 --- a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py +++ b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py @@ -36,7 +36,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(False) -from PySide2.QtWidgets import QToolBar, QMainWindow, QAction +from PySide2.QtGui import QAction +from PySide2.QtWidgets import QToolBar, QMainWindow from helper.usesqapplication import UsesQApplication diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index bdd88ea37..cdf653745 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -23,11 +23,7 @@ testview.h hiddenobject.h ) -if (${QT_MAJOR_VERSION} GREATER_EQUAL 6) - qt6_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS}) -else() - qt5_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS}) -endif() +qt_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS}) set(testbinding_SRC ${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp @@ -48,9 +44,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp # Thus we use the second direct path, which contains the actual header files. if(${QT_MAJOR_VERSION} GREATER_EQUAL 6) - set(Qt6Core_DIRECT_INCLUDE_DIR Qt6Core_INCLUDE_DIRS) - set(Qt6Gui_DIRECT_INCLUDE_DIR Qt6Gui_INCLUDE_DIRS) - set(Qt6Widgets_DIRECT_INCLUDE_DIR Qt6Widgets_INCLUDE_DIRS) + set(Qt6Core_DIRECT_INCLUDE_DIR ${Qt6Core_INCLUDE_DIRS}) + set(Qt6Gui_DIRECT_INCLUDE_DIR ${Qt6Gui_INCLUDE_DIRS}) + set(Qt6Widgets_DIRECT_INCLUDE_DIR ${Qt6Widgets_INCLUDE_DIRS}) else() list(GET Qt5Core_INCLUDE_DIRS 1 Qt5Core_DIRECT_INCLUDE_DIR) list(GET Qt5Gui_INCLUDE_DIRS 1 Qt5Gui_DIRECT_INCLUDE_DIR) diff --git a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py index 81a764986..55953ad69 100644 --- a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py +++ b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py @@ -57,7 +57,6 @@ new_functions = """ """ new_functions += """ - PySide2.QtGui.QBitmap().transformed(qMatrix,transformationMode) PySide2.QtGui.QStandardItemModel().insertColumn(int,qModelIndex) PySide2.QtGui.QStandardItemModel().parent() # PySide2.QtGui.QTextList(qTextDocument).setFormat(qTextFormat) # Segmentation fault: 11 @@ -71,8 +70,6 @@ new_functions += """ PySide2.QtWidgets.QApplication.setPalette(qPalette) PySide2.QtWidgets.QBoxLayout(direction).addWidget(qWidget) PySide2.QtWidgets.QColorDialog().open() - PySide2.QtWidgets.QDirModel().index(int,int,qModelIndex) - PySide2.QtWidgets.QDirModel().parent() PySide2.QtWidgets.QFileDialog().open() PySide2.QtWidgets.QFileSystemModel().index(int,int,qModelIndex) PySide2.QtWidgets.QFileSystemModel().parent() @@ -145,7 +142,6 @@ class MainTest(unittest.TestCase): try: PySide2.QtGui #qPaintDevice = PySide2.QtGui.QPaintDevice() # NotImplementedError - qMatrix = PySide2.QtGui.QMatrix() qTextDocument = PySide2.QtGui.QTextDocument() qTextFormat = PySide2.QtGui.QTextFormat() quintptr = long(42) if sys.version_info[0] < 3 else 42 @@ -158,7 +154,7 @@ class MainTest(unittest.TestCase): direction = PySide2.QtWidgets.QBoxLayout.Direction() qWidget = PySide2.QtWidgets.QWidget() qStyleOptionFrame = PySide2.QtWidgets.QStyleOptionFrame() - qAction = PySide2.QtWidgets.QAction(qObject) + qAction = PySide2.QtGui.QAction(qObject) renderFlags = PySide2.QtWidgets.QWidget.RenderFlags except AttributeError: pass diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt index 3de5d3223..ee9692f95 100644 --- a/sources/shiboken2/CMakeLists.txt +++ b/sources/shiboken2/CMakeLists.txt @@ -18,7 +18,7 @@ option(BUILD_TESTS "Build tests." TRUE) option(USE_PYTHON_VERSION "Use specific python version to build shiboken2." "") option(DISABLE_DOCSTRINGS "Disable documentation extraction." FALSE) -set (QT_MAJOR_VERSION 5) +set (QT_MAJOR_VERSION 6) message(STATUS "Using Qt ${QT_MAJOR_VERSION}") find_package(Qt${QT_MAJOR_VERSION} 5.12 REQUIRED COMPONENTS Core) |