PyQt example which shows widget at the bottom-right corner of window (using event/geometry, no QGridLayout involved)
This is just for example.
- PyQt5 >= 5.8
python -m pip install git+https://github.com/yjg30737/pyqt-corner-widget-example.git --upgrade
from PyQt5.QtWidgets import QApplication
from pyqt_corner_widget_example import MainWindow
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
w = MainWindow()
w.show()
app.exec_()
Result
Normal
Maximize
After resize
This also works when activating/deactivating the window, which means corner widget is completely synchronized with the main window.
- pyqt-show-button-when-hover-widget - In this example, i used
QGridLayout
to set button's position at bottom right.