Python Forum
[PyQt] PyQt5 drawing on scrollable area
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] PyQt5 drawing on scrollable area
#1
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
Reply
#2
What do you want to draw? You can load images in QLabel.
Reply
#3
(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.
Reply
#4
Look at https://github.com/pyqt/examples/tree/_/...sicdrawing
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Scrollable buttons with an add/delete button Clich3 5 3,332 Jun-16-2022, 07:19 PM
Last Post: rob101
  [Tkinter] How to create scrollable frame mandiatutti 7 4,336 Aug-07-2021, 03:34 PM
Last Post: deanhystad
Question [Tkinter] Scrollable Treeview: change behavior of Prior/Next keys? RockDoctor 2 3,155 Apr-10-2021, 05:40 PM
Last Post: RockDoctor
  Scrollable big image in a window (TKinter) Prospekteur 3 4,409 Sep-14-2020, 03:06 AM
Last Post: Larz60+
  [Tkinter] Fixate graphs on scrollable canvas janema 6 5,356 Apr-12-2019, 03:57 PM
Last Post: Larz60+
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 2,785 Apr-06-2019, 11:15 PM
Last Post: ZenWoR
  [Tkinter] ListBox not contained or scrollable kellykimble 6 5,098 Apr-05-2018, 11:59 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020