As you know we can resize widgets in any software, there's an example in the image above.
Below is a simple code with two buttons. I want two resize widgets with mouse.
import sys
from PyQt6.QtWidgets import QWidget, QApplication, QHBoxLayout, QPushButton
app = QApplication(sys.argv)
class Window(QWidget):
def __init__(self) -> None:
super().__init__()
#LayoutSet
layout = QHBoxLayout()
self.setLayout(layout)
#Add buttons
layout.addWidget(QPushButton("ok"))
layout.addWidget(QPushButton("cancel"))
w = Window()
w.show()
sys.exit(app.exec())
I searched everywhere on the net but I couldn't find any answers.