'''
Created on Apr 18, 2014

@author: mandy
'''

from PyQt4.QtGui import QDockWidget, QWidget, QStandardItemModel, QStandardItem, QTableView, \
                        QHeaderView, QHBoxLayout, QTableWidget, QPushButton
from PyQt4.QtCore import Qt, QString, QRect
from Ui_RoleHierViewWindow import Ui_RoleHierViewWindow

class RoleHierViewDockWidget(QDockWidget):
    def __init__(self, parent = None):
        QDockWidget.__init__(self, '', parent)
        self.parent = parent
        self.setFeatures(QDockWidget.NoDockWidgetFeatures)
        self.setAllowedAreas(Qt.RightDockWidgetArea)
        self.setMinimumWidth(350)
        
    def resizeEvent(self, event):
        self.parent.resizeViews()

class RoleHierViewWindow(QWidget):
    def __init__(self, scene, parent = None):
        QWidget.__init__(self, parent)
        self.scene = scene
        self.ui = Ui_RoleHierViewWindow()
        self.ui.setupUi(self, scene)
        self.setLayout(self.ui.hbox)
        
    def resizeEvent(self, event):
        for item in self.ui.roleUserLists:
            item.changeSize()
