Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4
#include "
qquickmacfocusframe.h
"
5
6
#include <
AppKit/AppKit.h
>
7
8
#include <QtGui/qguiapplication.h>
9
#include <QtGui/private/qcoregraphics_p.h>
10
11
#include <QtQml/qqmlcomponent.h>
12
13
QT_BEGIN_NAMESPACE
14
15
QQuickItem
*
QQuickMacFocusFrame::createFocusFrame
(
QQmlContext
*
context
)
16
{
17
QQmlComponent
component
(
18
context
->engine(),
19
QUrl
(
QStringLiteral
(
20
"qrc:/qt-project.org/imports/QtQuick/NativeStyle/util/MacFocusFrame.qml"
)));
21
auto
frame
=
qobject_cast<QQuickItem *>
(
component
.create());
22
if
(!
frame
)
23
return
nullptr
;
24
25
auto
indicatorColor =
qt_mac_toQColor
(NSColor.keyboardFocusIndicatorColor.CGColor);
26
indicatorColor.setAlpha(255);
27
frame
->
setProperty
(
"systemFrameColor"
, indicatorColor);
28
return
frame
;
29
}
30
31
QT_END_NAMESPACE
AppKit.h
QObject::setProperty
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
QQmlComponent
The QQmlComponent class encapsulates a QML component definition.
Definition
qqmlcomponent.h:32
QQmlContext
The QQmlContext class defines a context within a QML engine.
Definition
qqmlcontext.h:25
QQuickItem
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition
qquickitem.h:63
QQuickMacFocusFrame::createFocusFrame
virtual QQuickItem * createFocusFrame(QQmlContext *context) override
Definition
qquickmacfocusframe.mm:15
QUrl
\inmodule QtCore
Definition
qurl.h:94
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
context
static void * context
Definition
qandroidaudiosource.cpp:42
qt_mac_toQColor
QColor qt_mac_toQColor(CGColorRef color)
Definition
qcoregraphics.mm:209
component
static qreal component(const QPointF &point, unsigned int i)
Definition
qpathclipper.cpp:626
qobject_cast< QQuickItem * >
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
Definition
qquickitem.h:492
qquickmacfocusframe.h
QStringLiteral
#define QStringLiteral(str)
Definition
qstringliteral.h:36
frame
QFrame frame
[0]
Definition
src_gui_painting_qdrawutil.cpp:6
qtdeclarative
src
quicknativestyle
util
qquickmacfocusframe.mm
Generated by
1.10.0