Later on I thought about a tighter integration with GeoServer than to save first a SLD file and then upload or copy-and-paste to GeoServer. Using GeoServer's REST API the SLD preview dialog features now the possibility to upload the style directly to GeoServer.
|SLD Preview dialog|
As parameters the GeoServer URL, user name and password and a layer name are required. The URL has to point to the REST API usually ending with /geoserver/rest/. The REST API was introduced with GeoServer version 2.1, for older version it can be installed as an extension.
From the technical side: The network communication is done using QNetworkAccessManager and QNetworkRequests. A new style is created by POSTing the SLD to /geoserver/rest/styles.sld?name=. Authentication is done using basic access authentication as required by GeoServer. The server returns a 403 Forbidden status code if there is already a style with the same name.
Important: Consider it as a proof-of-concept, it is far from complete! And as always, feedback is highly appreciated.