This repository has been archived on 2020-09-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
libs/qad/application/edockwidget.h

40 lines
1003 B
C++

#ifndef EDOCKWIDGET_H
#define EDOCKWIDGET_H
#include <QDockWidget>
#include <QLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QIcon>
#include <QToolButton>
#include <QDebug>
class EDockWidget: public QDockWidget
{
Q_OBJECT
public:
explicit EDockWidget(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(title, parent, flags) {init();}
explicit EDockWidget(QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(parent, flags) {init();}
~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;}
void setFeatures(QDockWidget::DockWidgetFeatures features);
void setWindowTitle(const QString & title);
void setWindowIcon(const QIcon & icon);
private:
bool event(QEvent * e);
void init();
void updateStyle();
QFrame * header;
QLabel * lbl_title, * lbl_icon;
QToolButton * btn_hide, * btn_dock;
private slots:
void dockClicked() {setFloating(!isFloating());}
};
#endif // EDOCKWIDGET_H