show subfile descriptions in the object list

Sat, 31 Mar 2018 21:23:22 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 31 Mar 2018 21:23:22 +0300
changeset 1365
3f917410e977
parent 1364
f6a3640b1818
child 1367
0aab8d972cf6

show subfile descriptions in the object list

src/mainwindow.ui file | annotate | diff | comparison | revisions
src/model.cpp file | annotate | diff | comparison | revisions
--- a/src/mainwindow.ui	Fri Mar 30 14:30:51 2018 +0300
+++ b/src/mainwindow.ui	Sat Mar 31 21:23:22 2018 +0300
@@ -47,8 +47,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>871</width>
-          <height>364</height>
+          <width>98</width>
+          <height>28</height>
          </rect>
         </property>
         <attribute name="label">
@@ -70,8 +70,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>871</width>
-          <height>364</height>
+          <width>926</width>
+          <height>389</height>
          </rect>
         </property>
         <attribute name="label">
@@ -86,6 +86,9 @@
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
+           <property name="alternatingRowColors">
+            <bool>true</bool>
+           </property>
            <property name="selectionMode">
             <enum>QAbstractItemView::ExtendedSelection</enum>
            </property>
@@ -98,8 +101,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>871</width>
-          <height>364</height>
+          <width>227</width>
+          <height>126</height>
          </rect>
         </property>
         <attribute name="label">
@@ -202,8 +205,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>871</width>
-          <height>364</height>
+          <width>98</width>
+          <height>93</height>
          </rect>
         </property>
         <attribute name="label">
@@ -236,7 +239,7 @@
      <x>0</x>
      <y>0</y>
      <width>1010</width>
-     <height>31</height>
+     <height>26</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuFile">
@@ -1766,7 +1769,6 @@
  </customwidgets>
  <resources>
   <include location="../ldforge.qrc"/>
-  <include location="../ldforge.qrc"/>
  </resources>
  <connections/>
 </ui>
--- a/src/model.cpp	Fri Mar 30 14:30:51 2018 +0300
+++ b/src/model.cpp	Sat Mar 31 21:23:22 2018 +0300
@@ -21,6 +21,7 @@
 #include "documentmanager.h"
 #include "generics/migrate.h"
 #include "editHistory.h"
+#include "lddocument.h"
 
 Model::Model(DocumentManager* manager) :
 	QAbstractListModel {manager},
@@ -311,6 +312,14 @@
 			if (object->isInverted())
 				result.prepend("↺ ");
 
+			if (object->type() == LDObjectType::SubfileReference)
+			{
+				LDSubfileReference* reference = static_cast<LDSubfileReference*>(object);
+				LDDocument* subfile = reference->fileInfo(this->documentManager());
+				if (subfile != nullptr)
+					result.prepend(subfile->header.description + "\n");
+			}
+
 			return result;
 		}
 

mercurial