qse  0.5.4
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
QseRegExpParameterEditor Class Reference

#include <qseregexpparametereditor.h>

Inheritance diagram for QseRegExpParameterEditor:
Inheritance graph

Public Member Functions

 QseRegExpParameterEditor (QseOperatorEditor *ed, QseRegExpParameter *param, QObject *parent=0)
 
void setEditors (QLineEdit *pattern, QCheckBox *useRegExp, QPushButton *apply, QPushButton *cancel, QPushButton *excepts=NULL, QColor fg=Qt::black, QColor bg=Qt::white)
 
virtual bool editorValidate ()
 
virtual void editorApply ()
 
virtual void editorCancel ()
 
- Public Member Functions inherited from QseParameterEditor
 QseParameterEditor (QseOperatorEditor *ed, QseParameter *param, QObject *parent=0)
 
void setEditors (QPushButton *apply, QPushButton *cancel)
 

Protected Attributes

QseRegExpParameterm_RegExpParameter
 
QLineEdit * m_PatternEdit
 
QCheckBox * m_UseRegExp
 
- Protected Attributes inherited from QseParameterEditor
QseOperatorEditorm_OperatorEditor
 
QseParameterm_Parameter
 
QPushButton * m_ApplyButton
 
QPushButton * m_CancelButton
 

Private Member Functions

void setColors (QWidget *w, QColor fg, QColor bg)
 

Additional Inherited Members

- Protected Slots inherited from QseParameterEditor
void editorChanged ()
 

Detailed Description

Definition at line 12 of file qseregexpparametereditor.h.

Constructor & Destructor Documentation

QseRegExpParameterEditor::QseRegExpParameterEditor ( QseOperatorEditor ed,
QseRegExpParameter param,
QObject *  parent = 0 
)

Definition at line 10 of file qseregexpparametereditor.cpp.

11  : QseParameterEditor(ed, param, parent),
12  m_RegExpParameter(param),
13  m_PatternEdit(NULL),
14  m_UseRegExp(NULL)
15 {
16 }
QseRegExpParameter * m_RegExpParameter
QseParameterEditor(QseOperatorEditor *ed, QseParameter *param, QObject *parent=0)

Member Function Documentation

void QseRegExpParameterEditor::editorApply ( )
virtual

Implements QseParameterEditor.

Definition at line 54 of file qseregexpparametereditor.cpp.

References m_PatternEdit, m_RegExpParameter, m_UseRegExp, QseParameter::setValue(), and QseParameter::value().

55 {
56  QRegExp r = m_RegExpParameter->value().toRegExp();
57 
58 // printf("pattern text: %s\n", qPrintable(m_PatternEdit->text()));
59 
60  r.setPatternSyntax(m_UseRegExp->isChecked() ? QRegExp::RegExp : QRegExp::Wildcard);
61  r.setPattern(m_PatternEdit->text());
62 
63 // printf("regexp pattern: %s\n", qPrintable(r.pattern()));
64 
66 
67 // printf("QseRegExpParameterEditor::editorApply: %s = %s\n",
68 // qPrintable(m_RegExpParameter->name()),
69 // qPrintable(m_RegExpParameter->value().toRegExp().pattern()));
70 }
QVariant value() const
QseRegExpParameter * m_RegExpParameter
void setValue(const QVariant &value)
void QseRegExpParameterEditor::editorCancel ( )
virtual

Implements QseParameterEditor.

Definition at line 72 of file qseregexpparametereditor.cpp.

References m_PatternEdit, m_RegExpParameter, m_UseRegExp, and QseParameter::value().

73 {
74  QRegExp r = m_RegExpParameter->value().toRegExp();
75 
76  m_PatternEdit -> setText(r.pattern());
77  m_UseRegExp -> setChecked(r.patternSyntax()==QRegExp::RegExp);
78 }
QVariant value() const
QseRegExpParameter * m_RegExpParameter
bool QseRegExpParameterEditor::editorValidate ( )
virtual

Implements QseParameterEditor.

Definition at line 47 of file qseregexpparametereditor.cpp.

48 {
49 // printf("Need QseRegExpParameterEditor::editorValidate\n");
50 
51  return true;
52 }
void QseRegExpParameterEditor::setColors ( QWidget *  w,
QColor  fg,
QColor  bg 
)
private

Definition at line 35 of file qseregexpparametereditor.cpp.

36 {
37  if (w) {
38  QPalette p = w->palette();
39 
40  p.setColor(QPalette::Base, bg);
41  p.setColor(QPalette::ButtonText, fg);
42 
43  w->setPalette(p);
44  }
45 }
void QseRegExpParameterEditor::setEditors ( QLineEdit *  pattern,
QCheckBox *  useRegExp,
QPushButton *  apply,
QPushButton *  cancel,
QPushButton *  excepts = NULL,
QColor  fg = Qt::black,
QColor  bg = Qt::white 
)

Definition at line 19 of file qseregexpparametereditor.cpp.

References QseParameterEditor::setEditors().

Referenced by QseDataDeglitcherUI::QseDataDeglitcherUI(), and QseEdgeAlignerUI::QseEdgeAlignerUI().

20 {
21  QseParameterEditor::setEditors(apply, cancel);
22 
23  m_PatternEdit = pattern;
24  m_UseRegExp = useRegExp;
25 
26  connect(m_PatternEdit, SIGNAL(textChanged(const QString&)), this, SLOT(editorChanged()));
27  connect(m_UseRegExp, SIGNAL(toggled(bool)), this, SLOT(editorChanged()));
28 
29  setColors(pattern, fg, bg);
30  setColors(excepts, fg, bg);
31 
32  editorCancel();
33 }
void setColors(QWidget *w, QColor fg, QColor bg)
void setEditors(QPushButton *apply, QPushButton *cancel)

Member Data Documentation

QLineEdit* QseRegExpParameterEditor::m_PatternEdit
protected

Definition at line 37 of file qseregexpparametereditor.h.

Referenced by editorApply(), and editorCancel().

QseRegExpParameter* QseRegExpParameterEditor::m_RegExpParameter
protected

Definition at line 36 of file qseregexpparametereditor.h.

Referenced by editorApply(), and editorCancel().

QCheckBox* QseRegExpParameterEditor::m_UseRegExp
protected

Definition at line 38 of file qseregexpparametereditor.h.

Referenced by editorApply(), and editorCancel().


The documentation for this class was generated from the following files: