KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KDDockWidgets::QtQuick::TabBar Class Reference

#include <TabBar.h>

Inheritance diagram for KDDockWidgets::QtQuick::TabBar:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::QtQuick::TabBar:
Collaboration graph
[legend]

Signals

void hoveredTabIndexChanged (int index)
 Emitted when the hovered tab changes In case you want to style it differently.
 
void tabBarAutoHideChanged ()
 
void tabBarQmlItemChanged ()
 
- Signals inherited from KDDockWidgets::QtQuick::View
void geometryUpdated ()
 
void itemGeometryChanged ()
 

Public Member Functions

 TabBar (Core::TabBar *controller, QQuickItem *parent=nullptr)
 
 ~TabBar () override
 
Q_INVOKABLE void addDockWidgetAsTab (QQuickItem *other, KDDockWidgets::InitialVisibilityOption={})
 
void changeTabIcon (int index, const QIcon &icon) override
 
Q_INVOKABLE bool closeAtIndex (int index)
 
DockWidgetModeldockWidgetModel () const
 
QRect globalRectForTab (int index) const
 
int hoveredTabIndex () const
 Returns the index of the currently hovered tab In case you want to style them differently in QML.
 
int indexForTabPos (QPoint) const
 
void insertDockWidget (int index, Core::DockWidget *, const QIcon &, const QString &title) override
 
void moveTabTo (int from, int to) override
 
QRect rectForTab (int index) const override
 
void removeDockWidget (Core::DockWidget *) override
 
void renameTab (int index, const QString &) override
 
Q_INVOKABLE void setCurrentIndex (int index) override
 
void setTabBarQmlItem (QQuickItem *)
 
StackstackView () const
 
int tabAt (QPoint localPos) const override
 
bool tabBarAutoHide () const
 
QQuickItem * tabBarQmlItem () const
 
QString text (int index) const override
 Returns the tab text for the specified index This is only used by tests, to make sure your tab's text is correct.
 
- Public Member Functions inherited from KDDockWidgets::QtQuick::View
 View (Core::Controller *controller, Core::ViewType type, QQuickItem *parent=nullptr, Qt::WindowFlags windowFlags={})
 
 ~View () override=default
 
void activateWindow () override
 
std::shared_ptr< Core::ViewasWrapper () override
 Returns this view, but as a wrapper.
 
std::shared_ptr< Core::ViewchildViewAt (QPoint p) const override
 
QVector< std::shared_ptr< Core::View > > childViews () const override
 @Returns a list of child views
 
bool close () override
 
void enableAttribute (Qt::WidgetAttribute attr, bool enable=true) override
 
Qt::WindowFlags flags () const override
 
Qt::FocusPolicy focusPolicy () const override
 
QRect geometry () const override
 
void grabMouse () override
 
bool hasAttribute (Qt::WidgetAttribute attr) const override
 
bool hasFocus () const override
 
void hide () override
 
bool isActiveWindow () const override
 
bool isExplicitlyHidden () const override
 
bool isFixedHeight () const
 
bool isFixedWidth () const
 
bool isMaximized () const override
 
bool isMinimized () const override
 
bool isRootView () const override final
 
bool isVisible () const override
 
QPoint mapFromGlobal (QPoint globalPt) const override
 
QPoint mapTo (Core::View *parent, QPoint pos) const override
 
QPoint mapToGlobal (QPoint localPt) const override
 
QSize maxSizeHint () const override
 
QSize minSize () const override
 
void move (int x, int y) override
 
QRect normalGeometry () const override
 
void onWindowStateChangeEvent (QWindowStateChangeEvent *)
 
std::shared_ptr< Core::ViewparentView () const override
 Returns the gui element's parent. Like QWidget::parentWidget()
 
QQuickView * quickView () const
 
void raise () override
 
void raiseAndActivate () override
 
Q_INVOKABLE void redirectMouseEvents (QQuickItem *from)
 
void releaseKeyboard () override
 
void releaseMouse () override
 
