blob: 127525b5aa602f5f56cd4c3a39520764e783e1df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
* SPDX-FileCopyrightText: 2010 Peter Penz <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef DOLPHIN_DOCK_WIDGET_H
#define DOLPHIN_DOCK_WIDGET_H
#include <QDockWidget>
/**
* @brief Extends QDockWidget to be able to get locked.
*/
class DolphinDockWidget : public QDockWidget
{
Q_OBJECT
public:
explicit DolphinDockWidget(const QString &title = QString(), QWidget *parent = nullptr, Qt::WindowFlags flags = {});
~DolphinDockWidget() override;
/**
* @param lock If \a lock is true, the title bar of the dock-widget will get hidden so
* that it is not possible for the user anymore to move or undock the dock-widget.
*/
void setLocked(bool lock);
bool isLocked() const;
protected:
/**
* Make sure we do not emit QDockWidget::visibilityChanged() signals whenever Dolphin's window is minimized or restored.
*/
bool event(QEvent *event) override;
private:
bool m_locked;
QWidget *m_dockTitleBar;
};
#endif
|