Mandar
Mandar

Reputation: 1044

hide all QT application warning which are printed on terminal?

when i run a qt application i get warning messages.

$ ./TestLauncher
QSystemTrayIcon::setVisible: No Icon set
QMetaObject::connectSlotsByName: No matching signal for on_Save_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_CancelButton_clicked()
...

I just want to hide all the warnings which are printed on terminal when application is running

Upvotes: 2

Views: 1378

Answers (2)

Mandar
Mandar

Reputation: 1044

well i didnt find any QT function so i have redirected output of the application but now the drawback is that it will hide non QT warnings to.

freopen( "/dev/null", "w", stdin );
freopen( "/dev/null", "w", stdout );
freopen( "/dev/null", "w", stderr );

Upvotes: 0

Dmitry Sazonov
Dmitry Sazonov

Reputation: 9014

Use QT_NO_WARNING_OUTPUT macro. See Qt Debug Documentation

Upvotes: 2

Related Questions