ElementWidget: reorganise implementation class declarations

This commit is contained in:
Abdullah Tahiri
2023-03-18 09:18:20 +01:00
committed by abdullahtahiriyo
parent 0b94640128
commit 4e815584c3

View File

@@ -168,6 +168,39 @@ class ElementItem : public QListWidgetItem
const Part::Geometry * geo;
};
class ElementFilterList : public QListWidget
{
Q_OBJECT
public:
explicit ElementFilterList(QWidget* parent = nullptr);
~ElementFilterList() override;
protected:
void changeEvent(QEvent* e) override;
virtual void languageChange();
private:
using filterItemRepr = std::pair<const char *, const int>; // {filter item text, filter item level}
inline static const std::vector<filterItemRepr> filterItems = {
{QT_TR_NOOP("Normal"),0},
{QT_TR_NOOP("Construction"),0},
{QT_TR_NOOP("Internal"),0},
{QT_TR_NOOP("External"),0},
{QT_TR_NOOP("All types"),0},
{QT_TR_NOOP("Point"),1},
{QT_TR_NOOP("Line"),1},
{QT_TR_NOOP("Circle"),1},
{QT_TR_NOOP("Ellipse"),1},
{QT_TR_NOOP("Arc of circle"),1},
{QT_TR_NOOP("Arc of ellipse"),1},
{QT_TR_NOOP("Arc of hyperbola"),1},
{QT_TR_NOOP("Arc of parabola"),1},
{QT_TR_NOOP("B-Spline"),1}
};
};
} // SketcherGui
class ElementWidgetIcons {
@@ -675,40 +708,6 @@ ElementItem* ElementItemDelegate::getElementtItem(const QModelIndex& index) cons
}
/* Filter element list widget ------------------------------------------------------ */
namespace SketcherGui {
class ElementFilterList : public QListWidget
{
Q_OBJECT
public:
explicit ElementFilterList(QWidget* parent = nullptr);
~ElementFilterList() override;
protected:
void changeEvent(QEvent* e) override;
virtual void languageChange();
private:
using filterItemRepr = std::pair<const char *, const int>; // {filter item text, filter item level}
inline static const std::vector<filterItemRepr> filterItems = {
{QT_TR_NOOP("Normal"),0},
{QT_TR_NOOP("Construction"),0},
{QT_TR_NOOP("Internal"),0},
{QT_TR_NOOP("External"),0},
{QT_TR_NOOP("All types"),0},
{QT_TR_NOOP("Point"),1},
{QT_TR_NOOP("Line"),1},
{QT_TR_NOOP("Circle"),1},
{QT_TR_NOOP("Ellipse"),1},
{QT_TR_NOOP("Arc of circle"),1},
{QT_TR_NOOP("Arc of ellipse"),1},
{QT_TR_NOOP("Arc of hyperbola"),1},
{QT_TR_NOOP("Arc of parabola"),1},
{QT_TR_NOOP("B-Spline"),1}
};
};
}
enum class GeoFilterType {
NormalGeos,