void render (QPainter *) override
 
std::shared_ptr< Core::ViewrootView () const override
 Returns the top-level gui element which this view is inside It's the root view of the window.
 
void setCursor (Qt::CursorShape shape) override
 
void setFixedHeight (int h) override
 
void setFixedSize (Size)
 
void setFixedWidth (int w) override
 
void setFlag (Qt::WindowType f, bool on=true) override
 
void setFocus (Qt::FocusReason reason) override
 
void setFocusPolicy (Qt::FocusPolicy) override
 
void setGeometry (QRect) override
 
void setHeight (int h) override
 
void setMaximumSize (QSize sz) override
 
void setMinimumSize (QSize sz) override
 
void setMouseTracking (bool enable) override
 
void setNormalGeometry (QRect geo)
 
void setParent (Core::View *parent) override
 
void setParent (QQuickItem *parent)
 
void setSize (int w, int h) override final
 
void setVisible (bool is) override
 
void setWidth (int w) override
 
void setWindowIcon (const QIcon &icon) override
 
void setWindowOpacity (double v) override
 
void setWindowTitle (const QString &title) override
 
void setZOrder (int) override
 Sets the z order Not supported on all platforms and only relevant for MDI mode.
 
void show () override
 
Q_INVOKABLE void showMaximized () override
 
Q_INVOKABLE void showMinimized () override
 
Q_INVOKABLE void showNormal () override
 
void update () override
 
void updateGeometry ()
 
QString viewName () const override
 
virtual QQuickItem * visualItem () const
 
std::shared_ptr< Core::Window > window () const override
 Returns the window this view is inside For the Qt frontend, this wraps a QWindow. Like QWidget::window()
 
int zOrder () const override
 
- Public Member Functions inherited from KDDockWidgets::QtCommon::View_qt
 View_qt (Core::Controller *controller, Core::ViewType type, QObject *thisObj)
 
 ~View_qt () override
 
Core::HANDLE handle () const override
 Returns a handle for the GUI element This value only makes sense to the frontend. For example, for QtQuick it might be a QQuickItem, while for QtWidgets it's a QWidget. Can be whatever the frontend developer wants, as long as it uniquely identifies the GUI element. KDDW backend only uses it for comparison purposes.
 
void setViewName (const QString &name) override
 Equivalent to Qt's QObject::objectName()
 
QObjectthisObject () const
 
virtual QVariant viewProperty (const char *name) const
 Equivalent to Qt's QObject::property()
 
- Public Member Functions inherited from KDDockWidgets::Core::View
 View (Controller *controller, ViewType)
 
template<typename T >
T * asController ()
 Returns the View's controller, casted as T.
 
Core::DockWidgetasDockWidgetController () const
 
Core::DropAreaasDropAreaController () const
 
Core::FloatingWindowasFloatingWindowController () const
 asFooController() are deprecated. Use asController<T>() instead
 
Core::GroupasGroupController () const
 
Core::LayoutasLayout () const
 
Core::MainWindowasMainWindowController () const
 
Core::MDILayoutasMDILayoutController () const
 
Core::StackasStackController () const
 
Core::TabBarasTabBarController () const
 
Core::TitleBarasTitleBarController () const
 
virtual std::shared_ptr< ViewchildViewAt (Point localPos) const =0
 
Controllercontroller () const
 Returns this view's controller.
 
virtual void createPlatformWindow ()
 
bool deliverViewEventToFilters (Event *e)
 Delivers mouse events and such to event filters.
 
void dumpDebug ()
 Prints some debug to stderr.
 
bool equals (const std::shared_ptr< View > &) const
 
bool equals (const View *other) const
 Returns whether this view represents the same GUI element as the other.
 
int height () const
 
bool inDtor () const
 Returns whether the DTOR is currently running. freed() might be true while inDtor false, as the implementation of free() is free to delay it (with deleteLater() for example)
 
void installViewEventFilter (EventFilterInterface *)
 Installs an event filter in this view to intercept the event it receives Analogue to QObject::installEventFilter() in the Qt world.
 
