# HG changeset patch # User Teemu Piippo # Date 1415281358 -7200 # Node ID d93a42b07e2829a4a536cc99ea2717e864f448e5 # Parent 3feb4d20092dd97ceb969fce7119a6d59ae6b3c8 - commit work done on inspector diff -r 3feb4d20092d -r d93a42b07e28 src/inspector.cpp --- /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 diff -r 3feb4d20092d -r d93a42b07e28 src/inspector.h --- /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 + +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 diff -r 3feb4d20092d -r d93a42b07e28 src/ldDocument.cc --- 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 const& LDDocument::AllDocuments() +{ + return g_allDocuments; +} + +// ============================================================================= +// LDDocumentPtr FindDocument (QString name) { for (LDDocumentWeakPtr weakfile : g_allDocuments) diff -r 3feb4d20092d -r d93a42b07e28 src/ldDocument.h --- 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 const& explicitDocuments(); + static QList const& AllDocuments(); void mergeVertices(); protected: diff -r 3feb4d20092d -r d93a42b07e28 ui/inspector.ui --- /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 @@ + + + ObjectInspector + + + + 0 + 0 + 818 + 536 + + + + Object inspector + + + + + + + + Filter: + + + + + + + + (all documents) + + + + + + + + + + true + + + + ID + + + + + Document + + + + + Line + + + + + Winding + + + + + Code + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + accepted() + ObjectInspector + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ObjectInspector + reject() + + + 316 + 260 + + + 286 + 274 + + + + +