Initial page of the wizard. Permit to select the project name and the directory
where the project will be created.
"""
-
+
def __init__(self):
BWizardPage.__init__(self, UI_LOCATION + "/intro_page.ui")
self.setTitle(self.tr("Welcome in BeRTOS Wizard!"))
-
+ self.image = QPixmap(":/images/logo.png")
+
+ ## Overloaded QWidget methods ##
+
+ def resizeEvent(self, event):
+ self._scalePicture()
+ BWizardPage.resizeEvent(self, event)
+
+ def showEvent(self, event):
+ self._scalePicture()
+ BWizardPage.showEvent(self, event)
+
+ ##
+
## Overloaded QWizardPage methods ##
def isComplete(self):
Overload of the QWizardPage isComplete method.
"""
return True
-
+
####
+ def _scalePicture(self):
+ """
+ I need this method because the scaledContent property of the QLabel
+ doesn't care the aspect ratio.
+ """
+ label_size = self.pageContent.imageLabel.size()
+ scaled_image = self.image.scaled(label_size, Qt.KeepAspectRatio)
+ self.pageContent.imageLabel.setPixmap(scaled_image)
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
<item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
+ <widget class="QLabel" name="imageLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="imageLabel">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>115</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="../bertos.qrc">:/images/logo.png</pixmap>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../bertos.qrc">:/images/logo.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
</item>
<item>
<widget class="QLabel" name="introLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>429</width>
+ <height>200</height>
+ </size>
+ </property>
<property name="text">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>39</height>
+ <height>10</height>
</size>
</property>
</spacer>