Added code to the Qt gui to allow for individual users to set custom Qt styling. The Qt gui will check to see if an environment variable exists named FCEUX_QT_STYLESHEET, which should contain the full path to a Qt stylesheet file. If the variable is defined and the file exists and can be opened, then the style content for that file will be used by the application.
This commit is contained in:
parent
9e57c49f5a
commit
1c762f95d1
|
@ -1,3 +1,5 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include "Qt/ConsoleWindow.h"
|
#include "Qt/ConsoleWindow.h"
|
||||||
|
@ -9,6 +11,27 @@ int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
const char *styleSheetEnv = NULL;
|
||||||
|
|
||||||
|
styleSheetEnv = ::getenv("FCEUX_QT_STYLESHEET");
|
||||||
|
|
||||||
|
if ( styleSheetEnv != NULL )
|
||||||
|
{
|
||||||
|
QFile File(styleSheetEnv);
|
||||||
|
|
||||||
|
if ( File.open(QFile::ReadOnly) )
|
||||||
|
{
|
||||||
|
QString StyleSheet = QLatin1String(File.readAll());
|
||||||
|
|
||||||
|
app.setStyleSheet(StyleSheet);
|
||||||
|
|
||||||
|
printf("Using Qt Stylesheet file '%s'\n", styleSheetEnv );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Warning: Could not open Qt Stylesheet file '%s'\n", styleSheetEnv );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fceuWrapperInit( argc, argv );
|
fceuWrapperInit( argc, argv );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue