Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
textedit.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include "textedit.h"
5#include <QtGui>
6
8 : QTextEdit(parent)
9{
10}
11
14{
15 if (source->hasImage())
16 return true;
17 else
19}
21
24{
25 if (source->hasImage())
26 {
27 QImage image = qvariant_cast<QImage>(source->imageData());
31 cursor.insertImage("image");
32 }
33}
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore
Definition qmimedata.h:16
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
\reentrant \inmodule QtGui
void addResource(int type, const QUrl &name, const QVariant &resource)
Adds the resource resource to the resource cache, using type and name as identifiers.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
Definition qtextedit.h:27
QTextCursor textCursor() const
Returns a copy of the QTextCursor that represents the currently visible cursor.
virtual bool canInsertFromMimeData(const QMimeData *source) const
This function returns true if the contents of the MIME data object, specified by source,...
QTextDocument * document
the underlying document of the text editor.
Definition qtextedit.h:51
\inmodule QtCore
Definition qurl.h:94
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void insertFromMimeData(const QMimeData *source) override
[0]
Definition textedit.cpp:23
TextEdit(QWidget *parent=nullptr)
Definition textedit.cpp:7
bool canInsertFromMimeData(const QMimeData *source) const override
[0]
Definition textedit.cpp:13
QCursor cursor
Definition image.cpp:4
GLsizei GLsizei GLchar * source