Python Forum

Full Version: PyQt5 drawing on scrollable area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some things are not so easy to understand for me as PyQt5 newbie. Huh
I have a QTabWidget with 3 Tabs. On Tab2 I have a scrollable area and now I want to draw some graphics on that area. How can I do that ???

        ...
        self.tabWidget = QTabWidget(self)
        self.tabWidget.setContextMenuPolicy(Qt.DefaultContextMenu)
        self.setCentralWidget(self.tabWidget)
        ...
        tabGrafik = QWidget()
        self.tabWidget.addTab(tabGrafik, "Grafik")
        self.scrollArea = QScrollArea(tabGrafik)
        self.scrollArea.setGeometry(20, 100, 860, 450)
        self.labelImg = QtWidgets.QLabel()
        self.labelImg.adjustSize()
        self.scrollArea.setWidget(self.labelImg)
        ...
I want to draw on "labelImg". And before drawing I want to resize labelImg to my needs.

Thanks
What do you want to draw? You can load images in QLabel.
(Mar-28-2023, 12:36 PM)Axel_Erfurt Wrote: [ -> ]What do you want to draw? You can load images in QLabel.

No images/photos. I want to draw my own graphs.