Saravanan666/pypi-org huggingface dataset:
Package: pyqt-style-setter
pyqt-style-setterPyQt style setterNoteCurrently the only style you can set is dark-gray(pyqt-dark-gray-theme), light-gray(pyqt-light-gray-theme).RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-style-setterIncluded Packagespyqt-dark-gray-themepyqt-light-gray-themepyqt-svg-button- To exclude svg icon set button, also known asSvgButton. It should use its own style or else svg icon will be disappeared by overwritten style.UsageStyleSetter.setWindowStyle(main_window: QWidget, theme: str = 'dark', exclude_type_lst: list = [])-main_windowis the widget which user want to set the style.exclude_type_lst's items are excluded from applying style. Item type should betype(ex.QAbstractButton). Currently it only works forQAbstractButton.Example※ I use thepyqt-timer's settings dialog as an example.PyQt default themefromPyQt5.QtWidgetsimportQApplicationfrompyqt_timer.settingsDialogimportSettingsDialogif__name__=="__main__":importsysapp=QApplication(sys.argv)window=SettingsDialog()window.show()app.exec_()Dark-gray themefromPyQt5.QtWidgetsimportQApplicationfrompyqt_style_setterimportStyleSetterfrompyqt_timer.settingsDialogimportSettingsDialogif__name__=="__main__":importsysapp=QApplication(sys.argv)window=SettingsDialog()StyleSetter.setWindowStyle(window)# add thiswindow.show()app.exec_()Using this withpyqt-custom-titlebar-setterfromPyQt5.QtWidgetsimportQApplicationfrompyqt_custom_titlebar_setterimportCustomTitlebarSetterfrompyqt_style_setterimportStyleSetterfrompyqt_timer.settingsDialogimportSettingsDialogif__name__=="__main__":importsysapp=QApplication(sys.argv)dialog=SettingsDialog()StyleSetter.setWindowStyle(dialog)titleBarWindow=CustomTitlebarSetter.getCustomTitleBarWindow(dialog,icon_filename='settings.svg')titleBarWindow.show()app.exec_()For those who use macOS
Package: pyqt-svg-button
pyqt-svg-buttonPyQt button which supports svg iconQt'ssetIconof button widget doesn't help that much in terms of setting SVG image as an icon. It's just another good old fashioned pixmap icon.So i overrided the method to set SVG icon with the power of CSS.By the way, parent class of this isQPushButtonandSvgAbstractButton. (Multiple inheritance)(the repo/package name has changed on 2022/05/18 from pyqt-svg-icon-pushbutton)Default background color of this is transparent.If you want to use svg supportingQToolButtoninstead ofQPushButton, usepyqt-svg-toolbutton.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-svg-buttonUsageSvgButton(base_widget: QWidget = None)- Constructor. Base widget is the widget that the button's background color based of when button get hovered/pressed by mouse cursor. If value is default(None), background color of button which is getting hovered/pressed will set to #DDDDDD, #FFFFFF.setIcon(icon: str)- set the icon. Icon should be a SVG file's name. This is overriding method.setPadding(padding: int)- set the button's padding.setBorderRadius(border_radius: int)setBackground(background=None)- you can givebackgroundargument's value either 'transparent' or 6-digits or 3-digits hex color string or color's name like 'red', 'green'. If you don't give any arguments(None), background will automatically be set based on base widget's color if you give base widget argument toSvgButtonconstructor.setAsCircle()- set button's shape as circle.Included Packagespyqt-svg-abstractbuttonExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QApplication,QHBoxLayoutfrompyqt_svg_button.svgButtonimportSvgButtonclassSvgButtonExample(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):newButton=SvgButton()newButton.setIcon('new.svg')openButton=SvgButton()openButton.setIcon('open.svg')saveButton=SvgButton()saveButton.setIcon('save.svg')lay=QHBoxLayout()lay.addWidget(newButton)lay.addWidget(openButton)lay.addWidget(saveButton)self.setLayout(lay)if__name__=="__main__":importsysapp=QApplication(sys.argv)ex=SvgButtonExample()ex.show()sys.exit(app.exec_())Resulthttps://user-images.githubusercontent.com/55078043/153802219-ae019e5b-f603-4aad-93ce-035d33edd9a8.mp4Sorry for the video quality.Image quality is not perfect, but much better than video. Image above is slightly bigger than actual size.
Package: pyqt-svg-icon-pushbutton
pyqt-svg-icon-pushbuttonPyQtQPushButtonwhich user can set svg icon(not a low quality).I have to say thatsetIconofQPushButtondoensn't help that much in terms of setting SVG image as an icon. It's just another good old fashioned pixmap icon.So i overrides thesetIconmtehod to set SVG icon with the power of CSS.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-svg-icon-pushbuttonUsageSvgIconPushButton(base_widget: QWidget = None)- Constructor. Base widget is the widget that the button's background color based of when button get hovered/pressed by mouse cursor. If value is default(None), background color of button which is getting hovered/pressed will set to #DDDDDD, #FFFFFF.setIcon(icon: str)- set the icon. Icon should be a SVG file's name. This is overriding method.setPadding(padding: int)- set the button's padding.setBorderRadius(border_radius: int)setBackground(background=None)- you can givebackgroundargument's value either 'transparent' or 6-digits or 3-digits hex color string or color's name like 'red', 'green'. As you see, default is set toNone. If you set the value as default, background will automatically be set.setAsCircle()- set button's shape as circle.Included PackagesabsresgetterExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QApplication,QHBoxLayoutfrompyqt_svg_icon_pushbutton.svgIconPushButtonimportSvgIconPushButtonclassSvgIconPushButtonExample(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):newButton=SvgIconPushButton()newButton.setIcon('new.svg')openButton=SvgIconPushButton()openButton.setIcon('open.svg')saveButton=SvgIconPushButton()saveButton.setIcon('save.svg')lay=QHBoxLayout()lay.addWidget(newButton)lay.addWidget(openButton)lay.addWidget(saveButton)self.setLayout(lay)if__name__=="__main__":importsysapp=QApplication(sys.argv)ex=SvgIconPushButtonExample()ex.show()sys.exit(app.exec_())Resulthttps://user-images.githubusercontent.com/55078043/153802219-ae019e5b-f603-4aad-93ce-035d33edd9a8.mp4Sorry for the video quality.Image quality is not perfect, but much better than video. Above image is slightly bigger than actual size.I wish i know how to resize the video and image which are dropped on the README.md.
Package: pyqt-svg-icon-text-widget
pyqt-svg-icon-text-widgetPyQt widget consists of textless QLabel which has svg image as an icon on the left and text included QLabel on the right.This module is useful to set the icon included title bar.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-svg-icon-text-widgetIncluded Packagepyqt-svg-labelUsagesetSvgFile(filename: str)to set svg filesetText(text: str)to set textNoteSvg iconQLabel's maximum height is set according to text includedQLabel's font height.ExampleCode SamplefromPyQt5.QtWidgetsimportQApplicationfrompyqt_svg_icon_text_widgetimportSvgIconTextWidgetif__name__=="__main__":importsysapp=QApplication(sys.argv)ex=SvgIconTextWidget()ex.setSvgFile('ico/dark-notepad.svg')ex.setText('Dark Notepad')ex.show()sys.exit(app.exec_())Result
Package: pyqt-svg-label
pyqt-svg-labelPyQt QLabel which supports SVG iconThis is useful to set svg icon.If you want to use button which supports SVG icon, seepyqt-svg-icon-pushbutton.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-svg-labelUsagesetSvgFile(filename: str)to set svg file.Included PackagesabsresgetterExampleCode SamplefromPyQt5.QtWidgetsimportQLabel,QHBoxLayout,QApplication,QWidgetfrompyqt_svg_labelimportSvgLabelclassIconTitleWidget(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):iconLbl=SvgLabel()iconLbl.setSvgFile('ico/dark-notepad.svg')titleLbl=QLabel()titleLbl.setText('Dark Notepad')# get the point size of the titleLbl's fonttitle_lbl_size=titleLbl.font().pointSize()# to match the iconLbl's size with titleLbl's font size (usually double size is appropriate)iconLbl.setFixedSize(title_lbl_size*2,title_lbl_size*2)lay=QHBoxLayout()lay.addWidget(iconLbl)lay.addWidget(titleLbl)self.setLayout(lay)if__name__=="__main__":importsysapp=QApplication(sys.argv)ex=IconTitleWidget()ex.show()sys.exit(app.exec_())ResultIficonLbl.setFixedSize(title_lbl_size * 2, title_lbl_size * 2)is not included in the code sample, size of svg icon will be adjusted to fit the size of the window.See Alsopyqt-svg-icon-text-widget
Package: pyqt-svg-toolbutton
pyqt-svg-toolbuttonPyQt SVG icon QToolButtonParent class of this isQToolButtonandSvgAbstractButton. (Multiple inheritance)If you want to use svg supportingQPushButtoninstead ofQToolButton, usepyqt-svg-button.RequirementsPyQt5 >= 5.8Installpython -m pip install pyqt-svg-toolbuttonIncluded Packagespyqt-svg-abstractbutton
Package: pyqt-switch
pyqt-switchPyQt Switch (O ) -> ( O)You can choose the option to set the colorizing/moving animation.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-switchFeatureProvidetoggled(bool)signalSet the animation withsetAnimation(f: bool). Default is False.Set the diameter of circle-shaped switch button withsetCircleDiameter(diameter: int). Default is 20(px).ExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QFormLayout,QApplication,QLabelfrompyqt_switchimportPyQtSwitchclassWidget(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):switch=PyQtSwitch()switch.toggled.connect(self.__toggled)switch.setAnimation(True)# switch.setCircleDiameter(40)self.__label=QLabel()self.__label.setText('No')lay=QFormLayout()lay.addRow(self.__label,switch)self.setLayout(lay)def__toggled(self,f):iff:self.__label.setText('Yes')else:self.__label.setText('No')if__name__=="__main__":importsysapp=QApplication(sys.argv)example=Widget()example.show()app.exec_()Resulthttps://user-images.githubusercontent.com/55078043/169001914-0b86407a-5670-4ae4-ac28-54ec85460bc0.mp4If you set the circle diameter to 40 withswitch.setCircleDiameter(40)
Package: pyqt-tab-widget
pyqt-tab-widgetPyQt QTabWidget which is the most common type (if you doubt it, see the 'feature' section below). This has a lot of common features such as close a tab, close tabs to the left/right, close other tabs and so on.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-tab-widgetFeatureList which is able to do with context menuclose a tabclose tabs to the leftclose tabs to the rightclose other tabsclose all tabsreopen closed tabAlt+Left to change the current tab to the very left tabAlt+Right to change the current tab to the very right tabCtrl+F4 to close current tabClose any tabs with clicking the close button (close button's style is defaut, i will customize it)ExampleCode SamplefromPyQt5.QtWidgetsimportQApplication,QWidget,QMainWindowfrompyqt_tab_widgetimportTabWidgetclassMainWindow(QMainWindow):def__init__(self):super().__init__()self.__initUi()def__initUi(self):tabWidget=TabWidget()tabWidget.addTab(QWidget(),'A')tabWidget.addTab(QWidget(),'B')tabWidget.addTab(QWidget(),'C')tabWidget.addTab(QWidget(),'D')tabWidget.addTab(QWidget(),'E')self.setCentralWidget(tabWidget)if__name__=="__main__":importsysapp=QApplication(sys.argv)mainWindow=MainWindow()mainWindow.show()sys.exit(app.exec_())Result
Package: pyqttango
Provides a Qt resource file containing Tango freedesktop.org icons.InstallationUsing pip:pip install pyqttangoIn your code,:import pyqttangoYou can then use thefromTheme(name)command ofQIconto get Tango icons.
For example:import sys
import pyqttango
from PyQt5 import QtGui # or from PySide2 import QtGui

app = QtGui.QGuiApplication(sys.argv) # Only necessary if an application is not already created
QtGui.QIcon.setThemeName('tango')
icon = QtGui.QIcon.fromTheme('accessories-calculator')For the possible icon names, please refer to the freedesktop.orgIcon Naming SpecificationorWikiMedia Commons.Release notes0.2.0Useqtpyinstead of PyQt5. This allows the library to be compatible with PySide2 and PyQt5Update license to Apache Software License 2.0Developmentpyqttangogenerates the Qt resource file (.rcc) using all SVG images available onWikiMedia Commons.
The resource file is distributed as part of the wheel.
If you want to manually create it, run:python3 setup.py generate_rccLicenseAs for 0.2.0, license under Apache Software License 2.0Copyright (c) 2017-2019 Philippe Pinard
Package: pyqt-templates
pyqt_templates (v0.0.7)DESCRIPTION_SHORTpyqt help examples and some other useful objects (overloaded pyqt classes)DESCRIPTION_LONGDesigned for ...Featuresgood template for TableView/Model/SignalsLicenseSee theLICENSEfile for license rights and limitations (MIT).Release historySee theHISTORY.mdfile for release history.Installationpip install pyqt-templatesImportfrompyqt_templatesimport*USAGE EXAMPLESSee tests and sourcecode for other examples.1. template-1=IMPORT_BEST.pyimportsysfromPyQt5.QtCoreimport*fromPyQt5.QtGuiimport*fromPyQt5.QtWidgetsimport*2. template-2=QAPP_in_cls.pyimportsysfromPyQt5.QtCoreimport*fromPyQt5.QtGuiimport*fromPyQt5.QtWidgetsimport*fromtypingimport*# =====================================================================================================================pass# =====================================================================================================================classGui(QWidget):TITLE:str="[GUI] Universal"_QAPP:QApplication=QApplication([])def__init__(self):super().__init__()self.wgt_create()self.wgt_main__apply_settings()self.slots_connect()# GUI SHOW ----------------------------------------------------------------------------------------------------self.show()exit_code=self._QAPP.exec_()ifexit_code==0:print(f"[OK]GUI({exit_code=})closed correctly")else:print(f"[FAIL]GUI({exit_code=})closed INCORRECTLY")sys.exit(exit_code)defwgt_main__apply_settings(self)->None:# MAIN WINDOW -------------------------------------------------------------------------------------------------self.setWindowTitle(self.TITLE)self.setMinimumSize(300,100)# self.setMinimumWidth(300)# self.setMinimumHeight(100)self.resize(300,100)defwgt_create(self)->None:# GRID --------------------------------------------------------------------------------------------------------layout_grid=QGridLayout()layout_grid.setSpacing(2)layout_grid.addWidget(QLabel("STLINK"),0,0)layout_grid.addWidget(QLabel("0"),0,1)layout_grid.addWidget(QLabel("1"),0,2)# START -------------------------------------------------------------------------------------------------------self.btn_start=QPushButton("START")self.btn_start.setCheckable(True)# layout ------------------------------------------------------------------------------------------------------layout_main=QVBoxLayout()layout_main.addLayout(layout_grid)layout_main.addWidget(self.btn_start)self.setLayout(layout_main)defslots_connect(self)->None:self.btn_start.toggled.connect(self.btn_toggled)defbtn_toggled(self,_state:Optional[bool]=None)->None:print(f"btn{_state=}")# =====================================================================================================================if__name__=='__main__':Gui()# =====================================================================================================================
Package: pyqt-textbox-graphics-widget
pyqt-textbox-graphics-widgetPyQt text box which is movable, auto-resizable by text size. Parent class is QGraphicsWidget.RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-textbox-graphics-widgetUsageYou can move the box if you drag any areas near the border. If you click any areas near the middle of the box, cursor will be shown to let you write something down. Box will be auto-resized by text size. (See the result below)ExampleCode SamplefromPyQt5.QtWidgetsimportQApplication,QGraphicsView,QGraphicsScene,QMainWindowfrompyqt_textbox_graphics_widgetimportTextBoxGraphicsWidgetclassDiagramMainWindow(QMainWindow):def__init__(self):super().__init__()self.__initUi()def__initUi(self):view=QGraphicsView()self.__scene=QGraphicsScene()self.__scene.setSceneRect(0,0,400,400)textBox=TextBoxGraphicsWidget()self.__scene.addItem(textBox)view.setScene(self.__scene)self.setCentralWidget(view)if__name__=="__main__":importsysapp=QApplication(sys.argv)diagramMainWindow=DiagramMainWindow()diagramMainWindow.show()sys.exit(app.exec_())Resulthttps://user-images.githubusercontent.com/55078043/153204254-cd5776c3-54c3-47a5-9285-98229b0376b1.mp4See Alsopyqt-styled-graphics-text-item-example- This is based onQGraphicsTextItem. In terms of usefulness,pyqt-styled-graphics-text-item-exampleis more inferior than this one.
Package: pyqt-timer-label
pyqt-timer-labelPyQt QLabel adapted to timer featureRequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-timer-labelIncluded Packagespyqt-responsive-label- for auto-resize the font of label accordance with window's sizeDetailed DescriptionYou can set start hour/min/sec. Same to end. You can use this when you want to make a timer label which followshh:mm:ssformat. By the way, default end time is 00:00:00. You can change it with methods i'll explain below.Method, Signal OverviewsetStartHour(h: int),setStartMinute(m: int),setStartSecond(s: int). Same to end.setTimerReverse(f: bool)to make timer go reversed. Default is True, which means subtracts one second.There are useful methods likestart(),pause(),restart(),refresh(),reset(),stop()as well as useful signals likedoubleClicked,prepared,started,paused,restarted,refreshed,resetSignal,stopped.isPaused() -> bool- Check if the timer being paused or notExampleCode SamplefromPyQt5.QtWidgetsimportQApplication,QWidget,QGridLayoutfrompyqt_timer_labelimportTimerLabelif__name__=="__main__":importsysapp=QApplication(sys.argv)lbl=TimerLabel()lbl.setStartHour(0)lbl.setStartMinute(0)lbl.setStartSecond(15)widget=QWidget()lay=QGridLayout()lay.addWidget(lbl)widget.setLayout(lay)widget.show()lbl.start()sys.exit(app.exec_())Start time is 00:00:15. End time is by default so it is 00:00:00.Resulthttps://user-images.githubusercontent.com/55078043/154182901-bb7fd5fb-4eb1-46dd-bd5e-3cc9bacf95c7.mp4Note: I started recording from 12 seconds approximately. Preparation for recording took time so the result shows from the moment which indicates 9 seconds left.See Alsopyqt-timerpyqt-transparent-timer
Package: pyqt-titlebar-buttons-widget
pyqt-titlebar-buttons-widgetPyQt buttons (e.g. min/max/close) widget for title bar or menu barRequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-titlebar-buttons-widgetIncluded Packagespyqt-svg-buttonPackage Inherited by Thispyqt-windows-buttons-widgetpyqt-mac-buttons-widgetClass, Methods OverviewTitlebarButtonsWidget(base_widget=None, hint=['min, 'max', 'close'])- Constructor.getMinimizedBtn(),getMaximizedBtn(),getCloseBtn(). I belive these three methods are quite self-explanatory.setButtonSize(w, h). Set the overall width/height, text/icon size of button.NoteThis package was actually made for those two packages i mentioned. Reducing redundancy.=== 2022/5/20 ===I'm working on other features such as help/tack buttons.I could be working on adding another widgets(e.g. search bar) beside the buttons. So far i'm only working on the button because that seems to be the most generic feature.
Package: pyqt-toast
pyqt-toastPyQt Toast (Small message displayed on the screen, visible for a short time)RequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-toastIncluded Packagespyqt-resource-helperUsageToast(text='This is toast', duration=3, parent=self)- Constructor. Givingparentargument toselfvalue helps toast to maintain its place after window got moved.Note:You have to declare this one time as a class variable at initializing point(e.g.__initUi) or else new one will pop up even though last one is still showing.setPosition(pos: QPoint)- Place center of the toast at the given position.setFont(font: QFont)- Set the font of text in toast. Toast's size will be automatically changed based on text's size.setForegroundColor(color)- Set the text(foreground) color.colorargument can be bothstr(6-digits hex color string),QColortypes.setBackgroundColor(color)- Set the background color.colorargument can be bothstr(6-digits hex color string),QColortypes.setOpacity(opacity: float)- Set the opacity of toast.setDuration(duration: int)- Set the duration of toast.setAlignment(alignment)- Set the alignment of text.ExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QApplication,QPushButton,QGridLayoutfrompyqt_toastimportToastclassToastExample(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):btn=QPushButton('Krabby Patty secret formula')self.__toast=Toast(text='The Krabby Patty formula is the sole property of the Krusty Krab and is only to be discussed in part or in whole with its creator Mr. Krabs. Duplication of this formula is punishable by law. Restrictions apply, results may vary.',duration=3,parent=self)btn.clicked.connect(self.__toast.show)lay=QGridLayout()lay.addWidget(btn)self.setLayout(lay)if__name__=="__main__":importsysapp=QApplication(sys.argv)toastExample=ToastExample()toastExample.show()app.exec_()Resulthttps://user-images.githubusercontent.com/55078043/163155105-371e5d88-8b77-4a25-90cc-5c461f841762.mp4
Package: pyqt-tooltip-list-widget
pyqt-tooltip-list-widgetPyQt QListWidget which shows text as tooltip longer than widget's sizeRequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-tooltip-list-widgetExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QGridLayout,QApplicationfrompyqt_tooltip_list_widgetimportToolTipListWidgetclassWidget(QWidget):def__init__(self):super().__init__()self.__initUi()def__initUi(self):self.__listWidget=ToolTipListWidget()self.__listWidget.addItem('Note: The selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected; i.e., it will not draw a selection rectangle if the selection mode is QAbstractItemView::SingleSelection.')self.__listWidget.addItem('B')self.__listWidget.addItem('C')lay=QGridLayout()lay.addWidget(self.__listWidget)lay.setContentsMargins(0,0,0,0)self.setLayout(lay)if__name__=="__main__":importsysapp=QApplication(sys.argv)example=Widget()example.show()app.exec_()Result
Package: pyqt-tooltip-widget
pyqt-tooltip-widgetPyQt QWidget as a tooltipRequirementsPyQt5 >= 5.8Setuppython -m pip install pyqt-tooltip-widgetDetailed DescriptionThis isQWidgetwhich is activated like tooltip. When mouse cursor enters to the widget,ToolTipWidgetpops up at the bottom left of the widget. Leave from the widget tooltip will be disappeared.I made it work by catchingQEnterEventandQLeaveEventof widget.ToolTipWidgetinheritsQWidget, so you can decorate it just likeQWidget.UsageJust make instance of it likeself.toolTip = ToolTipWidget(yourWidget).yourWidgetargument is the widget which you want to set tooltip of. Instance should be class variable.Method OverviewsetStillOpenWhenCursorLeaveFromToolTipWidget(f: bool)- Tooltip will be kept showing when cursor is inside the tooltip. (this is disabled by default)isStillOpenWhenCursorLeaveFromToolTipWidget() -> boolExampleCode SamplefromPyQt5.QtWidgetsimportQWidget,QMainWindow,QHBoxLayout,QPushButton,QApplication,QVBoxLayoutfrompyqt_date_table_widgetimportDateTableWidgetfrompyqt_tooltip_widgetimportToolTipWidgetclassMainWindow(QMainWindow):def__init__(self):super().__init__()self.__initUi()def__initUi(self):btn=QPushButton('Show Date Table Widget')lay=QHBoxLayout()lay.addWidget(btn)mainWidget=QWidget()mainWidget.setLayout(lay)### Make tooltip start ###dateTableWidget=DateTableWidget()# https://github.com/yjg30737/pyqt-date-table-widget.gitlay=QVBoxLayout()lay.addWidget(dateTableWidget)lay.setContentsMargins(0,0,0,0)self.__tooltip=ToolTipWidget(btn)self.__tooltip.setFixedSize(200,200)self.__tooltip.setLayout(lay)### Make tooltip end ###self.setCentralWidget(mainWidget)if__name__=="__main__":importsysapp=QApplication(sys.argv)example=MainWindow()example.show()app.exec_()Result