20 #include "qgsconfig.h"
26 #include <fcgi_stdio.h>
29 #include <QFontDatabase>
38 return FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ );
44 int main(
int argc,
char *argv[] )
55 const char *display = getenv(
"DISPLAY" );
56 bool withDisplay =
true;
60 qputenv(
"QT_QPA_PLATFORM",
"offscreen" );
61 QgsMessageLog::logMessage(
"DISPLAY not set, running in offscreen mode, all printing capabilities will not be available.",
"Server", Qgis::MessageLevel::Info );
64 QgsApplication app( argc, argv, withDisplay, QString(), QStringLiteral(
"server" ) );
66 #ifdef HAVE_SERVER_PYTHON_PLUGINS
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
static void exitQgis()
deletes provider registry and map layer registry
Class defining fcgi request.
bool hasError() const
Returns true if an error occurred during initialization.
Class defining fcgi response.
void sendError(int code, const QString &message) override
Send error This method delegates error handling at the server level.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
QgsServerRequest::Method method() const
The QgsServer class provides OGC web services.
void handleRequest(QgsServerRequest &request, QgsServerResponse &response, const QgsProject *project=nullptr)
Handles the request.
int main(int argc, char *argv[])