| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import QModelIndex, QTimer | |||
| #from PyQt5.QtGui import QPalette | |||
| #from PyQt5.QtWidgets import QApplication, QFileSystemModel, QMainWindow | |||
| #except: | |||
| from PyQt4.QtCore import qCritical, QModelIndex, QTimer | |||
| from PyQt4.QtGui import QApplication, QFileSystemModel, QMainWindow, QPalette | |||
| @@ -2,31 +2,21 @@ | |||
| # -*- coding: utf-8 -*- | |||
| # PatchBay Canvas engine using QGraphicsView/Scene | |||
| # Copyright (C) 2010-2012 Filipe Coelho <falktx@falktx.com> | |||
| # Copyright (C) 2010-2013 Filipe Coelho <falktx@falktx.com> | |||
| # | |||
| # This program is free software; you can redistribute it and/or modify | |||
| # it under the terms of the GNU General Public License as published by | |||
| # the Free Software Foundation; either version 2 of the License, or | |||
| # any later version. | |||
| # This program is free software; you can redistribute it and/or | |||
| # modify it under the terms of the GNU General Public License as | |||
| # published by the Free Software Foundation; either version 2 of | |||
| # the License, or any later version. | |||
| # | |||
| # This program is distributed in the hope that it will be useful, | |||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| # GNU General Public License for more details. | |||
| # | |||
| # For a full copy of the GNU General Public License see the GPL.txt file | |||
| # For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import pyqtSignal, pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject | |||
| #from PyQt5.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer | |||
| #from PyQt5.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath | |||
| #from PyQt5.QtGui import QCursor, QFont, QFontMetrics | |||
| #from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer | |||
| #from PyQt5.QtWidgets import QGraphicsScene, QGraphicsItem, QGraphicsLineItem, QGraphicsPathItem | |||
| #from PyQt5.QtWidgets import QGraphicsColorizeEffect, QGraphicsDropShadowEffect | |||
| #from PyQt5.QtWidgets import QInputDialog, QLineEdit, QMenu | |||
| #except: | |||
| from PyQt4.QtCore import pyqtSignal, pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject | |||
| from PyQt4.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer | |||
| from PyQt4.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath | |||
| @@ -4,25 +4,21 @@ | |||
| # PatchBay Canvas Themes | |||
| # Copyright (C) 2010-2012 Filipe Coelho <falktx@falktx.com> | |||
| # | |||
| # This program is free software; you can redistribute it and/or modify | |||
| # it under the terms of the GNU General Public License as published by | |||
| # the Free Software Foundation; either version 2 of the License, or | |||
| # any later version. | |||
| # This program is free software; you can redistribute it and/or | |||
| # modify it under the terms of the GNU General Public License as | |||
| # published by the Free Software Foundation; either version 2 of | |||
| # the License, or any later version. | |||
| # | |||
| # This program is distributed in the hope that it will be useful, | |||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| # GNU General Public License for more details. | |||
| # | |||
| # For a full copy of the GNU General Public License see the GPL.txt file | |||
| # For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import Qt | |||
| #from PyQt5.QtGui import QColor, QFont, QPen, QPixmap | |||
| #except: | |||
| from PyQt4.QtCore import Qt | |||
| from PyQt4.QtGui import QColor, QFont, QPen, QPixmap | |||
| @@ -14,18 +14,12 @@ | |||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| # GNU General Public License for more details. | |||
| # | |||
| # For a full copy of the GNU General Public License see the GPL.txt file | |||
| # For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| # TODO - SIGNAL, SLOT | |||
| #try: | |||
| #from PyQt5.QtCore import Qt, QRectF, QTimer | |||
| #from PyQt5.QtGui import QBrush, QColor, QCursor, QPainter, QPen | |||
| #from PyQt5.QtWidgets import QFrame | |||
| #except: | |||
| from PyQt4.QtCore import Qt, QRectF, QTimer | |||
| from PyQt4.QtCore import pyqtSignal, Qt, QRectF, QTimer | |||
| from PyQt4.QtGui import QBrush, QColor, QCursor, QFrame, QPainter, QPen | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| @@ -40,6 +34,8 @@ iHeight = 3 | |||
| # Widget Class | |||
| class CanvasPreviewFrame(QFrame): | |||
| miniCanvasMoved = pyqtSignal(float, float) | |||
| def __init__(self, parent): | |||
| QFrame.__init__(self, parent) | |||
| @@ -53,6 +49,7 @@ class CanvasPreviewFrame(QFrame): | |||
| self.fScale = 1.0 | |||
| self.fScene = None | |||
| self.fRealParent = None | |||
| self.fFakeWidth = 0.0 | |||
| self.fFakeHeight = 0.0 | |||
| @@ -68,8 +65,8 @@ class CanvasPreviewFrame(QFrame): | |||
| padding = 6 | |||
| self.fScene = scene | |||
| self.fFakeWidth = float(realWidth) / 15 | |||
| self.fFakeHeight = float(realHeight) / 15 | |||
| self.fFakeWidth = float(realWidth) / 15.0 | |||
| self.fFakeHeight = float(realHeight) / 15.0 | |||
| self.setMinimumSize(self.fFakeWidth+padding, self.fFakeHeight+padding) | |||
| self.setMaximumSize(self.fFakeWidth*4+padding, self.fFakeHeight+padding) | |||
| @@ -103,7 +100,9 @@ class CanvasPreviewFrame(QFrame): | |||
| def setViewScale(self, scale): | |||
| self.fScale = scale | |||
| #QTimer.singleShot(0, self.fRealParent, SLOT("slot_miniCanvasCheckAll()")) | |||
| if self.fRealParent is not None: | |||
| QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll) | |||
| def setViewSize(self, width, height): | |||
| self.fViewRect[iWidth] = width * self.fFakeWidth | |||
| @@ -143,7 +142,7 @@ class CanvasPreviewFrame(QFrame): | |||
| self.fViewRect[iY] = y + self.fRenderSource.y() | |||
| self.update() | |||
| #self.emit(SIGNAL("miniCanvasMoved(double, double)"), x * self.fScale / self.fFakeWidth, y * self.fScale / self.fFakeHeight) | |||
| self.miniCanvasMoved.emit(x * self.fScale / self.fFakeWidth, y * self.fScale / self.fFakeHeight) | |||
| def mousePressEvent(self, event): | |||
| if event.button() == Qt.LeftButton: | |||
| @@ -205,6 +204,8 @@ class CanvasPreviewFrame(QFrame): | |||
| def resizeEvent(self, event): | |||
| self.fRenderSource = self.getRenderSource() | |||
| #if self.fRealParent: | |||
| #QTimer.singleShot(0, self.fRealParent, SLOT("slot_miniCanvasCheckAll()")) | |||
| #QFrame.resizeEvent(self, event) | |||
| if self.fRealParent is not None: | |||
| QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll) | |||
| QFrame.resizeEvent(self, event) | |||
| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import qCritical, Qt, QTimer, QSize | |||
| #from PyQt5.QtGui import QColor, QLinearGradient, QPainter | |||
| #from PyQt5.QtWidgets import QWidget | |||
| #except: | |||
| from PyQt4.QtCore import qCritical, Qt, QTimer, QSize | |||
| from PyQt4.QtGui import QColor, QLinearGradient, QPainter, QWidget | |||
| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import qCritical, QRectF | |||
| #from PyQt5.QtGui import QPainter, QPixmap | |||
| #from PyQt5.QtWidgets import QPushButton | |||
| #except: | |||
| from PyQt4.QtCore import qCritical, QRectF | |||
| from PyQt4.QtGui import QPainter, QPixmap, QPushButton | |||
| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer | |||
| #from PyQt5.QtGui import QCursor | |||
| #from PyQt5.QtWidgets import QAbstractSpinBox, QApplication, QComboBox, QDialog, QMenu, QProgressBar | |||
| #except: | |||
| from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer | |||
| from PyQt4.QtGui import QAbstractSpinBox, QApplication, QComboBox, QCursor, QDialog, QMenu, QProgressBar | |||
| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import QRectF | |||
| #from PyQt5.QtGui import QPainter, QPixmap | |||
| #from PyQt5.QtWidgets import QPushButton | |||
| #except: | |||
| from PyQt4.QtCore import QRectF | |||
| from PyQt4.QtGui import QPainter, QPixmap, QPushButton | |||
| @@ -19,18 +19,12 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| from math import floor | |||
| #try: | |||
| #from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, QSize | |||
| #from PyQt5.QtGui import QColor, QConicalGradient, QFont, QFontMetrics | |||
| #from PyQt5.QtGui import QLinearGradient, QPainter, QPainterPath, QPen, QPixmap | |||
| #from PyQt5.QtWidgets import QDial | |||
| #except: | |||
| from PyQt4.QtCore import Qt, QPointF, QRectF, QTimer, QSize | |||
| from PyQt4.QtGui import QColor, QConicalGradient, QFont, QFontMetrics | |||
| from PyQt4.QtGui import QDial, QLinearGradient, QPainter, QPainterPath, QPen, QPixmap | |||
| from math import floor | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Widget Class | |||
| @@ -19,11 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| #try: | |||
| #from PyQt5.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize | |||
| #from PyQt5.QtGui import QFont, QPainter, QPixmap | |||
| #from PyQt5.QtWidgets import QWidget | |||
| #except: | |||
| from PyQt4.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize | |||
| from PyQt4.QtGui import QFont, QPainter, QPixmap, QWidget | |||