Skip to content

Commit

Permalink
update files to qt wrapper imports
Browse files Browse the repository at this point in the history
  • Loading branch information
looooo committed Nov 9, 2023
1 parent bb3ca60 commit 058896f
Show file tree
Hide file tree
Showing 34 changed files with 66 additions and 66 deletions.
4 changes: 2 additions & 2 deletions examples/Mentor/10.2.setEventCB.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
from pivy.gui.soqt import *

# PySide module has to be imported as last one if used in the same namespace
from PySide2.QtCore import *
from PySide2.QtGui import *
from pivy.qt.QtCore import *
from pivy.qt.QtGui import *

# Timer sensor
# Rotate 90 degrees every second, update 30 times a second
Expand Down
8 changes: 4 additions & 4 deletions examples/QtDesigner/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import sys
from pivy.gui.soqt import SoQt
from PySide2.QtGui import QApplication
from PySide2.QtCore import QObject
from PySide2.QtCore import SIGNAL
from PySide2.QtCore import SLOT
from pivy.qt.QtGui import QApplication
from pivy.qt.QtCore import QObject
from pivy.qt.QtCore import SIGNAL
from pivy.qt.QtCore import SLOT
from mainwindow import MainWindow

if __name__ == "__main__":
Expand Down
10 changes: 5 additions & 5 deletions examples/QtDesigner/python/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from pivy.coin import *
from pivy.gui.soqt import SoQtExaminerViewer
from ui_test import Ui_MainWindow
from PySide2.QtGui import QWidget
from PySide2.QtGui import QMainWindow
from PySide2.QtGui import QButtonGroup
from PySide2.QtCore import QObject
from PySide2.QtCore import SIGNAL
from pivy.qt.QtGui import QWidget
from pivy.qt.QtGui import QMainWindow
from pivy.qt.QtGui import QButtonGroup
from pivy.qt.QtCore import QObject
from pivy.qt.QtCore import SIGNAL

class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent = None):
Expand Down
2 changes: 1 addition & 1 deletion examples/QtDesigner/python/ui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui
from pivy.qt import QtCore, QtGui

class Ui_MainWindow(object):
def setupUi(self, MainWindow):
Expand Down
4 changes: 2 additions & 2 deletions examples/Quarter/mdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import os
import sys

from PySide2 import QtCore, QtGui
from PySide2.QtGui import QMainWindow, QWorkspace, QAction, QFileDialog, QApplication
from pivy.qt import QtCore, QtGui
from pivy.qt.QtGui import QMainWindow, QWorkspace, QAction, QFileDialog, QApplication

from pivy.coin import SoInput, SoDB
from pivy.quarter import QuarterWidget
Expand Down
2 changes: 1 addition & 1 deletion examples/Quarter/minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import sys

from PySide2.QtWidgets import QApplication
from pivy.qt.QtWidgets import QApplication

from pivy.coin import SoSeparator
from pivy.coin import SoBaseColor
Expand Down
6 changes: 3 additions & 3 deletions examples/examiner_embed4.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from pivy.gui.soqt import *

try:
from PySide2.QtWidgets import *
from pivy.qt.QtWidgets import *
except ImportError:
from PySide2.QtGui import *
from PySide2.QtCore import *
from pivy.qt.QtGui import *
from pivy.qt.QtCore import *

class EmbeddedWindow(QMainWindow):
def __init__(self, *args):
Expand Down
2 changes: 1 addition & 1 deletion examples/soqt/renderAreaCallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from pivy import coin
from pivy.gui import soqt
from PySide2.QtCore import QEvent
from pivy.qt.QtCore import QEvent


def foo(a, event):
Expand Down
2 changes: 1 addition & 1 deletion examples/utils/GlClipPlane.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from PySide2 import QtGui, QtWidgets
from pivy.qt import QtGui, QtWidgets
from pivy import quarter, coin
from OpenGL.GL import *

Expand Down
4 changes: 2 additions & 2 deletions examples/utils/event_callback.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from PySide2.QtGui import QColor
from PySide2.QtWidgets import QApplication
from pivy.qt.QtGui import QColor
from pivy.qt.QtWidgets import QApplication
from pivy import quarter, coin


Expand Down
4 changes: 2 additions & 2 deletions examples/utils/interaction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from PySide2.QtWidgets import QApplication
from PySide2.QtGui import QColor
from pivy.qt.QtWidgets import QApplication
from pivy.qt.QtGui import QColor
from pivy import quarter, coin, graphics, utils

class ConnectionMarker(graphics.Marker):
Expand Down
2 changes: 1 addition & 1 deletion pivy/graphics/viewer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
from pivy import quarter, coin
from PySide2 import QtGui, QtCore
from pivy.qt import QtGui, QtCore
import tempfile

class Viewer(quarter.QuarterWidget):
Expand Down
6 changes: 3 additions & 3 deletions pivy/gui/qt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from pivy.qt.QtCore import *
from pivy.qt.QtGui import *
from pivy.qt.QtWidgets import *
4 changes: 0 additions & 4 deletions pivy/qt.py

This file was deleted.

