Browse Source
The QApplication constructor exits the entire process if it cannot find a working Qt back-end. This is unacceptable within VLC, as we expect to fallback to another interface plugin in such circumstances. Qt 4.x selected its back-end at build time. VLC would try to connect to the same back-end system (in practice: X11) to second-guess QApplication, and preempt the initialization failure. Qt 5.x selects its back-end at run time depending on installed back-end plugins and running windowing system(s). There are no reasonable and reliable ways to second-guess Qt anymore. This commit introduces a dummy executable program that simply tries to instantiate a QApplication. If it succeeds, it returns 0. Otherwise, it returns an error. This allows its parent process to safely check if Qt is available at run-time.pull/67/head
3 changed files with 38 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
/*****************************************************************************
|
|||
* vlc-qt-check.cpp: run-time Qt availability test |
|||
**************************************************************************** |
|||
* Copyright © 2018 Rémi Denis-Courmont |
|||
* |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU Lesser General Public License as published by |
|||
* the Free Software Foundation; either version 2.1 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Lesser General Public License |
|||
* along with this program; if not, write to the Free Software |
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
|||
*****************************************************************************/ |
|||
|
|||
#ifdef HAVE_CONFIG_H |
|||
# include "config.h" |
|||
#endif |
|||
|
|||
#include <QApplication> |
|||
|
|||
int main(int argc, char *argv[]) |
|||
{ |
|||
QApplication app(argc, argv); |
|||
} |
|||
Loading…
Reference in new issue