virtual bool is (ViewType) const
 Returns whether the view is of the specified type Virtual so it can be overridden by ViewWrapper. When we're wrapping an existing GUI element only the specific frontend can know what's the actual type.
 
bool isFixedHeight () const
 
bool isFixedWidth () const
 
virtual bool isNull () const
 Returns whether the gui item represented by this view was already deleted Usually false, as KDDW internal gui elements inherit View, and nobody will access them after destruction. However, ViewWrapper derived classes, wrap an existing gui element, which might get deleted. Override isNull() in our ViewWrapper subclasses and return true if the wrapped gui element was already deleted.
 
virtual Point mapFromGlobal (Point) const =0
 
virtual Point mapTo (View *, Point) const =0
 
virtual Point mapToGlobal (Point) const =0
 
int minimumHeight () const
 
int minimumWidth () const
 
void move (Point)
 
virtual bool onFocusInEvent (FocusEvent *)
 
virtual bool onResize (int h, int w)
 
bool onResize (Size)
 
Point pos () const
 
Rect rect () const
 
void removeViewEventFilter (EventFilterInterface *)
 Removes the event filter.
 
void resize (int w, int h)
 
void resize (Size)
 
Size screenSize () const
 Returns the size of the screen that this view belongs to.
 
virtual void setGeometry (Rect)=0
 
virtual void setMaximumSize (Size sz)=0
 
virtual void setMinimumSize (Size)=0
 
void setSize (Size)
 
virtual void setWindowIcon (const Icon &)=0
 
Size size () const
 
int width () const
 
int x () const
 
int y () const
 
- Public Member Functions inherited from KDDockWidgets::Core::TabBarViewInterface
 TabBarViewInterface (TabBar *)
 
virtual ~TabBarViewInterface ()
 
virtual void changeTabIcon (int index, const Icon &icon)=0
 
virtual void insertDockWidget (int index, DockWidget *dw, const Icon &icon, const QString &title)=0
 
virtual void setTabsAreMovable (bool)
 Implement if your frontend will support reordering tabs with mouse Currently only the QtWidgets frontend supports it.
 
virtual int tabAt (Point localPt) const =0
 

Protected Member Functions

bool event (QEvent *ev) override
 
void init () override final
 
void onHoverEvent (QHoverEvent *, QPoint globalPos) override
 Override in case you want to have different styling on hover.
 
- Protected Member Functions inherited from KDDockWidgets::QtQuick::View
bool event (QEvent *) override
 
bool eventFilter (QObject *watched, QEvent *ev) override
 
void itemChange (QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override
 
void QQUICKITEMgeometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry) override
 
- Protected Member Functions inherited from KDDockWidgets::Core::View
 View (const View &)=delete
 
Viewoperator= (const View &)=delete
 
- Protected Member Functions inherited from KDDockWidgets::Core::TabBarViewInterface
 TabBarViewInterface (const TabBarViewInterface &)=delete
 
TabBarViewInterfaceoperator= (const TabBarViewInterface &)=delete
 

Properties

DockWidgetModeldockWidgetModel
 
int hoveredTabIndex
 
bool tabBarAutoHide
 
QQuickItem * tabBarQmlItem
 
- Properties inherited from KDDockWidgets::QtQuick::View
bool isFixedHeight
 
bool isFixedWidth
 

Additional Inherited Members

- Static Public Member Functions inherited from KDDockWidgets::QtQuick::View
static std::shared_ptr< Core::ViewasQQuickWrapper (QQuickItem *item)
 
static bool close (QQuickItem *)
 
static QQuickItem * createItem (const QString &filename, QQuickItem *parent, QQmlContext *ctx=nullptr)
 Convenience to create a QQuickItem parented to parent. Uses the engine from the parent.
 
static QQuickItem * createItem (QQmlEngine *engine, const QString &filename, QQmlContext *context=nullptr)
 Convenience to create a QQuickItem.
 
