+ fixes #0001484: Do not sort properties in alphabetical order
This commit is contained in:
@@ -89,7 +89,7 @@ void PropertyEditor::commitData (QWidget * editor)
|
||||
committing = false;
|
||||
if (delaybuild) {
|
||||
delaybuild = false;
|
||||
propertyModel->buildUp(std::map<std::string, std::vector<App::Property*> >());
|
||||
propertyModel->buildUp(PropertyModel::PropertyList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void PropertyEditor::drawBranches(QPainter *painter, const QRect &rect, const QM
|
||||
//painter->setPen(savedPen);
|
||||
}
|
||||
|
||||
void PropertyEditor::buildUp(const std::map<std::string, std::vector<App::Property*> >& props)
|
||||
void PropertyEditor::buildUp(const PropertyModel::PropertyList& props)
|
||||
{
|
||||
if (committing) {
|
||||
Base::Console().Warning("While committing the data to the property the selection has changed.\n");
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <QTreeView>
|
||||
|
||||
#include "PropertyItem.h"
|
||||
#include "PropertyModel.h"
|
||||
|
||||
namespace App {
|
||||
class Property;
|
||||
@@ -49,7 +50,7 @@ public:
|
||||
~PropertyEditor();
|
||||
|
||||
/** Builds up the list view with the properties. */
|
||||
void buildUp(const std::map<std::string, std::vector<App::Property*> >& props);
|
||||
void buildUp(const PropertyModel::PropertyList& props);
|
||||
void setAutomaticDocumentUpdate(bool);
|
||||
bool isAutomaticDocumentUpdate(bool) const;
|
||||
|
||||
|
||||
@@ -199,15 +199,14 @@ QModelIndex PropertyModel::propertyIndexFromPath(const QStringList& path) const
|
||||
return parent;
|
||||
}
|
||||
|
||||
void PropertyModel::buildUp(const std::map<std::string, std::vector<App::Property*> >& props)
|
||||
void PropertyModel::buildUp(const PropertyModel::PropertyList& props)
|
||||
{
|
||||
// fill up the listview with the properties
|
||||
rootItem->reset();
|
||||
|
||||
// sort the properties into their groups
|
||||
std::map<std::string, std::vector<std::vector<App::Property*> > > propGroup;
|
||||
std::map<std::string, std::vector<App::Property*> >
|
||||
::const_iterator jt;
|
||||
PropertyModel::PropertyList::const_iterator jt;
|
||||
for (jt = props.begin(); jt != props.end(); ++jt) {
|
||||
App::Property* prop = jt->second.front();
|
||||
const char* group = prop->getGroup();
|
||||
|
||||
@@ -41,6 +41,8 @@ class PropertyModel : public QAbstractItemModel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef std::vector< std::pair< std::string, std::vector<App::Property*> > > PropertyList;
|
||||
|
||||
PropertyModel(QObject* parent);
|
||||
virtual ~PropertyModel();
|
||||
|
||||
@@ -54,7 +56,7 @@ public:
|
||||
int rowCount (const QModelIndex & parent = QModelIndex()) const;
|
||||
QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
bool setHeaderData (int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole);
|
||||
void buildUp(const std::map<std::string, std::vector<App::Property*> >& props);
|
||||
void buildUp(const PropertyList& props);
|
||||
QStringList propertyPathFromIndex(const QModelIndex&) const;
|
||||
QModelIndex propertyIndexFromPath(const QStringList&) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user