Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additionally support Qt5 #359

Merged
merged 15 commits into from Apr 27, 2016

many more imports

  • Loading branch information...
dirk-thomas committed Apr 19, 2016
commit c7cfadb3b7820209cc11844cf13bfbc02856ff14
@@ -37,7 +37,7 @@


from python_qt_binding.QtCore import Qt, QTimer, qWarning, Signal
from python_qt_binding.QtGui import QGraphicsScene, QMessageBox
from python_qt_binding.QtWidgets import QGraphicsScene, QMessageBox

import bag_helper

@@ -38,7 +38,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt, qWarning, Signal
from python_qt_binding.QtGui import QFileDialog, QGraphicsView, QIcon, QWidget
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QFileDialog, QGraphicsView, QWidget

import rosbag
import bag_helper
@@ -37,7 +37,7 @@
import math

from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QApplication, QAbstractItemView, QSizePolicy, QTreeWidget, QTreeWidgetItem
from python_qt_binding.QtWidgets import QApplication, QAbstractItemView, QSizePolicy, QTreeWidget, QTreeWidgetItem
from .topic_message_view import TopicMessageView


@@ -31,7 +31,8 @@
# POSSIBILITY OF SUCH DAMAGE.
from .message_view import MessageView

from python_qt_binding.QtGui import QAction, QIcon, QToolBar
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QAction, QToolBar


class TopicMessageView(MessageView):
@@ -33,8 +33,8 @@

from python_qt_binding.QtCore import qDebug, QPointF, QRectF, Qt, qWarning, Signal
from python_qt_binding.QtGui import QBrush, QCursor, QColor, QFont, \
QFontMetrics, QGraphicsItem, QPen, \
QPolygonF
QFontMetrics, QPen, QPolygonF
from python_qt_binding.QtWidgets import QGraphicsItem
import rospy

import bisect
@@ -30,7 +30,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding.QtGui import QVBoxLayout, QMenu, QWidget, QDockWidget
from python_qt_binding.QtWidgets import QVBoxLayout, QMenu, QWidget, QDockWidget

class TopicPopupWidget(QWidget):
def __init__(self, popup_name, timeline, viewer_type, topic):
@@ -33,7 +33,7 @@
import rosgraph

from python_qt_binding.QtCore import Qt, Signal
from python_qt_binding.QtGui import QWidget, QHBoxLayout, QVBoxLayout, QCheckBox, QScrollArea, QPushButton
from python_qt_binding.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QCheckBox, QScrollArea, QPushButton

class TopicSelection(QWidget):

@@ -41,7 +41,8 @@
from rqt_bag import TopicMessageView
import image_helper

from python_qt_binding.QtGui import QGraphicsScene, QGraphicsView, QPixmap
from python_qt_binding.QtGui import QPixmap
from python_qt_binding.QtWidgets import QGraphicsScene, QGraphicsView


class ImageView(TopicMessageView):
@@ -71,7 +71,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt, qWarning, Signal
from python_qt_binding.QtGui import QWidget, QPushButton, QTreeWidget, QTreeWidgetItem, QSizePolicy, QDoubleValidator, QIcon
from python_qt_binding.QtGui import QDoubleValidator, QIcon
from python_qt_binding.QtWidgets import QWidget, QPushButton, QTreeWidget, QTreeWidgetItem, QSizePolicy

from rqt_plot.data_plot import DataPlot

@@ -33,7 +33,7 @@
import os

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QDialog
from python_qt_binding.QtWidgets import QDialog

from rqt_logger_level.logger_level_widget import LoggerLevelWidget
from rqt_logger_level.logger_level_service_caller import LoggerLevelServiceCaller
@@ -33,7 +33,8 @@
import os

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QApplication, QCursor, QFileDialog, QHeaderView,QIcon, QMenu, QMessageBox, QTableView, QWidget
from python_qt_binding.QtGui import QCursor, QIcon
from python_qt_binding.QtWidgets import QApplication, QFileDialog, QHeaderView, QMenu, QMessageBox, QTableView, QWidget
from python_qt_binding.QtCore import QRegExp, Qt, qWarning

import time
@@ -35,7 +35,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QPalette, QWidget
from python_qt_binding.QtGui import QPalette
from python_qt_binding.QtWidgets import QWidget

from rqt_py_common.ini_helper import pack, unpack

