3 * \file InsetParamsWidget.cpp
\r
4 * This file is part of LyX, the document processor.
\r
5 * Licence details can be found in the file COPYING.
\r
7 * \author Abdelrazak Younes
\r
9 * Full author contact details are available in file CREDITS.
\r
14 #include "InsetParamsWidget.h"
\r
16 #include "insets/InsetCommand.h"
\r
18 #include "qt_helpers.h"
\r
20 #include <QLineEdit>
\r
24 namespace frontend {
\r
26 CheckedWidget::CheckedWidget(QLineEdit * input, QWidget * label)
\r
27 : input_(input), label_(label)
\r
32 bool CheckedWidget::check() const
\r
34 bool const valid = input_->hasAcceptableInput();
\r
36 setValid(input_, valid);
\r
38 setValid(label_, valid);
\r
44 InsetParamsWidget::InsetParamsWidget(QWidget * parent) : QWidget(parent)
\r
49 void InsetParamsWidget::addCheckedWidget(QLineEdit * input, QWidget * label)
\r
51 checked_widgets_.append(CheckedWidget(input, label));
\r
55 bool InsetParamsWidget::checkWidgets() const
\r
58 Q_FOREACH(CheckedWidget const & le, checked_widgets_)
\r
59 valid &= le.check();
\r
64 bool InsetParamsWidget::initialiseParams(std::string const & data)
\r
66 InsetCommandParams p(insetCode());
\r
67 if (!InsetCommand::string2params(data, p))
\r
73 } // namespace frontend
\r
76 #include "moc_InsetParamsWidget.cpp"
\r