static bool isRootView (const QQuickItem *)
 
static void makeItemFillParent (QQuickItem *item)
 This is equivalent to "anchors.fill: parent but in C++.
 
static std::shared_ptr< Core::ViewparentViewFor (const QQuickItem *)
 
static void raiseAndActivate (QQuickItem *)
 
- Static Public Member Functions inherited from KDDockWidgets::QtCommon::View_qt
static QObjectasQObject (View *)
 
- Static Public Member Functions inherited from KDDockWidgets::Core::View
static bool equals (const View *one, const View *two)
 
static ControllerfirstParentOfType (View *view, ViewType)
 Returns the controller of the first parent view of the specified type Goes up the view hierarchy chain until it finds it. Returns nullptr otherwise.
 
static Size hardcodedMinimumSize ()
 The minimum minimum size a dock widget can have.
 
- Public Attributes inherited from KDDockWidgets::Core::View
Private *const d
 
- Protected Attributes inherited from KDDockWidgets::QtCommon::View_qt
EventFilter *const m_eventFilter
 
QObject *const m_thisObj
 
- Protected Attributes inherited from KDDockWidgets::Core::View
Controller *const m_controller
 
bool m_inDtor = false
 
- Protected Attributes inherited from KDDockWidgets::Core::TabBarViewInterface
TabBar *const m_tabBar
 

Detailed Description

Definition at line 44 of file qtquick/views/TabBar.h.

Constructor & Destructor Documentation

◆ TabBar()

TabBar::TabBar ( Core::TabBar controller,
QQuickItem *  parent = nullptr 
)
explicit

◆ ~TabBar()

TabBar::~TabBar ( )
override

Definition at line 85 of file qtquick/views/TabBar.cpp.

Member Function Documentation

◆ addDockWidgetAsTab()

void TabBar::addDockWidgetAsTab ( QQuickItem *  other,
KDDockWidgets::InitialVisibilityOption  opt = {} 
)

◆ changeTabIcon()

void TabBar::changeTabIcon ( int  index,
const QIcon icon 
)
override

Definition at line 246 of file qtquick/views/TabBar.cpp.

◆ closeAtIndex()

bool TabBar::closeAtIndex ( int  index)

Closes the dock widget at the specified index Returns true on success

Definition at line 232 of file qtquick/views/TabBar.cpp.

◆ dockWidgetModel()

DockWidgetModel * TabBar::dockWidgetModel ( ) const

Definition at line 265 of file qtquick/views/TabBar.cpp.

◆ event()

bool TabBar::event ( QEvent ev)
overrideprotected

◆ globalRectForTab()

QRect TabBar::globalRectForTab ( int  index) const

Definition at line 152 of file qtquick/views/TabBar.cpp.

References QRect::moveTopLeft(), tabAt(), and QRect::topLeft().

Referenced by indexForTabPos().

◆ hoveredTabIndex()

int TabBar::hoveredTabIndex ( ) const

Returns the index of the currently hovered tab In case you want to style them differently in QML.

Definition at line 300 of file qtquick/views/TabBar.cpp.

◆ hoveredTabIndexChanged

void KDDockWidgets::QtQuick::TabBar::hoveredTabIndexChanged ( int  index)
signal

Emitted when the hovered tab changes In case you want to style it differently.

◆ indexForTabPos()

int TabBar::indexForTabPos ( QPoint  globalPt) const

Definition at line 279 of file qtquick/views/TabBar.cpp.

References QRect::contains(), and globalRectForTab().

Referenced by onHoverEvent().

◆ init()

void TabBar::init ( )
finaloverrideprotectedvirtual

init method to solve cyclic ctor dependencies between view and controllers Called by the controller

Reimplemented from KDDockWidgets::Core::View.

Definition at line 90 of file qtquick/views/TabBar.cpp.

References KDDockWidgets::Core::TabBarViewInterface::m_tabBar, KDDockWidgets::Core::TabBar::stack(), and tabBarAutoHideChanged().

◆ insertDockWidget()

