PyQt5 pyqtsignal object has no attribute connect

I’m working on a PyQt5 application for a course and need to implement a pop-up menu that appears when I right-click on the screen. I attempted to implement it, but I’m encountering an error stating that the PyQtSignal object has no connect attribute. According to the documentation, there should be a connect attribute, so I’m not sure what’s going wrong.

Here is the part of the code concerned:

import os,sys,json
from PyQt5 import QtCore,QtGui,QtWidgets
from PyQt5.QtWidgets import QMessageBox

#from scene import Scene
from view import View

class Window(QtWidgets.QMainWindow):
    def __init__(self,position=(0,0),dimension=(500,300)):
        QtWidgets.QMainWindow.__init__(self)
        #...
        self.view=View()
        self.scene=QtWidgets.QGraphicsScene()  # Model
        self.view.setScene(self.scene)
        self.setCentralWidget(self.view)

        #...

        self.create_actions()
        self.connect_actions()
        self.create_menus()






    # ...



    def connect_actions(self) :


        # This doesnt work
        #self.view.show_popup_menu.connect(self.show_popup_menu_slot)

        # ...

    
    def create_menus(self) :
        #...

        # Popup menu
        self.popupMenu = QtWidgets.QMenu(self)
        popup_menu_style_pen = self.popupMenu.addMenu(QtGui.QIcon("Icons/tool_pen.png"), '&Pen')
        popup_menu_style_pen.addAction(self.action_style_pen_color)
        popup_menu_style_pen.addAction(self.action_style_pen_width)
        popup_menu_style_pen_line = popup_menu_style_pen.addMenu('&Line')
        popup_menu_style_pen_line.addAction(self.action_line_solidline)
        popup_menu_style_pen_line.addAction(self.action_line_dotline)
        popup_menu_style_pen_line.addAction(self.action_line_dashdotline)
        popup_menu_style_brush = self.popupMenu.addMenu(QtGui.QIcon("Icons/brush.png"), '&Brush')
        popup_menu_style_brush.addAction(self.action_style_brush_color)
        popup_menu_style_brush_fill = popup_menu_style_brush.addMenu(QtGui.QIcon("Icons/brush.png"), '&Fill')
        popup_menu_style_brush_fill.addAction(self.action_style_brush_Cross)
        popup_menu_style_brush_fill.addAction(self.action_style_brush_Solid)
        popup_menu_style_brush_fill.addAction(self.action_style_brush_Horizontal)
        popup_menu_style_brush_fill.addAction(self.action_style_brush_Vertical)
        popup_menu_style_brush_fill.addAction(self.action_style_brush_DiagCross)
        popup_menu_style_brush_fill.addAction(self.action_style_brush_None)


    def show_popup_menu_slot(self):
        self.popupMenu.exec_(QtGui.QCursor.pos())

The show_popupmenu is defined in the view constructor in an other file like this:

self.show_popup_menu = QtCore.pyqtSignal()

We have to build our project in those 2 files

I tried to look on the internet, i found stack overflow examples with PyQt4 but it doesnt work in my case

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật