summaryrefslogtreecommitdiffstats
path: root/utils/regtools
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools')
-rw-r--r--utils/regtools/qeditor/utils.cpp94
-rw-r--r--utils/regtools/qeditor/utils.h24
2 files changed, 0 insertions, 118 deletions
diff --git a/utils/regtools/qeditor/utils.cpp b/utils/regtools/qeditor/utils.cpp
index 1e39903a2c..098a020c8e 100644
--- a/utils/regtools/qeditor/utils.cpp
+++ b/utils/regtools/qeditor/utils.cpp
@@ -746,100 +746,6 @@ bool MyTextEditor::IsModified()
}
/**
- * MySwitchableTextEditor
- */
-MySwitchableTextEditor::MySwitchableTextEditor(QWidget *parent)
- :QWidget(parent)
-{
- QVBoxLayout *layout = new QVBoxLayout(this);
- m_edit = new MyTextEditor(this);
- m_label = new QLabel(this);
- m_label->setTextFormat(Qt::RichText);
- m_label->setAlignment(Qt::AlignTop);
- m_line = new QLineEdit(this);
-
- layout->addWidget(m_label);
- layout->addWidget(m_edit);
- layout->addWidget(m_line);
-
- setLayout(layout);
-
- m_editor_mode = false;
- m_line_mode = false;
- UpdateVisibility();
-}
-
-void MySwitchableTextEditor::SetEditorMode(bool edit)
-{
- if(edit == m_editor_mode)
- return;
- QString text = GetTextHtml();
- m_editor_mode = edit;
- UpdateVisibility();
- SetTextHtml(text);
-}
-
-QString MySwitchableTextEditor::GetTextHtml()
-{
- if(m_editor_mode)
- return m_line_mode ? m_line->text() : m_edit->GetTextHtml();
- else
- return m_label->text();
-}
-
-void MySwitchableTextEditor::SetTextHtml(const QString& text)
-{
- if(m_editor_mode)
- {
- if(m_line_mode)
- m_line->setText(text);
- else
- m_edit->SetTextHtml(text);
- }
- else
- m_label->setText(text);
-}
-
-MyTextEditor *MySwitchableTextEditor::GetEditor()
-{
- return m_edit;
-}
-
-void MySwitchableTextEditor::SetLineMode(bool en)
-{
- if(m_line_mode == en)
- return;
- QString text = GetTextHtml();
- m_line_mode = en;
- SetTextHtml(text);
- UpdateVisibility();
-}
-
-QLineEdit *MySwitchableTextEditor::GetLineEdit()
-{
- return m_line;
-}
-
-void MySwitchableTextEditor::UpdateVisibility()
-{
- m_label->setVisible(!m_editor_mode);
- m_edit->setVisible(m_editor_mode && !m_line_mode);
- m_line->setVisible(m_editor_mode && m_line_mode);
-}
-
-QLabel *MySwitchableTextEditor::GetLabel()
-{
- return m_label;
-}
-
-bool MySwitchableTextEditor::IsModified()
-{
- if(!m_editor_mode)
- return false;
- return m_line_mode ? m_line->isModified() : m_edit->IsModified();
-}
-
-/**
* BackendSelector
*/
BackendSelector::BackendSelector(Backend *backend, QWidget *parent)
diff --git a/utils/regtools/qeditor/utils.h b/utils/regtools/qeditor/utils.h
index 13b9e896e9..771b671b2c 100644
--- a/utils/regtools/qeditor/utils.h
+++ b/utils/regtools/qeditor/utils.h
@@ -275,30 +275,6 @@ protected:
QToolButton *m_underline_button;
};
-class MySwitchableTextEditor : public QWidget
-{
- Q_OBJECT
-public:
- MySwitchableTextEditor(QWidget *parent = 0);
- QString GetTextHtml();
- void SetTextHtml(const QString& text);
- void SetEditorMode(bool en);
- MyTextEditor *GetEditor();
- QLineEdit *GetLineEdit();
- QLabel *GetLabel();
- void SetLineMode(bool en);
- bool IsModified();
-
-protected:
- void UpdateVisibility();
-
- bool m_editor_mode;
- bool m_line_mode;
- QLabel *m_label;
- MyTextEditor *m_edit;
- QLineEdit *m_line;
-};
-
class BackendSelector : public QWidget
{
Q_OBJECT