QWidget* QtnPropertyDelegateQStringFile::createValueEditorImpl(QWidget* parent, const QRect& rect, QtnInplaceInfo* inplaceInfo) { QtnLineEditBttn* editor = new QtnLineEditBttn(parent); editor->setGeometry(rect); auto handler = new QtnPropertyQStringFileLineEditBttnHandler(owner(), *editor); handler->applyAttributes(m_editorAttributes); qtnInitLineEdit(editor->lineEdit, inplaceInfo); return editor; }
QWidget* QtnPropertyDelegateQFont::createValueEditorImpl(QWidget* parent, const QRect& rect, QtnInplaceInfo* inplaceInfo) { QtnLineEditBttn* editor = new QtnLineEditBttn(parent); editor->setGeometry(rect); new QtnPropertyQFontLineEditBttnHandler(owner(), *editor); if (inplaceInfo) { editor->lineEdit->selectAll(); } return editor; }
QtnPropertyQStringFileLineEditBttnHandler(QtnPropertyQStringBase& property, QtnLineEditBttn& editor) : QtnPropertyEditorHandlerType(property, editor), m_dlg(&editor) { //editor.lineEdit->setReadOnly(true); if (!property.isEditableByUser()) { editor.lineEdit->setReadOnly(true); editor.toolButton->setEnabled(false); } updateEditor(); editor.installEventFilter(this); QObject::connect( editor.toolButton, &QToolButton::clicked , this, &QtnPropertyQStringFileLineEditBttnHandler::onToolButtonClicked); QObject::connect( editor.lineEdit, &QLineEdit::editingFinished , this, &QtnPropertyQStringFileLineEditBttnHandler::onEditingFinished); }