Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
textedit_taskmenu.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
include
"textedit_taskmenu.h"
5
6
#
include
<
QtDesigner
/
abstractformwindow
.
h
>
7
8
#
include
<
QtGui
/
qaction
.
h
>
9
10
#
include
<
QtCore
/
qcoreevent
.
h
>
11
#
include
<
QtCore
/
qdebug
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
using
namespace
Qt::StringLiterals;
16
17
namespace
qdesigner_internal
{
18
19
TextEditTaskMenu
::
TextEditTaskMenu
(QTextEdit *textEdit, QObject *parent) :
20
QDesignerTaskMenu
(
textEdit
,
parent
),
21
m_format
(
Qt
::
RichText
),
22
m_property
(u"html"_s),
23
m_windowTitle
(
tr
(
"Edit HTML"
)),
24
m_editTextAction
(
new
QAction
(
tr
(
"Change HTML..."
),
this
))
25
{
26
initialize();
27
}
28
29
TextEditTaskMenu
::
TextEditTaskMenu
(QPlainTextEdit *textEdit, QObject *parent) :
30
QDesignerTaskMenu
(
textEdit
,
parent
),
31
m_format
(
Qt
::
PlainText
),
32
m_property
(u"plainText"_s),
33
m_windowTitle
(
tr
(
"Edit Text"
)),
34
m_editTextAction
(
new
QAction
(
tr
(
"Change Plain Text..."
),
this
))
35
{
36
initialize();
37
}
38
39
40
void
TextEditTaskMenu
::initialize()
41
{
42
connect(m_editTextAction, &QAction::triggered,
this
, &TextEditTaskMenu::editText);
43
m_taskActions.append(m_editTextAction);
44
45
QAction *sep =
new
QAction(
this
);
46
sep->setSeparator(
true
);
47
m_taskActions.append(sep);
48
}
49
50
TextEditTaskMenu
::~
TextEditTaskMenu
() =
default
;
51
52
QAction
*
TextEditTaskMenu
::
preferredEditAction
()
const
53
{
54
return
m_editTextAction;
55
}
56
57
QList
<
QAction
*>
TextEditTaskMenu
::
taskActions
()
const
58
{
59
return
m_taskActions + QDesignerTaskMenu::taskActions();
60
}
61
62
void
TextEditTaskMenu
::editText()
63
{
64
changeTextProperty(m_property, m_windowTitle, MultiSelectionMode, m_format);
65
}
66
67
}
68
QT_END_NAMESPACE
qdesigner_internal::TextEditTaskMenu
Definition
textedit_taskmenu.h:20
qdesigner_internal::TextEditTaskMenu::preferredEditAction
QAction * preferredEditAction() const override
Definition
textedit_taskmenu.cpp:52
qdesigner_internal::TextEditTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
textedit_taskmenu.cpp:57
qdesigner_internal::TextEditTaskMenu::~TextEditTaskMenu
~TextEditTaskMenu() override
qdesigner_internal::TextEditTaskMenu::TextEditTaskMenu
TextEditTaskMenu(QPlainTextEdit *button, QObject *parent=nullptr)
Definition
textedit_taskmenu.cpp:29
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:66
qttools
src
designer
src
components
taskmenu
textedit_taskmenu.cpp
Generated on Sat Sep 21 2024 00:50:27 for Qt by
1.12.0