[vlmc-devel] commit: EffectStack: Improving the layout. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Aug 31 00:12:15 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Aug 30 01:07:09 2010 +0200| [3c584d0b32072ebc175701f5dd096cd70ac77773] | committer: Hugo Beauzée-Luyssen 

EffectStack: Improving the layout.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=3c584d0b32072ebc175701f5dd096cd70ac77773
---

 src/Gui/effectsengine/EffectInstanceListModel.cpp |   11 +++++++++++
 src/Gui/effectsengine/ui/EffectInstanceWidget.ui  |   17 +++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/Gui/effectsengine/EffectInstanceListModel.cpp b/src/Gui/effectsengine/EffectInstanceListModel.cpp
index 5a24e06..81307d0 100644
--- a/src/Gui/effectsengine/EffectInstanceListModel.cpp
+++ b/src/Gui/effectsengine/EffectInstanceListModel.cpp
@@ -23,6 +23,11 @@
 #include "EffectInstanceListModel.h"
 #include "EffectInstance.h"
 
+#include <QApplication>
+#include <QFontMetrics>
+
+#include <QtDebug>
+
 EffectInstanceListModel::EffectInstanceListModel( EffectsEngine::EffectList *list ) :
         m_list( list )
 {
@@ -45,6 +50,12 @@ EffectInstanceListModel::data( const QModelIndex &index, int role ) const
         return m_list->at( index.row() )->effect->effect()->description();
     case Qt::EditRole:
         return QVariant::fromValue( m_list->at( index.row() ) );
+    case Qt::SizeHintRole:
+        {
+            const QFontMetrics  &fm = QApplication::fontMetrics();
+            QSize               size( fm.width( m_list->at( index.row() )->effect->effect()->name() ), fm.height() );
+            return size;
+        }
     default:
         return QVariant();
     }
diff --git a/src/Gui/effectsengine/ui/EffectInstanceWidget.ui b/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
index b74340a..f1af2d3 100644
--- a/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
+++ b/src/Gui/effectsengine/ui/EffectInstanceWidget.ui
@@ -54,7 +54,7 @@
        </widget>
       </item>
       <item row="0" column="3">
-       <widget class="QLabel" name="authorValueLabel">
+       <widget class="ExtendedLabel" name="authorValueLabel">
         <property name="text">
          <string/>
         </property>
@@ -122,7 +122,7 @@
          <string/>
         </property>
         <property name="wordWrap">
-         <bool>false</bool>
+         <bool>true</bool>
         </property>
        </widget>
       </item>
@@ -159,6 +159,12 @@
         <height>147</height>
        </rect>
       </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
         <layout class="QFormLayout" name="settingsLayout"/>
@@ -200,6 +206,13 @@
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ExtendedLabel</class>
+   <extends>QLabel</extends>
+   <header>ExtendedLabel.h</header>
+  </customwidget>
+ </customwidgets>
  <resources>
   <include location="../../../../resources.qrc"/>
  </resources>



More information about the Vlmc-devel mailing list