Mantid
Loading...
Searching...
No Matches
CheckboxHeader.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
10
11#include <QHeaderView>
12#include <QMouseEvent>
13#include <QPainter>
14
15namespace MantidQt {
16namespace MantidWidgets {
25class EXPORT_OPT_MANTIDQT_COMMON CheckboxHeader : public QHeaderView {
26 Q_OBJECT
27
28public:
30 explicit CheckboxHeader(Qt::Orientation orientation, QWidget *parent = nullptr);
31 void setChecked(bool checked);
32
33signals:
34 void toggled(bool checked);
35
36protected:
39 void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override;
41 void mousePressEvent(QMouseEvent *event) override;
42
43private:
45 QRect checkBoxRect(const QRect &sourceRect) const;
48};
49} // namespace MantidWidgets
50} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
This class subclasses and overwrites QHeaderView methods to enable checkboxes to exist in the table h...
CheckboxHeader(Qt::Orientation orientation, QWidget *parent=nullptr)
Override QHeaderView constructor.
void mousePressEvent(QMouseEvent *event) override
Set the checkbox to checked when it is clicked.
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override
Overrides QHeaderView allowing checkbox functionality in the first column of the table.
QRect checkBoxRect(const QRect &sourceRect) const
The area around the checkbox.
bool m_checked
The state of the checkbox in the column header.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...