@@ -34,7 +34,8 @@
import rospkg

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QIcon, QWidget
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QWidget


class FilterWrapperWidget(QWidget):
@@ -35,7 +35,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QPalette, QWidget
from python_qt_binding.QtGui import QPalette
from python_qt_binding.QtWidgets import QWidget

from rqt_py_common.ini_helper import pack, unpack

@@ -34,7 +34,7 @@
import rospkg

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtWidgets import QWidget


class TextFilterWidget(QWidget):
@@ -36,7 +36,7 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import QDateTime
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtWidgets import QWidget


class TimeFilterWidget(QWidget):
@@ -31,7 +31,11 @@
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding.QtCore import Qt, qWarning
from python_qt_binding.QtGui import QBrush, QColor, QSortFilterProxyModel
try:
from python_qt_binding.QtCore import QSortFilterProxyModel # Qt 5
except ImportError:
from python_qt_binding.QtGui import QSortFilterProxyModel # Qt 4
from python_qt_binding.QtGui import QBrush, QColor

from .filters.filter_collection import FilterCollection
from .message import Message
@@ -38,7 +38,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import QFile, QIODevice, Qt, Signal, Slot, QAbstractListModel
from python_qt_binding.QtGui import QFileDialog, QGraphicsScene, QIcon, QImage, QPainter, QWidget, QCompleter
from python_qt_binding.QtGui import QIcon, QImage, QPainter
from python_qt_binding.QtWidgets import QFileDialog, QGraphicsScene, QWidget, QCompleter
from python_qt_binding.QtSvg import QSvgGenerator

import rosservice
@@ -31,7 +31,8 @@
from __future__ import division

from python_qt_binding.QtCore import QPointF, QRectF, Qt
from python_qt_binding.QtGui import QGraphicsView, QTransform
from python_qt_binding.QtGui import QTransform
from python_qt_binding.QtWidgets import QGraphicsView


class InteractiveGraphicsView(QGraphicsView):
@@ -34,7 +34,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import QAbstractListModel, QFile, QIODevice, Qt, Signal
from python_qt_binding.QtGui import QCompleter, QFileDialog, QGraphicsScene, QIcon, QImage, QPainter, QWidget
from python_qt_binding.QtGui import QIcon, QImage, QPainter
from python_qt_binding.QtWidgets import QCompleter, QFileDialog, QGraphicsScene, QWidget
from python_qt_binding.QtSvg import QSvgGenerator

import rosgraph.impl.graph
@@ -37,8 +37,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import QModelIndex, Signal
from python_qt_binding.QtGui import QDialog, QStandardItem, \
QStandardItemModel
from python_qt_binding.QtGui import QStandardItem, QStandardItemModel
from python_qt_binding.QtWidgets import QDialog
from rosgraph import rosenv
import roslaunch
from roslaunch.core import RLException
@@ -33,7 +33,7 @@
# Author: Isaac Saito

from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QStyledItemDelegate
from python_qt_binding.QtWidgets import QStyledItemDelegate
import rospkg

from rqt_launch.node_widget import NodeWidget
@@ -35,7 +35,8 @@
import os

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QIcon, QLineEdit, QWidget
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QLineEdit, QWidget
import rospy

from rqt_launch.name_surrogate import NamesSurrogate
@@ -1,6 +1,6 @@
#! /usr/bin/env python

from python_qt_binding.QtGui import QLabel, QStyle
from python_qt_binding.QtWidgets import QLabel, QStyle
import rospy


@@ -35,7 +35,7 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import qWarning
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtWidgets import QWidget


class LoggerLevelWidget(QWidget):
@@ -42,18 +42,21 @@

try:
from pyqtgraph_data_plot import PyQtGraphDataPlot
except ImportError:
except ImportError as e:
PyQtGraphDataPlot = None
print(e)

try:
from mat_data_plot import MatDataPlot
except ImportError:
except ImportError as e:
MatDataPlot = None
print(e)

try:
from qwt_data_plot import QwtDataPlot
except ImportError:
except ImportError as e:
QwtDataPlot = None
print(e)

# separate class for DataPlot exceptions, just so that users can differentiate
# errors from the DataPlot widget from exceptions generated by the underlying
@@ -43,7 +43,8 @@ def parse_version(s):
raise ImportError('A PySide version newer than 1.1.0 is required.')

