Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQt5 Widget crashes with custom context menu events?
Forum Updated to NodeBB v4.3 + New Features

PyQt5 Widget crashes with custom context menu events?

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 4 Posters 574 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MistaGoat05
    wrote on 5 Sept 2024, 20:46 last edited by
    #1

    So I'm following along with the beginner PyQt tutorials using PyQt5 and I made it to the context menus tutorial but when I try to link an action in the context menu it breaks. All of the Context Menu Actions return the same thing and the program crashes when I select any of them, I attached a picture of the code and error ![Code]([image https://imgbox.com/1HHagDcT]

    J S 2 Replies Last reply 6 Sept 2024, 05:19
    0
    • S SGaist moved this topic from Language Bindings on 5 Sept 2024, 20:52
    • M MistaGoat05
      5 Sept 2024, 20:46

      So I'm following along with the beginner PyQt tutorials using PyQt5 and I made it to the context menus tutorial but when I try to link an action in the context menu it breaks. All of the Context Menu Actions return the same thing and the program crashes when I select any of them, I attached a picture of the code and error ![Code]([image https://imgbox.com/1HHagDcT]

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 6 Sept 2024, 05:19 last edited by
      #2

      @MistaGoat05 said in PyQt5 Widget crashes with custom context menu events?:

      I attached a picture of the code and error

      Please post code and error as text not pictures

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 7 Sept 2024, 14:58
      1
      • M MistaGoat05
        5 Sept 2024, 20:46

        So I'm following along with the beginner PyQt tutorials using PyQt5 and I made it to the context menus tutorial but when I try to link an action in the context menu it breaks. All of the Context Menu Actions return the same thing and the program crashes when I select any of them, I attached a picture of the code and error ![Code]([image https://imgbox.com/1HHagDcT]

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 6 Sept 2024, 18:55 last edited by SGaist 9 Aug 2024, 18:19
        #3

        @MistaGoat05 Hi,

        Your connect statement is wrong, you're passing a class where you should be passing a function and calling print where you should have the connection type.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • J jsulm
          6 Sept 2024, 05:19

          @MistaGoat05 said in PyQt5 Widget crashes with custom context menu events?:

          I attached a picture of the code and error

          Please post code and error as text not pictures

          M Offline
          M Offline
          MistaGoat05
          wrote on 7 Sept 2024, 14:58 last edited by
          #4

          @jsulm Sorry, I tried to but I am very new to this and when I pasted the url where it said url it just posted like that

          J 1 Reply Last reply 7 Sept 2024, 15:01
          0
          • M MistaGoat05
            7 Sept 2024, 14:58

            @jsulm Sorry, I tried to but I am very new to this and when I pasted the url where it said url it just posted like that

            J Offline
            J Offline
            JonB
            wrote on 7 Sept 2024, 15:01 last edited by JonB 9 Jul 2024, 15:03
            #5

            @MistaGoat05
            We are asking you kindly not to post any "pictures" of code or error messages. Therefore you won't be using any "url". "Pictures" of code/messages are too hard to look at, and people need to be able to copy the actual text of stuff to help you out. We are asking you do text copy & paste into your posts here --- preferably inside the forum posts' Code tags, which you can achieve by selecting all the block(s) of code text you are pasting and pressing the </> button --- not any screenshots/pictures.

            1 Reply Last reply
            1

            5/5

            7 Sept 2024, 15:01

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved