示例#1
0
    def __init__(self, *args):
        #QWidget.__init__(self, *args)
        super(MyWindow, self).__init__(*args)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)

        # create table
        list_data = [1, 2, 3, 4]
        lm = MyListModel(list_data, self)

        # set the model
        self.ui.listView.setModel(lm)
示例#2
0
class MyWindow(QWidget):
    def __init__(self, *args):
        #QWidget.__init__(self, *args)
        super(MyWindow, self).__init__(*args)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)

        # create table
        list_data = [1, 2, 3, 4]
        lm = MyListModel(list_data, self)

        # set the model
        self.ui.listView.setModel(lm)

    def accept(self):
        print self.ui.listView.model().listdata

    def reject(self):
        pass
示例#3
0
class MyWindow(QWidget): 
    def __init__(self, *args): 
        #QWidget.__init__(self, *args) 
        super(MyWindow, self).__init__(*args)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)

        # create table
        list_data = [1,2,3,4]
        lm = MyListModel(list_data, self)
        
        # set the model
        self.ui.listView.setModel(lm)

    def accept(self):
        print self.ui.listView.model().listdata
    
    def reject(self):
        pass
示例#4
0
    def __init__(self, *args): 
        #QWidget.__init__(self, *args) 
        super(MyWindow, self).__init__(*args)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)

        # create table
        list_data = [1,2,3,4]
        lm = MyListModel(list_data, self)
        
        # set the model
        self.ui.listView.setModel(lm)