This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
modern-linbo-gui/sources/main.cpp

61 lines
1.3 KiB
C++

// STL-includes
#include <iostream>
#include <qwindowsystem_qws.h>
#include <QWSServer>
#include <qimage.h>
#include <qtimer.h>
// qt
#include <qapplication.h>
#include <QtGui>
#include <QPalette>
#include <QBrush>
#include <QScreen>
#include <QLocale>
#include "linbogui.h"
int main( int argc, char* argv[] )
{
QApplication myapp( argc, argv );
#ifndef TEST_ENV
QWSServer* wsServer = QWSServer::instance();
QImage bgimg( "/icons/linbo_wallpaper.png", "PNG" );
int width = qt_screen->deviceWidth();
int height = qt_screen->deviceHeight();
if ( wsServer ) {
wsServer->setBackground( QBrush( bgimg.scaled( width, height, Qt::IgnoreAspectRatio ) ) );
wsServer->refresh();
}
#endif
linboGui* gui = new linboGui;
gui->show();
// this paints a transparent main widget
//myGUI->setStyleSheet( "QDialog#linboGUI{ background: blue }");
/* myGUI->Console->viewport()->setAutoFillBackground(true);
myGUI->Console->setTextColor( QColor("white") );
QPalette palette; */
// a grey transparent background
// myGUI->Console->setStyleSheet("QTextEdit#Console{ background: transparent }");
#ifdef TEST_ENV
QMainWindow window;
window.setCentralWidget(myGUI);
window.setGeometry(myGUI->geometry());
window.show();
#endif
//QTimer::singleShot( 100, myGUI, SLOT(executeAutostart()) );
return myapp.exec();
}