void TabBar::insertDockWidget ( int  index,
Core::DockWidget dw,
const QIcon icon,
const QString title 
)
override

Definition at line 256 of file qtquick/views/TabBar.cpp.

◆ moveTabTo()

void TabBar::moveTabTo ( int  from,
int  to 
)
overridevirtual

◆ onHoverEvent()

void TabBar::onHoverEvent ( QHoverEvent ,
QPoint   
)
overrideprotectedvirtual

Override in case you want to have different styling on hover.

Reimplemented from KDDockWidgets::QtQuick::View.

Definition at line 270 of file qtquick/views/TabBar.cpp.

References QEvent::HoverLeave, indexForTabPos(), and QEvent::type().

◆ rectForTab()

QRect TabBar::rectForTab ( int  index) const
overridevirtual

Implements KDDockWidgets::Core::TabBarViewInterface.

Definition at line 144 of file qtquick/views/TabBar.cpp.

References tabAt().

◆ removeDockWidget()

void TabBar::removeDockWidget ( Core::DockWidget dw)
overridevirtual

◆ renameTab()

void TabBar::renameTab ( int  index,
const QString  
)
overridevirtual

◆ setCurrentIndex()

void TabBar::setCurrentIndex ( int  index)
overridevirtual

◆ setTabBarQmlItem()

void TabBar::setTabBarQmlItem ( QQuickItem *  item)

Definition at line 125 of file qtquick/views/TabBar.cpp.

References tabBarQmlItemChanged().

◆ stackView()

Stack * TabBar::stackView ( ) const

◆ tabAt()

int TabBar::tabAt ( QPoint  localPos) const
override

Definition at line 96 of file qtquick/views/TabBar.cpp.

References QMetaObject::invokeMethod(), and QVariant::toInt().

Referenced by event(), globalRectForTab(), rectForTab(), and text().

◆ tabBarAutoHide()

bool TabBar::tabBarAutoHide ( ) const

Returns whether the tab bar should hide when there's only 1 tab visible Default true, unless Flag_HideTitleBarWhenTabsVisible

Definition at line 213 of file qtquick/views/TabBar.cpp.

References KDDockWidgets::Core::TabBarViewInterface::m_tabBar, KDDockWidgets::Core::TabBar::stack(), and KDDockWidgets::Core::Stack::tabBarAutoHide().

◆ tabBarAutoHideChanged

void KDDockWidgets::QtQuick::TabBar::tabBarAutoHideChanged ( )
signal

Referenced by init().

◆ tabBarQmlItem()

QQuickItem * TabBar::tabBarQmlItem ( ) const

Definition at line 120 of file qtquick/views/TabBar.cpp.

◆ tabBarQmlItemChanged

void KDDockWidgets::QtQuick::TabBar::tabBarQmlItemChanged ( )
signal

Referenced by setTabBarQmlItem().

◆ text()

QString TabBar::text ( int  index) const
overridevirtual

Returns the tab text for the specified index This is only used by tests, to make sure your tab's text is correct.

Implements KDDockWidgets::Core::TabBarViewInterface.

Definition at line 136 of file qtquick/views/TabBar.cpp.

References tabAt().

Property Documentation

◆ dockWidgetModel

DockWidgetModel * KDDockWidgets::QtQuick::TabBar::dockWidgetModel
read

Definition at line 50 of file qtquick/views/TabBar.h.

◆ hoveredTabIndex

int KDDockWidgets::QtQuick::TabBar::hoveredTabIndex
read

Definition at line 51 of file qtquick/views/TabBar.h.

◆ tabBarAutoHide

bool KDDockWidgets::QtQuick::TabBar::tabBarAutoHide
read

Definition at line 49 of file qtquick/views/TabBar.h.

◆ tabBarQmlItem

QQuickItem * KDDockWidgets::QtQuick::TabBar::tabBarQmlItem
readwrite

Definition at line 47 of file qtquick/views/TabBar.h.


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

© 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 by doxygen 1.9.8