开发者

How to check if a Mainwindow button is clicked from main.cpp?

开发者 https://www.devze.com 2023-02-15 06:46 出处:网络
Is there any way to check if t开发者_Python百科he Mainwindow button is clicked from main.cpp? I want to excecute the following line when I pressed the Play button of Mainwindow:

Is there any way to check if t开发者_Python百科he Mainwindow button is clicked from main.cpp? I want to excecute the following line when I pressed the Play button of Mainwindow:

pipe = popen("mplayer -slave '/home/cinesoft/Desktop/yamuna/songs/first.3gp' &", "w");

I also want the following line to execute when the pause button is pressed:

fputs("pause\n", pipe);


bjoernz is right. You need to use the Signals and Slots mechanisms built into QT.

Why can't you execute that code in the Mainwindow.cpp class instead of main.cpp? Would make life a lot easier.


You may want to look under Signals & Slots on this page: Programming with Qt

Cross-Platform Applications using Qt is also a good reference for Qt programming.

0

精彩评论

暂无评论...
验证码 换一张
取 消