KDDockWidgets API Documentation 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
KDDockWidgets::FocusScope Class Referenceabstract

Allows to implement a similar functionality to QtQuick's FocusScope item, in QtWidgets. More...

#include <FocusScope.h>

Public Member Functions

 FocusScope (QWidgetAdapter *thisWidget)
 constructor
 
virtual ~FocusScope ()
 
void focus (Qt::FocusReason=Qt::OtherFocusReason)
 Sets focus on this scope.
 
WidgetTypefocusedWidget () const
 Returns the widget that's focused in this scope The widget itself might not have focus as in QWidget::hasFocus(), but will get actual focus as soon as this scope is focused.
 
bool isFocused () const
 Returns true if this FocusScope is focused. This is similar to the QWidget::hasFocus(), except that it counts with the children being focused too. i.e: If any child is focused then this FocusScope has focus too.
 

Protected Member Functions

virtual void focusedWidgetChangedCallback ()=0
 
virtual void isFocusedChangedCallback ()=0
 reimplement in the 1st QObject derived class
 

Detailed Description

Allows to implement a similar functionality to QtQuick's FocusScope item, in QtWidgets.

Definition at line 27 of file FocusScope.h.

Constructor & Destructor Documentation

◆ FocusScope()

FocusScope::FocusScope ( QWidgetAdapter *  thisWidget)
explicit

constructor

Definition at line 80 of file FocusScope.cpp.

◆ ~FocusScope()

FocusScope::~FocusScope ( )
virtual

Definition at line 85 of file FocusScope.cpp.

Member Function Documentation

◆ focus()

void FocusScope::focus ( Qt::FocusReason  reason = Qt::OtherFocusReason)

Sets focus on this scope.

This will call QWidget::focus() on the last QWidget that was focused in this scope.

Definition at line 100 of file FocusScope.cpp.

References Qt::NoFocus.

◆ focusedWidget()

WidgetType * FocusScope::focusedWidget ( ) const

Returns the widget that's focused in this scope The widget itself might not have focus as in QWidget::hasFocus(), but will get actual focus as soon as this scope is focused.

Definition at line 95 of file FocusScope.cpp.

◆ focusedWidgetChangedCallback()

virtual void KDDockWidgets::FocusScope::focusedWidgetChangedCallback ( )
protectedpure virtual

◆ isFocused()

bool FocusScope::isFocused ( ) const

Returns true if this FocusScope is focused. This is similar to the QWidget::hasFocus(), except that it counts with the children being focused too. i.e: If any child is focused then this FocusScope has focus too.

Definition at line 90 of file FocusScope.cpp.

◆ isFocusedChangedCallback()

virtual void KDDockWidgets::FocusScope::isFocusedChangedCallback ( )
protectedpure virtual

reimplement in the 1st QObject derived class


The documentation for this class was generated from the following files:

© 2019-2023 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated on Wed Nov 1 2023 00:02:31 for KDDockWidgets API Documentation by doxygen 1.9.8