bool DesignDocument::isUndoAvailable() const { if (plainTextEdit()) return plainTextEdit()->document()->isUndoAvailable(); return false; }
QPoint QAccessiblePlainTextEdit::scrollBarPosition() const { QPoint result; result.setX(plainTextEdit()->horizontalScrollBar() ? plainTextEdit()->horizontalScrollBar()->sliderPosition() : 0); result.setY(plainTextEdit()->verticalScrollBar() ? plainTextEdit()->verticalScrollBar()->sliderPosition() : 0); return result; }
void QAccessiblePlainTextEdit::setText(QAccessible::Text t, const QString &text) { if (t != QAccessible::Value) { QAccessibleWidget::setText(t, text); return; } if (plainTextEdit()->isReadOnly()) return; plainTextEdit()->setPlainText(text); }
QString QAccessiblePlainTextEdit::text(QAccessible::Text t) const { if (t == QAccessible::Value) return plainTextEdit()->toPlainText(); return QAccessibleWidget::text(t); }
QAccessible::State QAccessiblePlainTextEdit::state() const { QAccessible::State st = QAccessibleTextWidget::state(); if (plainTextEdit()->isReadOnly()) st.readOnly = true; else st.editable = true; return st; }
void DesignDocument::loadDocument(QPlainTextEdit *edit) { Q_CHECK_PTR(edit); connect(edit, SIGNAL(undoAvailable(bool)), this, SIGNAL(undoAvailable(bool))); connect(edit, SIGNAL(redoAvailable(bool)), this, SIGNAL(redoAvailable(bool))); connect(edit, SIGNAL(modificationChanged(bool)), this, SIGNAL(dirtyStateChanged(bool))); m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::BaseTextEditorWidget*>(plainTextEdit()))); m_inFileComponentTextModifier.reset(); updateFileName(QString(), fileName()); m_subComponentManager->update(QUrl::fromLocalFile(fileName()), currentModel()->imports()); m_documentLoaded = true; }
QWidget* QAccessiblePlainTextEdit::viewport() const { return plainTextEdit()->viewport(); }
QTextDocument* QAccessiblePlainTextEdit::textDocument() const { return plainTextEdit()->document(); }
void QAccessiblePlainTextEdit::setTextCursor(const QTextCursor &textCursor) { plainTextEdit()->setTextCursor(textCursor); }
QTextCursor QAccessiblePlainTextEdit::textCursor() const { return plainTextEdit()->textCursor(); }