- commit work done on inspector experimental

Thu, 06 Nov 2014 15:42:38 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Thu, 06 Nov 2014 15:42:38 +0200
branch
experimental
changeset 913
d93a42b07e28
parent 912
3feb4d20092d
child 1355
f44dcff5e0f7

- commit work done on inspector

src/inspector.cpp file | annotate | diff | comparison | revisions
src/inspector.h file | annotate | diff | comparison | revisions
src/ldDocument.cc file | annotate | diff | comparison | revisions
src/ldDocument.h file | annotate | diff | comparison | revisions
ui/inspector.ui file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/inspector.cpp	Thu Nov 06 15:42:38 2014 +0200
@@ -0,0 +1,24 @@
+#include "inspector.h"
+
+static void SortComboBox 
+
+ObjectInspector::ObjectInspector (QWidget* parent = null, Qt::WindowFlags f) :
+	m_ui (new Ui_ObjectInspector)
+{
+	populate();
+}
+
+ObjectInspector::~ObjectInspector()
+{
+	delete m_ui;
+}
+
+void ObjectInspector::populate()
+{
+	for (LDDocumentPtr& doc : LDDocument::AllDocuments())
+	{
+		int idx = m_ui->documentFilter->size();
+		m_ui->documentFilter->
+		m_ui->documentFilter->setItemData (idx, void* (doc));
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/inspector.h	Thu Nov 06 15:42:38 2014 +0200
@@ -0,0 +1,21 @@
+#pragma once
+#include "basics.h"
+#include <QDialog>
+
+class Ui_ObjectInspector;
+
+class ObjectInspector : QDialog
+{
+	Q_OBJECT
+
+public:
+	explicit ObjectInspector (QWidget* parent = null, Qt::WindowFlags f = 0);
+	virtual ~ObjectInspector();
+
+	void populate();
+
+private:
+	LDDocumentPtr		m_selectedFilter;
+	LDObjectPtr			m_selectedObject;
+	Ui_ObjectInspector* m_ui;
+}
\ No newline at end of file
--- a/src/ldDocument.cc	Thu Nov 06 15:44:11 2014 +0200
+++ b/src/ldDocument.cc	Thu Nov 06 15:42:38 2014 +0200
@@ -214,6 +214,13 @@
 
 // =============================================================================
 //
+QList<LDDocumentPtr> const& LDDocument::AllDocuments()
+{
+	return g_allDocuments;
+}
+
+// =============================================================================
+//
 LDDocumentPtr FindDocument (QString name)
 {
 	for (LDDocumentWeakPtr weakfile : g_allDocuments)
--- a/src/ldDocument.h	Thu Nov 06 15:44:11 2014 +0200
+++ b/src/ldDocument.h	Thu Nov 06 15:42:38 2014 +0200
@@ -155,6 +155,7 @@
 	// Turns a full path into a relative path
 	static QString shortenName (QString a);
 	static QList<LDDocumentPtr> const& explicitDocuments();
+	static QList<LDDocumentPtr> const& AllDocuments();
 	void mergeVertices();
 
 protected:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/inspector.ui	Thu Nov 06 15:42:38 2014 +0200
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ObjectInspector</class>
+ <widget class="QDialog" name="ObjectInspector">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>818</width>
+    <height>536</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Object inspector</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string>Filter:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="documentFilter">
+       <item>
+        <property name="text">
+         <string>(all documents)</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QTableWidget" name="objectTable">
+     <attribute name="horizontalHeaderStretchLastSection">
+      <bool>true</bool>
+     </attribute>
+     <column>
+      <property name="text">
+       <string>ID</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Document</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Line</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Winding</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Code</string>
+      </property>
+     </column>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Close</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>ObjectInspector</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>ObjectInspector</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

mercurial