Hey

I have a class X which inherits from QTreeWidget. I have overloaded the contextMenuEvent so I can create a mouse right click menu for the items. I cannot find a clean and easily scalable method of linking all of the menu actions to functions within class X.

Initially I thought I could connect a class X function to a class X action within the class X constructor. It wouldn't compile. I had to do the connection in the MainWindow constructor, connecting the Qaction in class X with a function in MainWindow. The function in MainWindow then had to call a function in Class X. This appears very sloppy and un-scalable. Are there any nicer ways to do this. And is it possible to do connections inside custom classes?

Thank you