Add a layout in the dialog

That way, the dialog, and its content, resizes itself when needed.

+ Capitalize a sentence in the dialog
This commit is contained in:
Laurent Rineau 2013-02-01 09:29:48 +01:00
parent ad7738646d
commit f04cfc327a
2 changed files with 57 additions and 79 deletions

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>353</width>
<height>144</height>
<width>339</width>
<height>105</height>
</rect>
</property>
<property name="sizePolicy">
@ -25,82 +25,60 @@
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>170</x>
<y>80</y>
<width>181</width>
<height>32</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QComboBox" name="pluginBox">
<property name="geometry">
<rect>
<x>30</x>
<y>40</y>
<width>321</width>
<height>31</height>
</rect>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="accessibleName">
<string/>
</property>
</widget>
<widget class="QCheckBox" name="alwaysUse">
<property name="geometry">
<rect>
<x>30</x>
<y>120</y>
<width>281</width>
<height>26</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>0</x>
<y>10</y>
<width>371</width>
<height>21</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="pluginBox">
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="accessibleName">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="alwaysUse">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>

View File

@ -18,7 +18,7 @@ class File_loader_dialog : public QDialog, private Ui::FileLoaderDialog
dialog.pluginBox->addItems(item_list);
dialog.label->setText(tr("Available loaders for %1 :").arg(filename));
QFileInfo fileinfo(filename);
dialog.alwaysUse->setText(tr("use for &all *.%1 files in this session").arg(fileinfo.completeSuffix()) );
dialog.alwaysUse->setText(tr("Use for &all *.%1 files in this session").arg(fileinfo.completeSuffix()) );
*ok = dialog.exec();
return std::make_pair(
dialog.pluginBox->currentText(),