Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Missing emit keyword on signal call
QtWS25 Last Chance

Missing emit keyword on signal call

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 949 Views
  • 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.
  • D Offline
    D Offline
    DungeonLords
    wrote on last edited by DungeonLords
    #1

    I want emit signal by macros (define). Why I get warning "Missing emit keyword on signal call Rial::finished"? This is my code

    #define EmitSignal() emit finished()
    
    void Rial::SlotEmiter(){
        qDebug() << "start EmitSignal";
        EmitSignal(); //Missing emit keyword on signal call Rial::finished
    }
    

    P.S. But in fact my code works...

    Full code here.

    sierdzioS Pl45m4P 2 Replies Last reply
    0
    • D DungeonLords

      I want emit signal by macros (define). Why I get warning "Missing emit keyword on signal call Rial::finished"? This is my code

      #define EmitSignal() emit finished()
      
      void Rial::SlotEmiter(){
          qDebug() << "start EmitSignal";
          EmitSignal(); //Missing emit keyword on signal call Rial::finished
      }
      

      P.S. But in fact my code works...

      Full code here.

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @DungeonLords emit is also a macro, which expands to nothing. I guess this is part of the reason.

      The warning you get probably comes from clazy, a tool which helps finding questionable things in use of Qt. It is not the compiler issuing the warning, so compilation will work fine.

      (Z(:^

      1 Reply Last reply
      4
      • D DungeonLords

        I want emit signal by macros (define). Why I get warning "Missing emit keyword on signal call Rial::finished"? This is my code

        #define EmitSignal() emit finished()
        
        void Rial::SlotEmiter(){
            qDebug() << "start EmitSignal";
            EmitSignal(); //Missing emit keyword on signal call Rial::finished
        }
        

        P.S. But in fact my code works...

        Full code here.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @DungeonLords said in Missing emit keyword on signal call:

        #define EmitSignal() emit finished()

        But why would you replace one specific signal (finished with a generic EmitSignal)?
        Dont get the sense of this one? :)


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        D 1 Reply Last reply
        0
        • Pl45m4P Pl45m4

          @DungeonLords said in Missing emit keyword on signal call:

          #define EmitSignal() emit finished()

          But why would you replace one specific signal (finished with a generic EmitSignal)?
          Dont get the sense of this one? :)

          D Offline
          D Offline
          DungeonLords
          wrote on last edited by
          #4

          @Pl45m4 EmitSignal() is big macros, I put main part here for discussion about warning..

          1 Reply Last reply
          0

          • Login

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