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
qquickmacfocusframe.mm
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
7#include <AppKit/AppKit.h>
8
9#include <QtGui/qguiapplication.h>
10#include <QtGui/private/qcoregraphics_p.h>
11
12#include <QtQml/qqmlcomponent.h>
13
15
16QQuickItem *QQuickMacFocusFrame::createFocusFrame(QQmlContext *context)
17{
18 QQmlComponent component(
19 context->engine(),
20 QUrl(QStringLiteral(
21 "qrc:/qt-project.org/imports/QtQuick/NativeStyle/util/MacFocusFrame.qml")));
22 auto frame = qobject_cast<QQuickItem *>(component.create());
23 if (!frame)
24 return nullptr;
25
26 auto indicatorColor = qt_mac_toQColor(NSColor.keyboardFocusIndicatorColor.CGColor);
27 indicatorColor.setAlpha(255);
28 frame->setProperty("systemFrameColor", indicatorColor);
29 return frame;
30}
31
32QT_END_NAMESPACE
virtual QQuickItem * createFocusFrame(QQmlContext *context) override