Skip to content

PyQt QStackedWidget which can be set current widget by clicking QListWidget's item.

License

Notifications You must be signed in to change notification settings

yjg30737/pyqt-listwidget-and-stackedwidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyqt-listwidget-and-stackedwidget

PyQt QStackedWidget which can be set current widget by clicking QListWidget's item.

Requirements

PyQt5 >= 5.8

Included pacakges

Setup

pip3 install git+https://github.com/yjg30737/pyqt-listwidget-and-stackedwidget.git --upgrade

Usage

  • addTab(widget: QWidget, text: str) to add item and widget corresponded with item

Example

Code Sample

from PyQt5.QtWidgets import QApplication
from pyqt_listwidget_and_stackedwidget import ListWidgetAndStackedWidget

from pyqt_date_table_widget import DateTableWidget
from pyqt_top_left_right_file_list_widget import TopLeftRightFileListWidget
from pyqt_top_menu_bottom_widget import TopMenuBottomWidget


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    mainWindow = ListWidgetAndStackedWidget()
    mainWindow.addTab(DateTableWidget(), 'DateTableWidget')
    mainWindow.addTab(TopLeftRightFileListWidget(), 'TopLeftRightFileListWidget')
    mainWindow.addTab(TopMenuBottomWidget(), 'TopMenuBottomWidget')
    mainWindow.show()
    app.exec_()

Used packages in the example

Result

example.mp4