4 changes: 2 additions & 2 deletions pivy/qt/QtCore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from PySide2.QtCore import *
from PySide6.QtCore import *
except ImportError:
from PySide6.QtCore import *
from PySide2.QtCore import *
4 changes: 2 additions & 2 deletions pivy/qt/QtGui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from PySide2.QtGui import *
from PySide6.QtGui import *
except ImportError:
from PySide6.QtGui import *
from PySide2.QtGui import *
4 changes: 2 additions & 2 deletions pivy/qt/QtOpenGL/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from PySide2.QtOpenGL import *
from PySide6.QtOpenGL import *
except ImportError:
from PySide6.QtOpenGL import *
from PySide2.QtOpenGL import *
4 changes: 2 additions & 2 deletions pivy/qt/QtWidgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from PySide2.QtWidgets import *
from PySide6.QtWidgets import *
except ImportError:
from PySide6.QtWidgets import *
from PySide2.QtWidgets import *
4 changes: 4 additions & 0 deletions pivy/qt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
try:
import PySide6
except ImportError:
import PySide2
8 changes: 4 additions & 4 deletions pivy/quarter/ContextMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2 import QtCore
from PySide2.QtCore import QObject
from PySide2.QtGui import QMouseEvent
from PySide2.QtWidgets import QMenu, QActionGroup, QAction
from pivy.qt import QtCore
from pivy.qt.QtCore import QObject
from pivy.qt.QtGui import QMouseEvent
from pivy.qt.QtWidgets import QMenu, QActionGroup, QAction

from pivy import coin
from pivy.coin import SoEventManager, SoScXMLStateMachine, SoRenderManager, SoGLRenderAction
Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/ImageReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2.QtGui import QImage
from pivy.qt.QtGui import QImage
from pivy.coin import SbImage


Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/QuarterWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
\subpage examiner
"""

from PySide2 import QtCore, QtGui, QtOpenGL
from pivy.qt import QtCore, QtGui, QtOpenGL

from pivy import coin

Expand Down
8 changes: 4 additions & 4 deletions pivy/quarter/SensorManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2.QtCore import QTimer
from PySide2.QtCore import QObject
from PySide2.QtCore import QThread
from PySide2.QtCore import SIGNAL
from pivy.qt.QtCore import QTimer
from pivy.qt.QtCore import QObject
from pivy.qt.QtCore import QThread
from pivy.qt.QtCore import SIGNAL

from pivy.coin import SoDB
from pivy.coin import SbTime
Expand Down
8 changes: 4 additions & 4 deletions pivy/quarter/SignalThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2.QtCore import QThread
from PySide2.QtCore import QWaitCondition
from PySide2.QtCore import QMutex
from PySide2.QtCore import SIGNAL
from pivy.qt.QtCore import QThread
from pivy.qt.QtCore import QWaitCondition
from pivy.qt.QtCore import QMutex
from pivy.qt.QtCore import SIGNAL


class SignalThread(QThread):
Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/devices/DeviceHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2 import QtCore
from pivy.qt import QtCore

from pivy import coin

Expand Down
4 changes: 2 additions & 2 deletions pivy/quarter/devices/DeviceManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"""
from __future__ import print_function

from PySide2.QtCore import QEvent
from PySide2.QtGui import QMouseEvent
from pivy.qt.QtCore import QEvent
from pivy.qt.QtGui import QMouseEvent
from pivy.coin import SoLocation2Event
from pivy.coin import SbVec2s

Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/devices/KeyboardHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2 import QtCore
from pivy.qt import QtCore

from pivy import coin

Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/devices/MouseHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

from PySide2 import QtCore, QtGui
from pivy.qt import QtCore, QtGui

from pivy import coin

Expand Down
2 changes: 1 addition & 1 deletion pivy/quarter/eventhandlers/DragDropHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
DeviceManager by default.
"""

from PySide2 import QtCore
from pivy.qt import QtCore
from pivy import coin
from .EventHandler import EventHandler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
QT_PLUGIN_PATH environment variable.
"""

from PySide2 import QtGui, QtCore, QtDesigner
from pivy.qt import QtGui, QtCore, QtDesigner
from pivy import coin, quarter

class PyQuarterWidgetPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin):
Expand Down
4 changes: 2 additions & 2 deletions pivy/sogui.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ def __hash__(self):
# if no GUI has been specified try using Quarter
if not gui:
try:
__import__('PySide2')
__import__('pivy.qt')
quarter = __import__('pivy.quarter').quarter
gui = 'Quarter'

import pivy
from PySide2 import QtGui, QtCore, QtWidgets
from pivy.qt import QtGui, QtCore, QtWidgets

class SoGui(object):
@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion pivy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def add_marker_from_svg(file_path, marker_name, pixel_x=10, pixel_y=None,
"""adds a new marker bitmap from a vector graphic (svg)"""

# get an icon from the svg rendered with the given pixel
from PySide2 import QtCore, QtGui
from pivy.qt import QtCore, QtGui
pixel_y = pixel_y or pixel_x
icon = QtGui.QIcon(file_path)
icon = QtGui.QBitmap(icon.pixmap(pixel_x, pixel_y))
Expand Down
2 changes: 1 addition & 1 deletion tests/pyside_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
import unittest
from PySide2 import QtCore
from pivy.qt import QtCore
import shiboken2 as wrapper


Expand Down
2 changes: 1 addition & 1 deletion tests/visual_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from PySide2 import QtWidgets
from pivy.qt import QtWidgets
from pivy import coin, quarter


Expand Down

0 comments on commit 058896f

Please sign in to comment.