# Path: argos/qt/bindings.py
# API_PYSIDE2 = 'pyside2'
# API_PYQT5 = 'pyqt5'
# ALL_API = [API_PYQT5, API_PYSIDE2]
# QT_API_NAME = os.environ.get('QT_API')
#     QT_API_NAME = None
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
# 
# Path: argos/qt/togglecolumn.py
# class ToggleColumnTreeView(QtWidgets.QTreeView, ToggleColumnMixIn):
#     """ A QTreeView where right clicking on the header allows the user to show/hide columns
#     """
#     def horizontalHeader(self):
#         """ Returns the horizontal header (of type QHeaderView).
# 
#             Override this if the horizontalHeader() function does not exist.
#         """
#         return self.header()
# 
# Path: argos/widgets/constants.py
# COLLECTOR_TREE_ICON_SIZE = QtCore.QSize(20, 20)
# 
# Path: argos/utils/cls.py
# def check_class(obj, target_class, allow_none = False):
#     """ Checks that the  obj is a (sub)type of target_class.
#         Raises a TypeError if this is not the case.
# 
#         :param obj: object whos type is to be checked
#         :type obj: any type
#         :param target_class: target type/class
#         :type target_class: any class or type
#         :param allow_none: if true obj may be None
#         :type allow_none: boolean
#     """
#     if not isinstance(obj, target_class):
#         if not (allow_none and obj is None):
#             raise TypeError("obj must be a of type {}, got: {}"
#                             .format(target_class, type(obj)))


import logging
import numpy as np
from argos.qt import Qt, QtCore, QtGui, QtWidgets, QtSlot
from argos.qt.togglecolumn import ToggleColumnTreeView
from argos.widgets.constants import COLLECTOR_TREE_ICON_SIZE
from argos.utils.cls import check_class
                  .expandedTo(QtWidgets.QApplication.globalStrut()))
        self._cachedSizeHint = result

        # Use the height ancestor's sizeHint
        result.setHeight(orgSizeHint.height())

        return result


class SpinSlider(QtWidgets.QWidget):
    """ A SpinBox and Slider widgets next to each other.

        The layout will be created. It can be accessed as self.layout
    """
    #sigValueChanged = QtSignal(int)

    def __init__(self,
                 spinBox,
                 slider = None,
                 layoutSpacing = None,
                 layoutContentsMargins = (0, 0, 0, 0),
                 parent=None):
        """ Constructor.

            The settings (min, max, enabled, etc) from the SpinBox will be used for the slider
            as well. That is, the spin box is the master.
        """
        super(SpinSlider, self).__init__(parent=parent)

        check_class(spinBox, QtWidgets.QSpinBox, allow_none=True)

# Path: argos/qt/bindings.py
# API_PYSIDE2 = 'pyside2'
# API_PYQT5 = 'pyqt5'
# ALL_API = [API_PYQT5, API_PYSIDE2]
# QT_API_NAME = os.environ.get('QT_API')
#     QT_API_NAME = None
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
#         QT_API_NAME = API_PYQT5
#         QT_API_NAME = API_PYSIDE2
# 
# Path: argos/qt/togglecolumn.py
# class ToggleColumnTreeView(QtWidgets.QTreeView, ToggleColumnMixIn):
#     """ A QTreeView where right clicking on the header allows the user to show/hide columns
#     """
#     def horizontalHeader(self):
#         """ Returns the horizontal header (of type QHeaderView).
# 
#             Override this if the horizontalHeader() function does not exist.
#         """
#         return self.header()
# 
# Path: argos/widgets/constants.py
# COLLECTOR_TREE_ICON_SIZE = QtCore.QSize(20, 20)
# 
# Path: argos/utils/cls.py
# def check_class(obj, target_class, allow_none = False):
#     """ Checks that the  obj is a (sub)type of target_class.
#         Raises a TypeError if this is not the case.
# 
#         :param obj: object whos type is to be checked
#         :type obj: any type
#         :param target_class: target type/class
#         :type target_class: any class or type
#         :param allow_none: if true obj may be None
#         :type allow_none: boolean
#     """
#     if not isinstance(obj, target_class):
#         if not (allow_none and obj is None):
#             raise TypeError("obj must be a of type {}, got: {}"
#                             .format(target_class, type(obj)))


# Path: argos/collect/collectortree.py
import logging
import numpy as np
from argos.qt import Qt, QtCore, QtGui, QtWidgets, QtSlot
from argos.qt.togglecolumn import ToggleColumnTreeView
from argos.widgets.constants import COLLECTOR_TREE_ICON_SIZE
from argos.utils.cls import check_class

                  .expandedTo(QtWidgets.QApplication.globalStrut()))
        self._cachedSizeHint = result

        # Use the height ancestor's sizeHint
        result.setHeight(orgSizeHint.height())

        return result


class SpinSlider(QtWidgets.QWidget):
    """ A SpinBox and Slider widgets next to each other.

        The layout will be created. It can be accessed as self.layout
    """
    #sigValueChanged = QtSignal(int)

    def __init__(self,
                 spinBox,
                 slider = None,
                 layoutSpacing = None,
                 layoutContentsMargins = (0, 0, 0, 0),
                 parent=None):
        """ Constructor.

            The settings (min, max, enabled, etc) from the SpinBox will be used for the slider
            as well. That is, the spin box is the master.
        """
        super(SpinSlider, self).__init__(parent=parent)

        check_class(spinBox, QtWidgets.QSpinBox, allow_none=True)

        check_class(slider, QtWidgets.QSlider, allow_none=True)