Skip to content Skip to sidebar Skip to footer

How To Load .ico Files In Pyqt4 From Network

I have a app developed in PyQt4. It has icons set for windows and QMenus. All client systems have installed python. And PyQt4 is loaded from network location (\\system_xyz\PyQt4).

Solution 1:

Although answer is being accepted, here is a better solution for network PyQt4 plugin loading.

After checking official addLibraryPath pages, I found that you have to use QtCore.QCoreApplication.addLibraryPath(). So instead of using QtGui version, use like following:

QtCore.QCoreApplication.addLibraryPath( '//server/location/PyQt4/plugins' )
app = QtGui.QApplication(sys.argv)

If you do this right before you create your QApplication, you will be set. I don't even need to use qt.conf at all to load plugins properly from my network drive.

Solution 2:

You can set the paths in qt.conf file and place this file in the location of your executable file of your application.

Accessing PyQt4 from Network Location say \somesystem\Share\PyQt4

you can find a qt.conf file in \\somesystem\Share\PyQt4 copy it and paste the .conf file in the location of your executable file of your application.

edit the below lines in qt.conf

[Paths]Prefix = //somesystem/Share/PyQt4
Binaries = //somesystem/Share/PyQt4

Everything works fine, even sqldrivers will be loaded. No Need of using app.addLibraryPath You can also include this file in your setup so that it will be automatically installed.

Post a Comment for "How To Load .ico Files In Pyqt4 From Network"