mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-15 15:45:43 +00:00
c293be56bd
In particular, the directory frontends/qt4 is renamed to frontends/qt. Many configurations file have to be updated. All mentions of qt4 in the source have been audited, and changed to qt if necessary. The only part that has not been updated is the CMake build system.
69 lines
1.2 KiB
C++
69 lines
1.2 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file InsetParamsWidget.cpp
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "InsetParamsWidget.h"
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
#include <QLineEdit>
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
CheckedWidget::CheckedWidget(QLineEdit * input, QWidget * label)
|
|
: input_(input), label_(label)
|
|
{
|
|
}
|
|
|
|
|
|
bool CheckedWidget::check() const
|
|
{
|
|
// Ignore if widget is disabled.
|
|
if (!input_->isEnabled())
|
|
return true;
|
|
|
|
bool const valid = input_->hasAcceptableInput();
|
|
// Visual feedback.
|
|
setValid(input_, valid);
|
|
if (label_)
|
|
setValid(label_, valid);
|
|
return valid;
|
|
}
|
|
|
|
|
|
|
|
InsetParamsWidget::InsetParamsWidget(QWidget * parent) : QWidget(parent)
|
|
{
|
|
}
|
|
|
|
|
|
void InsetParamsWidget::addCheckedWidget(QLineEdit * input, QWidget * label)
|
|
{
|
|
checked_widgets_.append(CheckedWidget(input, label));
|
|
}
|
|
|
|
|
|
bool InsetParamsWidget::checkWidgets(bool) const
|
|
{
|
|
bool valid = true;
|
|
Q_FOREACH(CheckedWidget const & le, checked_widgets_)
|
|
valid &= le.check();
|
|
return valid;
|
|
}
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#include "moc_InsetParamsWidget.cpp"
|