mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 18:40:16 +00:00
37 lines
773 B
C++
37 lines
773 B
C++
#include "lineedit_ui.hpp"
|
|
|
|
LineEditUi::LineEditUi(QLineEdit *line, Settings *settings, const std::string &opt) :
|
|
TextOptUi(settings, opt),
|
|
line(line)
|
|
{
|
|
updateUiState();
|
|
connectSignals();
|
|
}
|
|
|
|
void LineEditUi::connectSignals(){
|
|
connect(line, &QLineEdit::textEdited, this, &LineEditUi::textEdited);
|
|
}
|
|
|
|
void LineEditUi::updateUiState(const std::string &text){
|
|
if(!line->hasFocus())
|
|
line->setText(QString::fromStdString(text));
|
|
}
|
|
|
|
void LineEditUi::updateUiState(){
|
|
updateUiState(getOptValue());
|
|
}
|
|
|
|
void LineEditUi::setEnabled(bool enabled){
|
|
line->setEnabled(enabled);
|
|
}
|
|
|
|
void LineEditUi::setToolTip(const QString& toolTip){
|
|
line->setToolTip(toolTip);
|
|
}
|
|
|
|
void LineEditUi::setPlaceholder(const QString& placeholder){
|
|
line->setPlaceholderText(placeholder);
|
|
}
|
|
|
|
|