61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#include "LineEditDialog.h"
|
|
#include "ui_LineEditDialog.h"
|
|
|
|
LineEditDialog::LineEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::LineEditDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
setModal(true);
|
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
|
setWindowFlags(Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);
|
|
#endif
|
|
setFixedSize(this->size()); //fixed size
|
|
setModal(true); //modal window
|
|
ui->checkBox->hide();
|
|
bChecked = false;
|
|
}
|
|
|
|
LineEditDialog::~LineEditDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void LineEditDialog::setCursorPosition(int position)
|
|
{
|
|
ui->textEdit->setCursorPosition(position);
|
|
}
|
|
|
|
void LineEditDialog::setText(const QString & text)
|
|
{
|
|
ui->textEdit->setText(text);
|
|
ui->textEdit->selectAll();
|
|
}
|
|
|
|
void LineEditDialog::enableCheckBox(bool bEnable)
|
|
{
|
|
if(bEnable)
|
|
ui->checkBox->show();
|
|
else
|
|
ui->checkBox->hide();
|
|
}
|
|
|
|
void LineEditDialog::setCheckBox(bool bSet)
|
|
{
|
|
ui->checkBox->setChecked(bSet);
|
|
bChecked = bSet;
|
|
}
|
|
|
|
void LineEditDialog::setCheckBoxText(const QString & text)
|
|
{
|
|
ui->checkBox->setText(text);
|
|
}
|
|
|
|
void LineEditDialog::on_textEdit_textChanged(const QString & arg1)
|
|
{
|
|
editText = arg1;
|
|
}
|
|
|
|
void LineEditDialog::on_checkBox_toggled(bool checked)
|
|
{
|
|
bChecked = checked;
|
|
}
|