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
textpropertyeditor_p.h
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// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of Qt Designer. This header
11// file may change from version to version without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef TEXTPROPERTYEDITOR_H
17#define TEXTPROPERTYEDITOR_H
18
20#include "shared_enums_p.h"
21
22#include <QtWidgets/qwidget.h>
23
25
26namespace qdesigner_internal {
27
28 class PropertyLineEdit;
29
30 // Inline-Editor for text properties. Does escaping of newline characters
31 // to '\n' and back and provides validation modes. The interface
32 // corresponds to that of QLineEdit.
34 {
37 public:
39 // Stand-alone widget
41 // Disable frame
43 // For editing in forms
45 };
46
48 // Emit textChanged() as the user types
50 // Emit textChanged() only when the user finishes (for QUrl, etc.)
52 };
53
56
59
62
63 QString text() const;
64
65 QSize sizeHint () const override;
67
69
70 bool hasAcceptableInput() const;
71
72 // installs an event filter object on the private QLineEdit
74
75 // Replace newline characters by literal "\n" for inline editing
76 // in mode ValidationMultiLine
78
79 // Replace literal "\n" by actual new lines in mode ValidationMultiLine
81
82 // Returns whether newline characters are valid in validationMode.
84
85 signals:
86 void textChanged(const QString &text);
88
89 public slots:
90 void setText(const QString &text);
91 void selectAll();
92 void clear();
93
94 protected:
96
97 private slots:
98 void slotTextChanged(const QString &text);
99 void slotTextEdited();
100 void slotEditingFinished();
101
102 private:
105
109
110 // Cached text containing real newline characters.
112 bool m_textEdited = false;
113 };
114}
115
116QT_END_NAMESPACE
117
118#endif // TEXTPROPERTYEDITOR_H
friend class QWidget
Definition qpainter.h:432
ObjectData(QObject *parent, QObject *object, const ModelRecursionContext &ctx)
bool equals(const ObjectData &me) const
void setItemsDisplayData(const StandardItemList &row, const ObjectInspectorIcons &icons, unsigned mask) const
void setItems(const StandardItemList &row, const ObjectInspectorIcons &icons) const
unsigned compare(const ObjectData &me) const
friend bool comparesEqual(const ObjectData &lhs, const ObjectData &rhs) noexcept
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the editor to be used for editing the data item with the given index.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the data stored under the given role for the item referred to by the index.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets the role data for the item at index to value.
UpdateResult update(QDesignerFormWindowInterface *fw)
QObject * objectAt(const QModelIndex &index) const
QModelIndexList indexesOf(QObject *o) const
void mouseMoveEvent(QMouseEvent *event) override
void keyPressEvent(QKeyEvent *event) override
QObjectList indexesToObjects(const QModelIndexList &indexes) const
QWidget * managedWidgetAt(const QPoint &global_mouse_pos)
void slotPopupContextMenu(QWidget *parent, const QPoint &pos)
const QPointer< FormWindowBase > & formWindow() const
void handleDragEnterMoveEvent(const QWidget *objectInspectorWidget, QDragMoveEvent *event, bool isDragEnter)
void slotSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static SelectionType selectionType(const QDesignerFormWindowInterface *fw, QObject *o)
static QPoint dropPointOffset(const qdesigner_internal::FormWindowBase *fw, const QWidget *dropTarget)
#define QDESIGNER_SHARED_EXPORT
QIcon layoutIcons[LayoutInfo::UnknownLayout+1]