Pop up window displaying a dataframe
-
Hi,
I need to display a dataframe using a pop up window. When I click the on specific column value of a QTableWidget, a pop window would appear containing a dataframe. How can I do it in PyQt5? -
@jsulm I tried doing this by using message box. Big Moves is a Qtablewidget here . But the issue is I am unable to pass dataframe in the message box. How can I do that?
self.ui.BigMoves.itemDoubleClicked.connect(self.onClick) def onClick(self): msgbox = QtWidgets.QMessageBox() msgbox.setText('To see details: Click "Show Details"') msgbox.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) msgbox.setDetailedText(Big21) msgbox.exec_()
-
@jsulm I tried doing this by using message box. Big Moves is a Qtablewidget here . But the issue is I am unable to pass dataframe in the message box. How can I do that?
self.ui.BigMoves.itemDoubleClicked.connect(self.onClick) def onClick(self): msgbox = QtWidgets.QMessageBox() msgbox.setText('To see details: Click "Show Details"') msgbox.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) msgbox.setDetailedText(Big21) msgbox.exec_()
@Piyush Well, depending on what data you want to show and how you will need to create your own dialog (subclass QDialog). Then you can pass what ever data you want.
Here is an example: http://doc.qt.io/qt-5/qtwidgets-dialogs-extension-example.html -
@Piyush Well, depending on what data you want to show and how you will need to create your own dialog (subclass QDialog). Then you can pass what ever data you want.
Here is an example: http://doc.qt.io/qt-5/qtwidgets-dialogs-extension-example.html -
@jsulm The dataframe I need to display is a simple table containing a few columns and rows which is stored in Python console. And I need to get the pop up window whenever I double click on the Qtablewidget.