PDA

View Full Version : Aceess Common Frame for two Different Ui class



Mangal Prajapati
19th July 2019, 14:20
I have used 2 common frame in 5 base class i do not want to add 2 frame again and again is it possible to share 2 common frame in all class. my frame consist 4 pushbutton. i want to get click event on this 4 button also.what is away to do this way.

d_stranz
19th July 2019, 16:22
If what you mean by "Frame" is a QWidget with a set of child widgets inside it, then create a new class derived from QWidget and use Qt Designer to add your buttons and other widgets to it. If you want to expose the buttons clicks to the outside, then add four signals to this class and connect each one to one of the four buttons' clicked() signals. This will relay those signals to the outside world.

Any place you want this same "Frame", you can add an instance of your custom widget and connect up the signals as needed.

Mangal Prajapati
23rd July 2019, 06:36
Thanks for your suggestion. I will try and let you know soon.