Plasma
Go to the documentation of this file.
22 #include <QGraphicsSceneContextMenuEvent>
26 #include <QGraphicsView>
28 #include <kmimetype.h>
29 #include <ktextedit.h>
32 #include "private/style_p.h"
33 #include "private/themedwidgetinterface_p.h"
40 class TextEditPrivate :
public ThemedWidgetInterface<TextEdit>
43 TextEditPrivate(TextEdit *textEdit)
44 : ThemedWidgetInterface<TextEdit>(textEdit)
52 Plasma::Style::Ptr style;
57 d(new TextEditPrivate(this))
60 d->style = Plasma::Style::sharedStyle();
67 Plasma::Style::doneWithSharedStyle();
77 return static_cast<KTextEdit*
>(widget())->toHtml();
87 return static_cast<KTextEdit*
>(widget())->
isReadOnly();
92 widget()->setStyleSheet(stylesheet);
97 return widget()->styleSheet();
103 widget()->deleteLater();
116 nativeWidget->verticalScrollBar()->setStyle(d->style.data());
117 nativeWidget->horizontalScrollBar()->setStyle(d->style.data());
122 return static_cast<KTextEdit*
>(widget());
137 foreach (
const QVariant &v, data) {
138 if (v.canConvert(QVariant::String)) {
139 te->append(v.toString() +
'\n');
147 popup->exec(event->screenPos());
153 QGraphicsProxyWidget::resizeEvent(event);
158 d->changeEvent(event);
159 QGraphicsProxyWidget::changeEvent(event);
167 while (!applet && widget) {
168 widget = widget->parentWidget();
169 applet = qobject_cast<Plasma::Applet *>(widget);
175 QGraphicsProxyWidget::mousePressEvent(event);
183 while (!applet && widget) {
184 widget = widget->parentWidget();
185 applet = qobject_cast<Plasma::Applet *>(widget);
192 QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
194 if (
QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
195 if (view->scene() && view->scene() == scene()) {
196 QApplication::sendEvent(view, &closeEvent);
201 QGraphicsProxyWidget::focusOutEvent(event);
206 #include <textedit.moc>
void changeEvent(QEvent *event)
QHash< QString, QVariant > Data
Namespace for everything in libplasma.
TextEdit(QGraphicsWidget *parent=0)
void mousePressEvent(QGraphicsSceneMouseEvent *event)
void resizeEvent(QGraphicsSceneResizeEvent *event)
void setStyleSheet(const QString &stylesheet)
Sets the stylesheet used to control the visual display of this TextEdit.
void setText(const QString &text)
Sets the display text for this TextEdit.
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void setReadOnly(bool readOnly)
Sets the text area to be read only or interactive.
void append(const QString &text)
Allows appending text to the text browser.
QGraphicsWidget * parentWidget
void focusOutEvent(QFocusEvent *event)
void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data)
void setStatus(const ItemStatus stat)
sets the status for this applet
@ UnknownStatus
The status is unknown.
@ AcceptingInputStatus
The Item is accepting input.
void setNativeWidget(KTextEdit *nativeWidget)
Sets the text edit wrapped by this TextEdit (widget must inherit KTextEdit), ownership is transferred...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by
doxygen 1.8.20 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.