info_dict = qvariant_converter.getStringDict(info_dict["info"])
description = info_dict.get("description", "")
image = os.path.join(info_dict["path"], ".image.png")
- if not os.path.exists(image):
- image = ":/images/default_board_image.png"
+ if os.path.exists(image):
+ self.pageContent.imageLabel.setPixmap(QPixmap(image))
+ self.pageContent.imageLabel.setVisible(True)
+ else:
+ self.pageContent.imageLabel.setVisible(False)
self.pageContent.descriptionLabel.setText(description)
- self.pageContent.imageLabel.setPixmap(QPixmap(image))
####
preset = self.preset_data["children"][preset_path]
self.pageContent.descriptionLabel.setText(preset["info"].get("description", ""))
image = os.path.join(preset["info"]["path"], const.PREDEFINED_BOARD_IMAGE_FILE)
- if not os.path.exists(image):
- image = const.PREDEFINED_BOARD_DEFAULT_IMAGE
- self.pageContent.imageLabel.setPixmap(QPixmap(image))
+ if os.path.exists(image):
+ self.pageContent.imageLabel.setPixmap(QPixmap(image))
+ self.pageContent.imageLabel.setVisible(True)
+ else:
+ self.pageContent.imageLabel.setVisible(False)
@property
def selected(self):
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="descriptionLabel">
+ <widget class="QLabel" name="imageLabel">
<property name="text">
<string/>
</property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
</widget>
</item>
<item>
</spacer>
</item>
<item>
- <widget class="QLabel" name="imageLabel">
+ <widget class="QLabel" name="descriptionLabel">
<property name="text">
<string/>
</property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
</widget>
</item>
</layout>