Domanda

Ho impostato un'immagine di sfondo (JPEG) su un widget di Qt utilizzando setStyleSheet(). Questo è perfettamente indicata sul mio computer, ma non su un altro computer.

Non ricevo un errore di collegamento su un altro computer - la funzione semplicemente non funziona. C'è qualcosa che mi manca nella distribuzione o build di mia app, qualcosa che gli strumenti dev installazioni Qt o è comunque a disposizione, che non è presente su altre macchine? Come posso distribuire un'applicazione Qt che utilizza la funzionalità JPEG?

È stato utile?

Soluzione

JPEG support in Qt comes as a plugin. Make sure you have also deployed the plugin to your non-development machine. If you haven't, it will simply silently fail and you'll end up not seeing any of the JPEG images. Have a look at the official documentation for more detailed information: http://qt-project.org/doc/qt-4.8/deployment-windows.html

In short (and as a quick solution, but have a look at the documentation as well) you could create a directory named "imageformats" as a subdirectory of the folder containing your exe, into which you copy QJPEG4.dll.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top