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
inplace_editor.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#ifndef INPLACE_EDITOR_H
6#define INPLACE_EDITOR_H
7
8#include <textpropertyeditor_p.h>
9#include <shared_enums_p.h>
10
12#include <qdesigner_utils_p.h>
13
14#include <QtCore/qpointer.h>
15
17
18
19class QDesignerFormWindowInterface;
20
21namespace qdesigner_internal {
22
24{
26public:
30 const QString& text,
31 const QRect& r);
32private:
33 InPlaceWidgetHelper m_InPlaceWidgetHelper;
34};
35
36// Base class for inline editor helpers to be embedded into a task menu.
37// Inline-edits a property on a multi-selection.
38// To use it for a particular widget/property, overwrite the method
39// returning the edit area.
40
42{
44
45public slots:
46 void editText();
47
48private slots:
49 void updateText(const QString &text);
50 void updateSelection();
51
52protected:
53 TaskMenuInlineEditor(QWidget *w, TextPropertyValidationMode vm, const QString &property, QObject *parent);
54 // Overwrite to return the area for the inline editor.
55 virtual QRect editRectangle() const = 0;
56 QWidget *widget() const { return m_widget; }
57
58private:
60 const QString m_property;
61 QWidget *m_widget;
62 QPointer<QDesignerFormWindowInterface> m_formWindow;
63 QPointer<InPlaceEditor> m_editor;
64 bool m_managed;
65 qdesigner_internal::PropertySheetStringValue m_value;
66};
67
68} // namespace qdesigner_internal
69
70QT_END_NAMESPACE
71
72#endif // INPLACE_EDITOR_H
void init(const ButtonList &bl, QButtonGroup *group)
void redo() override
Applies a change to the document.
void undo() override
Reverts a change to the document.
AddButtonsToGroupCommand(QDesignerFormWindowInterface *formWindow)
void undo() override
Reverts a change to the document.
void redo() override
Applies a change to the document.
BreakButtonGroupCommand(QDesignerFormWindowInterface *formWindow)
ButtonGroupCommand(const QString &description, QDesignerFormWindowInterface *formWindow)
static ButtonGroupList managedButtonGroups(const QDesignerFormWindowInterface *formWindow)
void initialize(const ButtonList &bl, QButtonGroup *buttonGroup)
static QString nameList(const ButtonList &bl)
void initialize(QDesignerFormWindowInterface *formWindow, QButtonGroup *buttonGroup=nullptr, QAbstractButton *currentButton=nullptr)
QAction * preferredEditAction() const override
QList< QAction * > taskActions() const override
QAction * preferredEditAction() const override
void insertAction(int index, QAction *a)
QList< QAction * > taskActions() const override
ButtonTextTaskMenuInlineEditor(QAbstractButton *button, QObject *parent)
void redo() override
Applies a change to the document.
CreateButtonGroupCommand(QDesignerFormWindowInterface *formWindow)
void undo() override
Reverts a change to the document.
LinkDescriptionTaskMenuInlineEditor(QAbstractButton *button, QObject *parent)
RemoveButtonsFromGroupCommand(QDesignerFormWindowInterface *formWindow)
void undo() override
Reverts a change to the document.
void redo() override
Applies a change to the document.
virtual QRect editRectangle() const =0
TaskMenuInlineEditor(QWidget *w, TextPropertyValidationMode vm, const QString &property, QObject *parent)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static ButtonList buttonList(const QDesignerFormWindowCursorInterface *cursor)
static QUndoCommand * createRemoveButtonsCommand(QDesignerFormWindowInterface *fw, const ButtonList &bl)