KDDockWidgets API Documentation  1.1.1
Public 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
 
void focus (Qt::FocusReason=Qt::OtherFocusReason)
 Sets focus on this scope. More...
 
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.
 
virtual void focusedWidgetChanged ()=0
 
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.
 
virtual void isFocusedChanged ()=0
 reimplement in the 1st QObject derived class
 

Detailed Description

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

Member Function Documentation

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.


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/