QT Signal and Slot between windows -


i want connect windows in qt.

i know how connect 2 widgets in same window.

using qobject::connect() in ui_a.h;

but now, have 2 windows.

six files.

for example:

ui_a.h(window a)

a.h a.cpp (widget in window a)

ui_b.h(window b)

b.h b.cpp (widget in window b)

how connect 2 widget in different windows?

thank you.

you have find scope of both window object , connect them there. perhaps connecting them main.cpp make easier. example,

qapplication a(argc, argv); a; b b; qobject::connect(&a, signal(somesingal()), &b, slot(someslot())); qobject::connect(&b, signal(anothersingal()), &a, slot(anotherslot())); a.show(); b.show(); return a.exec(); 

Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -