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
4#ifndef INPLACE_EDITOR_H
5#define INPLACE_EDITOR_H
6
7#include <textpropertyeditor_p.h>
8#include <shared_enums_p.h>
9
11#include <qdesigner_utils_p.h>
12
13#include <QtCore/qpointer.h>
14
16
17
18class QDesignerFormWindowInterface;
19
20namespace qdesigner_internal {
21
23{
25public:
29 const QString& text,
30 const QRect& r);
31private:
32 InPlaceWidgetHelper m_InPlaceWidgetHelper;
33};
34
35// Base class for inline editor helpers to be embedded into a task menu.
36// Inline-edits a property on a multi-selection.
37// To use it for a particular widget/property, overwrite the method
38// returning the edit area.
39
41{
43
44public slots:
45 void editText();
46
47private slots:
48 void updateText(const QString &text);
49 void updateSelection();
50
51protected:
52 TaskMenuInlineEditor(QWidget *w, TextPropertyValidationMode vm, const QString &property, QObject *parent);
53 // Overwrite to return the area for the inline editor.
54 virtual QRect editRectangle() const = 0;
55 QWidget *widget() const { return m_widget; }
56
57private:
59 const QString m_property;
60 QWidget *m_widget;
61 QPointer<QDesignerFormWindowInterface> m_formWindow;
62 QPointer<InPlaceEditor> m_editor;
63 bool m_managed;
64 qdesigner_internal::PropertySheetStringValue m_value;
65};
66
67} // namespace qdesigner_internal
68
69QT_END_NAMESPACE
70
71#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)