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_widget_helper.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_WIDGETHELPER_H
5#define INPLACE_WIDGETHELPER_H
6
7
8#include <QtCore/qobject.h>
9#include <QtCore/qpoint.h>
10#include <QtCore/qsize.h>
11#include <QtCore/qpointer.h>
12#include <qglobal.h>
13
14QT_BEGIN_NAMESPACE
15
16class QDesignerFormWindowInterface;
17
18namespace qdesigner_internal {
19
20 // A helper class to make an editor widget suitable for form inline
21 // editing. Derive from the editor widget class and make InPlaceWidgetHelper a member.
22 //
23 // Sets "destructive close" on the editor widget and
24 // wires "ESC" to it.
25 // Installs an event filter on the parent to listen for
26 // resize events and passes them on to the child.
27 // You might want to connect editingFinished() to close() of the editor widget.
29 {
31 public:
34
35 bool eventFilter(QObject *object, QEvent *event) override;
36
37 // returns a recommended alignment for the editor widget determined from the parent.
38 Qt::Alignment alignment() const;
39 private:
40 QWidget *m_editorWidget;
41 QPointer<QWidget> m_parentWidget;
42 const bool m_noChildEvent;
43 QPoint m_posOffset;
44 QSize m_sizeOffset;
45 };
46
47} // namespace qdesigner_internal
48
49QT_END_NAMESPACE
50
51#endif // INPLACE_WIDGETHELPER_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.
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
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)