# 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/misc.py
# def getWidgetState(qWindow):
#     """ Gets the QWindow or QWidget state as a QByteArray.
# 
#         Since Qt does not provide this directly we hack this by saving it to the QSettings
#         in a temporary location and then reading it from the QSettings.
# 
#         :param widget: A QWidget that has a saveState() methods
#     """
#     settings = QtCore.QSettings()
#     settings.beginGroup('temp_conversion')
#     try:
#         settings.setValue("winState", qWindow.saveState())
#         return bytes(settings.value("winState"))
#     finally:
#         settings.endGroup()


import base64
import logging
from argos.qt import QtCore, QtWidgets, Qt
from argos.qt.misc import getWidgetState
        if dataStr is None:
            logger.debug("Tree headers state empty, so not restored: {}".format(self))
            return

        headerBytes = base64.b64decode(dataStr)
        horizontal_header = self.horizontalHeader()
        header_restored = horizontal_header.restoreState(headerBytes)
        if not header_restored:
            logger.warning("Tree headers state not restored: {}".format(self))

        # update actions so context menus are (un)checked properly
        for col, action in enumerate(horizontal_header.actions()):
            isChecked = not horizontal_header.isSectionHidden(col)
            action.setChecked(isChecked)


class ToggleColumnTableWidget(QtWidgets.QTableWidget, ToggleColumnMixIn):
    """ A QTableWidget where right clicking on the header allows the user to show/hide columns
    """
    pass



class ToggleColumnTableView(QtWidgets.QTableView, ToggleColumnMixIn):
    """ A QTableView where right clicking on the header allows the user to show/hide columns
    """
    pass




# 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/misc.py
# def getWidgetState(qWindow):
#     """ Gets the QWindow or QWidget state as a QByteArray.
# 
#         Since Qt does not provide this directly we hack this by saving it to the QSettings
#         in a temporary location and then reading it from the QSettings.
# 
#         :param widget: A QWidget that has a saveState() methods
#     """
#     settings = QtCore.QSettings()
#     settings.beginGroup('temp_conversion')
#     try:
#         settings.setValue("winState", qWindow.saveState())
#         return bytes(settings.value("winState"))
#     finally:
#         settings.endGroup()


# Path: argos/qt/togglecolumn.py
import base64
import logging
from argos.qt import QtCore, QtWidgets, Qt
from argos.qt.misc import getWidgetState

        if dataStr is None:
            logger.debug("Tree headers state empty, so not restored: {}".format(self))
            return

        headerBytes = base64.b64decode(dataStr)
        horizontal_header = self.horizontalHeader()
        header_restored = horizontal_header.restoreState(headerBytes)
        if not header_restored:
            logger.warning("Tree headers state not restored: {}".format(self))

        # update actions so context menus are (un)checked properly
        for col, action in enumerate(horizontal_header.actions()):
            isChecked = not horizontal_header.isSectionHidden(col)
            action.setChecked(isChecked)


class ToggleColumnTableWidget(QtWidgets.QTableWidget, ToggleColumnMixIn):
    """ A QTableWidget where right clicking on the header allows the user to show/hide columns
    """
    pass



class ToggleColumnTableView(QtWidgets.QTableView, ToggleColumnMixIn):
    """ A QTableView where right clicking on the header allows the user to show/hide columns
    """
    pass




class ToggleColumnTreeWidget(QtWidgets.QTreeWidget, ToggleColumnMixIn):