# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/qtpy/QtWidgets.py

# 
# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/app.py
# def get_qsettings():
#     """ Creates a QSettings object for this application.    
#         We do not set the application and organization in the QApplication object to 
#         prevent side-effects.
#     """
#     return QtCore.QSettings("titusjan.nl", PROGRAM_NAME)


import logging
from objbrowser.qtpy import QtCore, QtWidgets
from objbrowser.qtpy.QtCore import Qt
from objbrowser.app import get_qsettings
            header_data = settings.value(key)
            if header_data:
                header_restored = horizontal_header.restoreState(header_data)
            
            # update actions
            for col, action in enumerate(horizontal_header.actions()):
                is_checked = not horizontal_header.isSectionHidden(col)
                action.setChecked(is_checked)
        
        return header_restored


    def write_view_settings(self, key, settings=None):
        """ Writes the view settings to the persistent store
        """         
        logger.debug("Writing view settings for: {}".format(key))
        
        if settings is None:
            settings = get_qsettings()
        settings.setValue(key, self._horizontal_header().saveState())



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

        
        

# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/qtpy/QtWidgets.py

# 
# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/app.py
# def get_qsettings():
#     """ Creates a QSettings object for this application.    
#         We do not set the application and organization in the QApplication object to 
#         prevent side-effects.
#     """
#     return QtCore.QSettings("titusjan.nl", PROGRAM_NAME)


# Path: objbrowser/toggle_column_mixin.py
import logging
from objbrowser.qtpy import QtCore, QtWidgets
from objbrowser.qtpy.QtCore import Qt
from objbrowser.app import get_qsettings

            header_data = settings.value(key)
            if header_data:
                header_restored = horizontal_header.restoreState(header_data)
            
            # update actions
            for col, action in enumerate(horizontal_header.actions()):
                is_checked = not horizontal_header.isSectionHidden(col)
                action.setChecked(is_checked)
        
        return header_restored


    def write_view_settings(self, key, settings=None):
        """ Writes the view settings to the persistent store
        """         
        logger.debug("Writing view settings for: {}".format(key))
        
        if settings is None:
            settings = get_qsettings()
        settings.setValue(key, self._horizontal_header().saveState())



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

        
        

class ToggleColumnTreeWidget(QtWidgets.QTreeWidget, ToggleColumnMixIn):