2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef FREEZETABLEWIDGET_H
|
|
|
|
#define FREEZETABLEWIDGET_H
|
|
|
|
|
|
|
|
#include <QTableView>
|
|
|
|
|
|
|
|
//! [Widget definition]
|
|
|
|
class FreezeTableWidget : public QTableView {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
FreezeTableWidget(QAbstractItemModel * model);
|
|
|
|
~FreezeTableWidget();
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
2016-11-22 23:02:53 +00:00
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
|
2016-06-15 08:12:35 +00:00
|
|
|
void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QTableView *frozenTableView;
|
|
|
|
void init();
|
|
|
|
void updateFrozenTableGeometry();
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
2012-11-22 12:40:51 +00:00
|
|
|
void updateSectionWidth(int logicalIndex, int oldSize, int newSize);
|
|
|
|
void updateSectionHeight(int logicalIndex, int oldSize, int newSize);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
//! [Widget definition]
|
2012-11-22 12:40:51 +00:00
|
|
|
#endif // FREEZETABLEWIDGET_H
|