from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import uic
import os
from sys import argv

UiSousMenu, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), 'ui/sousMenu.ui'))

class SousMenu(QDialog, UiSousMenu):
    """affiche une fenetre pourvue d'onglets horizontaux""" 
    def __init__(self, parent=None):
        """Construction de la fenetre"""
        super(SousMenu, self).__init__(parent)
        self.setupUi(self)
        self.connect(self.listeMenus, SIGNAL("cellClicked(int,int)"), self.menuChange, Qt.UniqueConnection)
        self.listeMenus.setCurrentCell(0,0)
        self.menus.setCurrentIndex(0)
        
    def menuChange(self, ligne, col):
        """le menu a ete change dans la QTableWidget"""
        self.menus.setCurrentIndex(ligne)




if __name__ == "__main__":
   app = QApplication(argv)
   #settrace(trace_calls)
   sm = SousMenu()
   sm.show()
   r = app.exec_()
   exit(r)      
