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
6
7#include <QtDesigner/abstractformwindow.h>
8
9#include <QtGui/qaction.h>
10
11#include <QtCore/qcoreevent.h>
12
14
15namespace qdesigner_internal {
16
17TabOrderEditorTool::TabOrderEditorTool(QDesignerFormWindowInterface *formWindow, QObject *parent)
18 : QDesignerFormWindowToolInterface(parent),
19 m_formWindow(formWindow),
20 m_action(new QAction(tr("Edit Tab Order"), this))
21{
22}
23
25
26QDesignerFormEditorInterface *TabOrderEditorTool::core() const
27{
28 return m_formWindow->core();
29}
30
31QDesignerFormWindowInterface *TabOrderEditorTool::formWindow() const
32{
33 return m_formWindow;
34}
35
36bool TabOrderEditorTool::handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event)
37{
38 Q_UNUSED(widget);
39 Q_UNUSED(managedWidget);
40
41 return event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease;
42}
43
45{
46 if (!m_editor) {
47 Q_ASSERT(formWindow() != nullptr);
48 m_editor = new TabOrderEditor(formWindow(), nullptr);
49 connect(formWindow(), &QDesignerFormWindowInterface::mainContainerChanged,
50 m_editor.data(), &TabOrderEditor::setBackground);
51 }
52
53 return m_editor;
54}
55
57{
58 connect(formWindow(), &QDesignerFormWindowInterface::changed,
59 m_editor.data(), &TabOrderEditor::updateBackground);
60}
61
63{
64 disconnect(formWindow(), &QDesignerFormWindowInterface::changed,
65 m_editor.data(), &TabOrderEditor::updateBackground);
66}
67
68QAction *TabOrderEditorTool::action() const
69{
70 return m_action;
71}
72
73} // namespace qdesigner_internal
74
75QT_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.