TextAddonsWidgets::SlideContainer Class

Header: #include <TextAddonsWidgets/SlideContainer>
CMake: find_package(KF6TextAddonsWidgets REQUIRED)
target_link_libraries(mytarget PRIVATE KF6::TextAddonsWidgets)

Public Functions

SlideContainer(QWidget *parent = nullptr)
QWidget *content() const
void setContent(QWidget *content)
void setSlideHeight(int height)
int slideHeight() const

Reimplemented Public Functions

virtual QSize minimumSizeHint() const override
virtual QSize sizeHint() const override

Public Slots

void slideIn()
void slideOut()

Signals

void slidedIn()
void slidedOut()

Reimplemented Protected Functions

virtual bool eventFilter(QObject *, QEvent *event) override
virtual void resizeEvent(QResizeEvent *) override

Detailed Description

This widget is design to contain one child widget, the "content" widget. It will start hidden by default. Calling slideIn() will slide in the content widget from the top border. Calling slideOut() will slide it out.

Member Function Documentation

[explicit] SlideContainer::SlideContainer(QWidget *parent = nullptr)

Constructs a SlideContainer widget parent The parent widget

QWidget *SlideContainer::content() const

Returns the content widget

See also setContent().

[override virtual protected] bool SlideContainer::eventFilter(QObject *, QEvent *event)

Handles events for the slide container obj The object that received the event event The event that occurred Returns True if the event was handled, false otherwise

[override virtual] QSize SlideContainer::minimumSizeHint() const

Returns the minimum size hint for this widget

[override virtual protected] void SlideContainer::resizeEvent(QResizeEvent *)

Handles resize events for the slide container arg The resize event

void SlideContainer::setContent(QWidget *content)

Defines the content widget

See also content().

[invokable] void SlideContainer::setSlideHeight(int height)

Sets the slide height of the content widget height The height to slide to

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

See also slideHeight().

[override virtual] QSize SlideContainer::sizeHint() const

Returns the size hint for this widget

int SlideContainer::slideHeight() const

Returns the slide height of the content widget

See also setSlideHeight().

[slot] void SlideContainer::slideIn()

Slides the content widget in. Calling it multiple times won't cause the animation to be replayed.

[slot] void SlideContainer::slideOut()

Slides the content widget out. Calling it multiple times won't cause the animation to be replayed.

[signal] void SlideContainer::slidedIn()

Emitted when the slide animation has finished sliding in

[signal] void SlideContainer::slidedOut()

Emitted when the slide animation has finished sliding out