--- a/src/eric7/Graphics/PixmapDiagram.py Fri Mar 08 15:30:23 2024 +0100 +++ b/src/eric7/Graphics/PixmapDiagram.py Fri Mar 08 15:30:53 2024 +0100 @@ -12,7 +12,6 @@ QAction, QColor, QFont, - QImage, QPageLayout, QPainter, QPalette, @@ -24,8 +23,10 @@ from eric7 import Preferences from eric7.EricGui import EricPixmapCache from eric7.EricWidgets import EricMessageBox +from eric7.EricWidgets.EricApplication import ericApp from eric7.EricWidgets.EricMainWindow import EricMainWindow from eric7.EricWidgets.EricZoomWidget import EricZoomWidget +from eric7.SystemUtilities import FileSystemUtilities class PixmapDiagram(EricMainWindow): @@ -186,8 +187,30 @@ @return flag indicating success @rtype bool """ - image = QImage(filename) - if image.isNull(): + pixmap = QPixmap() + if FileSystemUtilities.isRemoteFileName(filename): + try: + data = ( + ericApp() + .getObject("EricServer") + .getServiceInterface("FileSystem") + .readFile(filename) + ) + pixmap.loadFromData(data) + except OSError as err: + EricMessageBox.warning( + self, + self.tr("Pixmap-Viewer"), + self.tr( + """<p>The file <b>{0}</b> cannot be loaded.</p>""" + """<p>Reason: {1}</p>""" + ).format(filename, str(err)), + ) + return False + else: + pixmap.load(filename) + + if pixmap.isNull(): EricMessageBox.warning( self, self.tr("Pixmap-Viewer"), @@ -198,7 +221,7 @@ ) return False - self.pixmapLabel.setPixmap(QPixmap.fromImage(image)) + self.pixmapLabel.setPixmap(pixmap) self.pixmapLabel.adjustSize() return True