Delete Objects from Layout

Post here if you need help with creating a Graphical User Interface in Python.

Delete Objects from Layout

Postby machupicchu » Wed Apr 23, 2014 11:17 am

Hi guys,

I would like to delete objects from my layout and I dont know how I should do this.


Code: Select all
     
    list_label = []
    count = len(list_label) -1
   
   
     
    def createNewTextEditApiKey(self):
        if self.lineEdit_combobox_api.currentText() == 'New Data':
            text, _ = QInputDialog.getText(self, 'Input Dialog',
            'Enter data name:')
            self.new_line_label = QLabel(text)
            self.list_label.append(self.new_line_label)
            t = [x for x in self.list_label]
            self.line_edit_layout_datasource.addWidget(x)            <--------------------Adding objects to my layout
        print self.list_label
         
     
    def deleteData(self):
        if self.lineEdit_combobox_api.currentText() == 'Delete Data':
            del self.list_label[self.count]



I can delete my list but I also wanna delete the objects in my layout. Have someone an Idea?

Thanks in advance
machu
Last edited by stranac on Wed Apr 23, 2014 11:34 am, edited 1 time in total.
Reason: First post lock.
machupicchu
 
Posts: 1
Joined: Wed Apr 23, 2014 11:08 am

Return to GUI

Who is online

Users browsing this forum: No registered users and 2 guests

cron