from python_qt_binding.QtCore import Slot, Qt, qWarning, Signal
from python_qt_binding.QtGui import QWidget, QVBoxLayout, QSizePolicy, QColor
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtWidgets import QWidget, QVBoxLayout, QSizePolicy

import operator
import matplotlib
@@ -31,7 +31,8 @@
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding.QtCore import Slot, Qt, qWarning, Signal
from python_qt_binding.QtGui import QColor, QVBoxLayout, QWidget
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtWidgets import QVBoxLayout, QWidget

from pyqtgraph import PlotWidget, mkPen, mkBrush
import numpy
@@ -35,7 +35,7 @@
import math
import sys

from python_qt_binding.QtCore import QEvent, QSize, QPointF, Qt, SIGNAL, Signal, Slot, qWarning
from python_qt_binding.QtCore import QEvent, QSize, QPointF, Qt, Signal, Slot, qWarning
from python_qt_binding.QtGui import QColor, QPen, QBrush, QVector2D
import Qwt

@@ -112,7 +112,8 @@ def eventFilter(self, _, event):
return False

def log(self, level, message):
self.emit(SIGNAL('logMessage'), level, message)
# self.emit(SIGNAL('logMessage'), level, message)
pass

def resizeEvent(self, event):
Qwt.QwtPlot.resizeEvent(self, event)
@@ -33,7 +33,7 @@
# Author: Isaac Saito

from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QWidgetItem
from python_qt_binding.QtWidgets import QWidgetItem
import roslib
import rospy

@@ -37,7 +37,7 @@
import os

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtWidgets import QWidget
import rospkg
import rospy

@@ -30,7 +30,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from python_qt_binding.QtGui import QVBoxLayout, QWidget
from python_qt_binding.QtWidgets import QVBoxLayout, QWidget
from qt_gui.plugin import Plugin
from qt_gui_py_common.simple_settings_dialog import SimpleSettingsDialog
from py_console_widget import PyConsoleWidget
@@ -34,7 +34,7 @@
import rospkg

from python_qt_binding import loadUi
from python_qt_binding.QtGui import QWidget
from python_qt_binding.QtWidgets import QWidget
import py_console_text_edit


@@ -35,7 +35,10 @@
from __future__ import division

from python_qt_binding.QtCore import Qt, Signal
from python_qt_binding.QtGui import QSortFilterProxyModel
try:
from python_qt_binding.QtCore import QSortFilterProxyModel # Qt 5
except ImportError:
from python_qt_binding.QtGui import QSortFilterProxyModel # Qt 4
import rospy

from rqt_reconfigure.treenode_qstditem import TreenodeQstdItem
@@ -41,8 +41,11 @@
import dynamic_reconfigure as dyn_reconf
from python_qt_binding import loadUi
from python_qt_binding.QtCore import Qt, Signal
from python_qt_binding.QtGui import (QHeaderView, QItemSelectionModel,
QWidget)
try:
from python_qt_binding.QtCore import QItemSelectionModel # Qt 5
except ImportError:
from python_qt_binding.QtGui import QItemSelectionModel # Qt 4
from python_qt_binding.QtWidgets import QHeaderView, QWidget
import rospy
from rospy.exceptions import ROSException
import rosservice
@@ -113,8 +116,10 @@ def __init__(self, parent, rospack, signal_msg=None):
# This 1 line is needed to enable horizontal scrollbar. This setting
# isn't available in .ui file.
# Ref. http://stackoverflow.com/a/6648906/577001
self._node_selector_view.header().setResizeMode(
0, QHeaderView.ResizeToContents)
try:
self._node_selector_view.header().setSectionResizeMode(0, QHeaderView.ResizeToContents) # Qt5
except AttributeError:
self._node_selector_view.header().setResizeMode(0, QHeaderView.ResizeToContents) # Qt4

# Setting slot for when user clicks on QTreeView.
self.selectionModel = self._node_selector_view.selectionModel()
@@ -37,8 +37,8 @@

from python_qt_binding import loadUi
from python_qt_binding.QtCore import Signal
from python_qt_binding.QtGui import (QDoubleValidator, QIntValidator, QLabel,
QMenu, QWidget)
from python_qt_binding.QtGui import QDoubleValidator, QIntValidator
from python_qt_binding.QtWidgets import QLabel, QMenu, QWidget
from decimal import Decimal
import rospkg
import rospy
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.