aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2023-12-05 13:07:12 +0100
committerAdrian Herrmann <adrian.herrmann@qt.io>2023-12-06 12:56:12 +0100
commit55015346f4107ca3383e7ab54be38e72ec8b07d1 (patch)
treea6187eb90cc52356af576dfebd645f6485099a81
parent592c734e57b00040329b49dfbe11869980dff88a (diff)
Examples: Fix a number of flake8 errors (part 2)
Import changes, i.e., removed or added imports. Pick-to: 6.6 Change-Id: Iadfa8f77846d8ffef0aeea9fd1a6e7e9c4df5106 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--examples/bluetooth/heartrate_game/connectionhandler.py2
-rw-r--r--examples/bluetooth/heartrate_game/devicefinder.py2
-rw-r--r--examples/bluetooth/heartrate_game/heartrate_global.py1
-rw-r--r--examples/demos/documentviewer/mainwindow.py3
-rw-r--r--examples/demos/documentviewer/recentfiles.py2
-rw-r--r--examples/graphs/widgetgallery/main.py1
-rw-r--r--examples/gui/analogclock/main.py3
-rw-r--r--examples/gui/rhiwindow/rhiwindow.py7
-rw-r--r--examples/multimedia/audiosource/audiosource.py2
-rw-r--r--examples/multimedia/camera/camera.py2
-rw-r--r--examples/opengl/hellogl2/window.py3
-rw-r--r--examples/quick3d/proceduraltexture/main.py3
-rw-r--r--examples/quickcontrols/contactslist/main.py1
-rw-r--r--examples/xml/dombookmarks/dombookmarks.py2
14 files changed, 15 insertions, 19 deletions
diff --git a/examples/bluetooth/heartrate_game/connectionhandler.py b/examples/bluetooth/heartrate_game/connectionhandler.py
index 79f2720e7..932a4d2d0 100644
--- a/examples/bluetooth/heartrate_game/connectionhandler.py
+++ b/examples/bluetooth/heartrate_game/connectionhandler.py
@@ -5,7 +5,7 @@ import sys
from PySide6.QtBluetooth import QBluetoothLocalDevice
from PySide6.QtQml import QmlElement
-from PySide6.QtCore import QObject, Property, Signal, Slot, Qt, QCoreApplication
+from PySide6.QtCore import QObject, Property, Signal, Slot, Qt
from heartrate_global import simulator, is_android
diff --git a/examples/bluetooth/heartrate_game/devicefinder.py b/examples/bluetooth/heartrate_game/devicefinder.py
index db42c2fa4..370f29082 100644
--- a/examples/bluetooth/heartrate_game/devicefinder.py
+++ b/examples/bluetooth/heartrate_game/devicefinder.py
@@ -4,7 +4,7 @@
from PySide6.QtBluetooth import (QBluetoothDeviceDiscoveryAgent,
QBluetoothDeviceInfo)
from PySide6.QtQml import QmlElement
-from PySide6.QtCore import QTimer, Property, Signal, Slot, Qt, QCoreApplication
+from PySide6.QtCore import QTimer, Property, Signal, Slot, Qt
from bluetoothbaseclass import BluetoothBaseClass
from deviceinfo import DeviceInfo
diff --git a/examples/bluetooth/heartrate_game/heartrate_global.py b/examples/bluetooth/heartrate_game/heartrate_global.py
index 88c34b876..584c44d21 100644
--- a/examples/bluetooth/heartrate_game/heartrate_global.py
+++ b/examples/bluetooth/heartrate_game/heartrate_global.py
@@ -1,7 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import os
-import sys
_simulator = False
diff --git a/examples/demos/documentviewer/mainwindow.py b/examples/demos/documentviewer/mainwindow.py
index 99202bf75..e9abd0bec 100644
--- a/examples/demos/documentviewer/mainwindow.py
+++ b/examples/demos/documentviewer/mainwindow.py
@@ -1,8 +1,7 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-from PySide6.QtWidgets import (QDialog, QFileDialog, QMainWindow,
- QMessageBox, QToolButton)
+from PySide6.QtWidgets import (QDialog, QFileDialog, QMainWindow, QMessageBox)
from PySide6.QtCore import (QDir, QFile, QFileInfo, QSettings, Slot)
from ui_mainwindow import Ui_MainWindow
diff --git a/examples/demos/documentviewer/recentfiles.py b/examples/demos/documentviewer/recentfiles.py
index 7bcb4c0ef..fdfc56d40 100644
--- a/examples/demos/documentviewer/recentfiles.py
+++ b/examples/demos/documentviewer/recentfiles.py
@@ -3,7 +3,7 @@
from enum import Enum, auto
-from PySide6.QtCore import QFile, QFileInfo, QObject, QSettings, Signal, Slot
+from PySide6.QtCore import QFileInfo, QObject, QSettings, Signal, Slot
DEFAULT_MAX_FILES = 10
diff --git a/examples/graphs/widgetgallery/main.py b/examples/graphs/widgetgallery/main.py
index 4f773e3cb..7bb2238a7 100644
--- a/examples/graphs/widgetgallery/main.py
+++ b/examples/graphs/widgetgallery/main.py
@@ -3,7 +3,6 @@
"""PySide6 port of the Qt Graphs widgetgallery example from Qt v6.x"""
-import os
import sys
from PySide6.QtCore import QSize
diff --git a/examples/gui/analogclock/main.py b/examples/gui/analogclock/main.py
index 7a5064a6e..b1177a479 100644
--- a/examples/gui/analogclock/main.py
+++ b/examples/gui/analogclock/main.py
@@ -4,8 +4,7 @@
import sys
from PySide6.QtCore import QPoint, QTimer, QTime, Qt
-from PySide6.QtGui import (QColor, QGradient, QGuiApplication, QPainter,
- QPalette, QPolygon, QRasterWindow)
+from PySide6.QtGui import QGuiApplication, QPainter, QPalette, QPolygon, QRasterWindow
"""Simplified PySide6 port of the gui/analogclock example from Qt v6.x"""
diff --git a/examples/gui/rhiwindow/rhiwindow.py b/examples/gui/rhiwindow/rhiwindow.py
index b18ce700a..fe054af48 100644
--- a/examples/gui/rhiwindow/rhiwindow.py
+++ b/examples/gui/rhiwindow/rhiwindow.py
@@ -5,11 +5,10 @@ import numpy
import sys
from PySide6.QtCore import (QEvent, QFile, QIODevice, QPointF, QRectF, QSize,
- QSizeF, qFatal, qWarning, Qt)
+ qFatal, qWarning, Qt)
from PySide6.QtGui import (QColor, QFont, QGradient, QImage, QMatrix4x4,
- QOffscreenSurface, QPainter, QPlatformSurfaceEvent,
- QSurface, QWindow)
-from PySide6.QtGui import (QRhi, QRhiBuffer, QRhiCommandBuffer,
+ QPainter, QPlatformSurfaceEvent, QSurface, QWindow)
+from PySide6.QtGui import (QRhi, QRhiBuffer,
QRhiDepthStencilClearValue,
QRhiGraphicsPipeline, QRhiNullInitParams,
QRhiGles2InitParams, QRhiRenderBuffer,
diff --git a/examples/multimedia/audiosource/audiosource.py b/examples/multimedia/audiosource/audiosource.py
index 0adcc7dcf..e07b4285b 100644
--- a/examples/multimedia/audiosource/audiosource.py
+++ b/examples/multimedia/audiosource/audiosource.py
@@ -26,7 +26,7 @@ from PySide6.QtWidgets import (QApplication, QComboBox, QPushButton, QSlider, QV
is_android = os.environ.get('ANDROID_ARGUMENT')
if is_android:
- from PySide6.QtCore import QCoreApplication, QMicrophonePermission
+ from PySide6.QtCore import QMicrophonePermission
class AudioInfo:
diff --git a/examples/multimedia/camera/camera.py b/examples/multimedia/camera/camera.py
index c1ea92faa..8dc372269 100644
--- a/examples/multimedia/camera/camera.py
+++ b/examples/multimedia/camera/camera.py
@@ -17,7 +17,7 @@ from imagesettings import ImageSettings
from videosettings import VideoSettings, is_android
if is_android:
- from PySide6.QtCore import QCoreApplication, QMicrophonePermission, QCameraPermission
+ from PySide6.QtCore import QMicrophonePermission, QCameraPermission
from ui_camera_mobile import Ui_Camera
else:
from ui_camera import Ui_Camera
diff --git a/examples/opengl/hellogl2/window.py b/examples/opengl/hellogl2/window.py
index c7b9946e0..a12636051 100644
--- a/examples/opengl/hellogl2/window.py
+++ b/examples/opengl/hellogl2/window.py
@@ -3,8 +3,7 @@
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
from PySide6.QtCore import Slot, Qt
-from PySide6.QtGui import QGuiApplication
-from PySide6.QtWidgets import (QApplication, QHBoxLayout, QMainWindow,
+from PySide6.QtWidgets import (QHBoxLayout, QMainWindow,
QMessageBox, QPushButton, QSlider,
QVBoxLayout, QWidget)
diff --git a/examples/quick3d/proceduraltexture/main.py b/examples/quick3d/proceduraltexture/main.py
index 971b0ecb4..7c3553aa3 100644
--- a/examples/quick3d/proceduraltexture/main.py
+++ b/examples/quick3d/proceduraltexture/main.py
@@ -6,6 +6,9 @@ from PySide6.QtQml import QQmlApplicationEngine
from gradienttexture import GradientTexture
+from pathlib import Path
+
+import os
import sys
if __name__ == "__main__":
diff --git a/examples/quickcontrols/contactslist/main.py b/examples/quickcontrols/contactslist/main.py
index 58b139cac..9c8f280c8 100644
--- a/examples/quickcontrols/contactslist/main.py
+++ b/examples/quickcontrols/contactslist/main.py
@@ -6,7 +6,6 @@ PySide6 port of Qt Quick Controls Contact List example from Qt v6.x
"""
import sys
from pathlib import Path
-from PySide6.QtCore import QUrl
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine
diff --git a/examples/xml/dombookmarks/dombookmarks.py b/examples/xml/dombookmarks/dombookmarks.py
index 85e423ef5..e292e12c4 100644
--- a/examples/xml/dombookmarks/dombookmarks.py
+++ b/examples/xml/dombookmarks/dombookmarks.py
@@ -7,7 +7,7 @@
import sys
from PySide6.QtCore import QDir, QFile, Qt, QTextStream
-from PySide6.QtGui import QAction, QIcon
+from PySide6.QtGui import QAction, QIcon, QKeySequence
from PySide6.QtWidgets import (QApplication, QFileDialog, QHeaderView,
QMainWindow, QMessageBox, QStyle, QTreeWidget,
QTreeWidgetItem)