Gui: Improve presenting VarSets in expr dialog
This commit is contained in:
@@ -25,11 +25,14 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <App/ObjectIdentifier.h>
|
||||
#include <Base/Type.h>
|
||||
#include <Base/Unit.h>
|
||||
#include <memory>
|
||||
|
||||
#include "Dialogs/DlgAddPropertyVarSet.h"
|
||||
|
||||
namespace Ui {
|
||||
class DlgExpressionInput;
|
||||
}
|
||||
@@ -44,9 +47,7 @@ class Expression;
|
||||
class DocumentObject;
|
||||
}
|
||||
|
||||
namespace Gui {
|
||||
|
||||
namespace Dialog {
|
||||
namespace Gui::Dialog {
|
||||
|
||||
class GuiExport NumberRange
|
||||
{
|
||||
@@ -83,8 +84,8 @@ public Q_SLOTS:
|
||||
void accept() override;
|
||||
|
||||
protected:
|
||||
void mouseReleaseEvent(QMouseEvent*) override;
|
||||
void mousePressEvent(QMouseEvent*) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
|
||||
private:
|
||||
Base::Type getTypePath();
|
||||
@@ -92,10 +93,14 @@ private:
|
||||
bool typeOkForVarSet();
|
||||
void initializeVarSets();
|
||||
void checkExpression(const QString& text);
|
||||
int getVarSetIndex(const App::Document* doc) const;
|
||||
void preselectGroup();
|
||||
void preselectVarSet();
|
||||
QStandardItemModel* createVarSetModel();
|
||||
void setupVarSets();
|
||||
std::string getType();
|
||||
void reportVarSetInfo(const std::string& message);
|
||||
bool reportName(QTreeWidgetItem* item);
|
||||
bool reportName();
|
||||
bool reportGroup(QString& nameGroup);
|
||||
void updateVarSetInfo(bool checkExpr = true);
|
||||
void acceptWithVarSet();
|
||||
@@ -104,7 +109,7 @@ private Q_SLOTS:
|
||||
void textChanged(const QString & text);
|
||||
void setDiscarded();
|
||||
void onCheckVarSets(int state);
|
||||
void onVarSetSelected(int);
|
||||
void onVarSetSelected(int index);
|
||||
void onTextChangedGroup(const QString&);
|
||||
void namePropChanged(const QString&);
|
||||
|
||||
@@ -119,12 +124,13 @@ private:
|
||||
int minimumWidth;
|
||||
|
||||
bool varSetsVisible;
|
||||
std::unique_ptr<QTreeWidget> treeWidget;
|
||||
QPushButton* okBtn = nullptr;
|
||||
QPushButton* discardBtn = nullptr;
|
||||
|
||||
EditFinishedComboBox comboBoxGroup;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // GUI_DIALOG_EXPRESSIONINPUT_H
|
||||
|
||||
Reference in New Issue
Block a user