Utils::DetachableWidget Class
class Utils::DetachableWidgetThe DetachableWidget class shows a widget in place or in a window of its own. More...
| Header: | #include <detachablewidget.h> |
| Inherits: | QWidget |
Public Functions
| DetachableWidget(QWidget *content, QAbstractButton *detachButton, const QString &placeholderText, QWidget *parent = nullptr) | |
| QWidget * | content() const |
| bool | isDetached() const |
| void | setDetached(bool detached) |
Detailed Description
The content can move into a separate window and back, as the checkable detach button asks. While it is in the window, the DetachableWidget shows a note with a button that brings the content back. Closing the window brings it back as well.
When the DetachableWidget is deleted while its content is in the window, for example because a side bar replaces it with another view, the window keeps the content. Closing the window then deletes both, and so does shutting down.
Member Function Documentation
DetachableWidget::DetachableWidget(QWidget *content, QAbstractButton *detachButton, const QString &placeholderText, QWidget *parent = nullptr)
Creates a widget that shows content, with detachButton moving it into a separate window and back. While the content is in the window, the widget shows placeholderText. The widget takes the window title of content.
QWidget *DetachableWidget::content() const
Returns the widget that is shown in place or in the separate window.
bool DetachableWidget::isDetached() const
Returns whether the content is shown in the separate window.
void DetachableWidget::setDetached(bool detached)
Moves the content into a separate window if detached is true, and back otherwise.
See also isDetached().
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.