6#include <QtCore/qmetaobject.h>
8#include <QtGui/qguiapplication.h>
10#include <QtQml/qqmlengine.h>
11#include <QtQml/qqmlcontext.h>
12#include <QtQml/qqmlcomponent.h>
14#include <QtQuick/qquickitem.h>
23QScopedPointer<QQuickItem> QQuickFocusFrame::m_focusFrame;
28 if (
auto item = qobject_cast<QQuickItem *>(
qGuiApp->focusObject()))
44 qWarning() <<
"Failed to create FocusFrame";
58 qCDebug(lcFocusFrame) <<
"new focusobject:" << focusItem;
59 const auto parentItem = focusItem->
parentItem();
66 const auto control =
proxy ?
proxy : focusItem;
69 qCDebug(lcFocusFrame) <<
"control:" << control;
90 const auto styleItemProperty = control->
property(
"__focusFrameStyleItem");
93 const auto styleItemProperty = control->
property(
"background");
104 const QVariant focusFrameRadiusVariant =
item->property(
"__focusFrameRadius");
105 if (focusFrameRadiusVariant.isValid()) {
106 qCDebug(lcFocusFrame) <<
"'focusFrameRadius' property found, showing a default focus frame";
108 const qreal radius =
qMax(0.0, focusFrameRadiusVariant.toReal());
114 qCDebug(lcFocusFrame) <<
"custom delegates in use, skip showing focus frame";
void focusObjectChanged(QObject *focusObject)
This signal is emitted when final receiver of events tied to focus is changed.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QVariant property(const char *name) const
Returns the value of the object's name property.
static QQmlContext * contextForObject(const QObject *)
Returns the QQmlContext for the object, or nullptr if no context has been set.
virtual QQuickItem * createFocusFrame(QQmlContext *context)=0
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QQuickItem * parentItem() const
The QStyleOption class stores the parameters used by QStyle functions.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
constexpr const T & qMax(const T &a, const T &b)
#define Q_ARG(Type, data)
static QQuickFocusFrameDescription Invalid