Falkon Develop
Cross-platform Qt-based web browser
headerview.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef HEADERVIEW_H
19#define HEADERVIEW_H
20
21#include <QHeaderView>
22
23class QContextMenuEvent;
24
25#include "qzcommon.h"
26
27class FALKON_EXPORT HeaderView : public QHeaderView
28{
29 Q_OBJECT
30public:
31 explicit HeaderView(QAbstractItemView* parent);
32
33 void setDefaultSectionSizes(const QList<double> &sizes);
34 QList<double> defaultSectionSizes() const;
35
36 bool restoreState(const QByteArray &state);
37
38private Q_SLOTS:
39 void toggleSectionVisibility();
40
41private:
42 void showEvent(QShowEvent* event) override;
43 void contextMenuEvent(QContextMenuEvent* event) override;
44
45 QAbstractItemView* m_parent = nullptr;
46 QMenu* m_menu = nullptr;
47
48 bool m_resizeOnShow;
49 QList<double> m_sectionSizes;
50 QByteArray m_restoreData;
51};
52
53#endif // HEADERVIEW_H
State state
#define FALKON_EXPORT
Definition: qzcommon.h:28