Qt signal with an enum as a parameter

前端 未结 3 753
不思量自难忘°
不思量自难忘° 2021-01-22 02:02

I\'m trying to pass an enum as a value to a slot in my program, but I\'m having some problems. In my header file I\'ve created the enum:

Q_ENUMS(button_type);
e         


        
3条回答
  •  梦毁少年i
    2021-01-22 02:50

    You're passing the SLOT() macro a value when it's expecting a type. More fundamentally this doesn't make much sense anyway as what you're struggling to achieve is to pass the slot a constant. Why not just use button_back in the slot function directly?

    You can define a slot which takes a button_type value, but then you'd need to connect it to a signal that passes one as a parameter.

    What are you actually trying to do?

提交回复
热议问题