How to link one class to another??
-
You can use signals and slots like this:
@
int main( int argc, char *argv[] )
{
QApplication app(argc, argv);QTextEdit editor1;
QTextEdit editor2;editor1.show();
editor2.show();QObject::connect(&editor1, &QTextEdit::textChanged, &editor2, &QTextEdit::clear);
return app.exec();
}
@Every time you edit text in editor1 - editor2 clear it's content.
-
Did you read "this article":http://qt-project.org/doc/qt-5/signalsandslots.html?
-
Signal:
@
// Inside class definition:
signals:
void signalOfYourClass();
@That's it. You don't need to make implementation of the function "signalOfYourClass".
Public slot:
@
// Inside class definition:
public slots:
void slotOfYourClass();
@Also you have to make implementation of function "slotOfYourClass".
-
I wrote in contols class
slot:
void play()
coz contols class has all the widgets.and in other class
signals:
void clicked();and wrote the function for play() and put it in controls class.
Stills its not working ,showing the same error“no videoWindowControl or videoRendererControl, unable to add output node for video data”
i this that play slot is unable to find the screen videosurface to show the video that why i am getting this error so how should i pass this screen class to play