Page Contents

Topics

Classes

QLTabBar Class

#include <QLayers/qltabbar.h>

Inherits: QLWidget

Public Functions

QLTabBar(QWidget* parent = nullptr)
void add_tab(const QLGraphic& icon, const QString& text)
void add_tab(const QString& text)
int current_index() const
void set_current_index(int index)
QList<QLTab*> tabs() const

Signals

void index_changed(int old_index, int new_index)
void tab_closed(int index)

Detailed Description

QLTabBar Example

A QLTabBar is a QLWidget that lets the user switch between different widgets by clicking child QLTab widgets.

Member Function Documentation

QLTabBar(QWidget* parent = nullptr)

Constructs a tab bar.

void add_tab(const QLGraphic& icon, const QString& text)

Creates a tab labeled with an icon and text.

void add_tab(const QString& text)

Creates a tab labeled with text.

void current_index() const

Returns the current index of the tab bar.

void index_changed(int old_index, int new_index)

Signal

This signal is emitted when the current index changes.

void set_current_index(int index)

Sets the current index of the tab bar.

void tab_closed(int index)

Signal

This signal is emitted when a tab is closed.

QList<QLTab*> tabs() const

Returns a list of pointers to the tabs of the tab bar.