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
tabordereditor_tool.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// Qt-Security score:significant reason:default
4
7
8#include <QtDesigner/abstractformwindow.h>
9
10#include <QtGui/qaction.h>
11
12#include <QtCore/qcoreevent.h>
13
15
16namespace qdesigner_internal {
17
18TabOrderEditorTool::TabOrderEditorTool(QDesignerFormWindowInterface *formWindow, QObject *parent)
19 : QDesignerFormWindowToolInterface(parent),
20 m_formWindow(formWindow),
21 m_action(new QAction(tr("Edit Tab Order"), this))
22{
23}
24
26
27QDesignerFormEditorInterface *TabOrderEditorTool::core() const
28{
29 return m_formWindow->core();
30}
31
32QDesignerFormWindowInterface *TabOrderEditorTool::formWindow() const
33{
34 return m_formWindow;
35}
36
37bool TabOrderEditorTool::handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event)
38{
39 Q_UNUSED(widget);
40 Q_UNUSED(managedWidget);
41
42 return event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease;
43}
44
46{
47 if (!m_editor) {
48 Q_ASSERT(formWindow() != nullptr);
49 m_editor = new TabOrderEditor(formWindow(), nullptr);
50 connect(formWindow(), &QDesignerFormWindowInterface::mainContainerChanged,
51 m_editor.data(), &TabOrderEditor::setBackground);
52 }
53
54 return m_editor;
55}
56
58{
59 connect(formWindow(), &QDesignerFormWindowInterface::changed,
60 m_editor.data(), &TabOrderEditor::updateBackground);
61}
62
64{
65 disconnect(formWindow(), &QDesignerFormWindowInterface::changed,
66 m_editor.data(), &TabOrderEditor::updateBackground);
67}
68
69QAction *TabOrderEditorTool::action() const
70{
71 return m_action;
72}
73
74} // namespace qdesigner_internal
75
76QT_END_NAMESPACE
QDesignerFormWindowInterface * formWindow() const override
QDesignerFormEditorInterface * core() const override
bool handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event) override
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.