Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在qgridlayout或类似的小部件中格式化数据?_Python_User Interface_Widget_Pyqt4 - Fatal编程技术网

Python 如何在qgridlayout或类似的小部件中格式化数据?

Python 如何在qgridlayout或类似的小部件中格式化数据?,python,user-interface,widget,pyqt4,Python,User Interface,Widget,Pyqt4,这就是目前表示我的数据的内容,数据被打印到标签(l124)中,并通过一行打印。我希望qgrid将我的数据表示在一个按行和列组织的某种表格中 def view(self): sender=self.sender() self.statusBar().showMessage(sender.text()+' was pressed.') with sqlite3.connect('drycleaning_shop.db') as db: cursor=db.cu

这就是目前表示我的数据的内容,数据被打印到标签(l124)中,并通过一行打印。我希望qgrid将我的数据表示在一个按行和列组织的某种表格中

def view(self):
    sender=self.sender()
    self.statusBar().showMessage(sender.text()+' was pressed.')
    with sqlite3.connect('drycleaning_shop.db') as db:
        cursor=db.cursor()
        cursor.execute('select* from Item Order BY Name ASC')
        product=cursor.fetchall()
        product=str(product)
        print(len(product))
        self.l.setText(str(product))
        self.l124.setText(view2)