#ifndef FREEZETABLEVIEW_H #define FREEZETABLEVIEW_H #include <QTreeView> class QStandardItemModel; //! [Widget definition] class FreezeTreeView : public QTreeView { Q_OBJECT public: FreezeTreeView(QWidget * parent); ~FreezeTreeView(); virtual void setModel(QStandardItemModel * model); void init(); protected: void resizeEvent(QResizeEvent *event) override; QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; //void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) override; private slots: void updateSectionWidth(int logicalIndex, int oldSize, int newSize); //void updateSectionHeight(int logicalIndex, int oldSize, int newSize); void slotExpanded(const QModelIndex&index); void slotcollapsed(const QModelIndex &ind
QTreeView冻结列(QTreeView第一列不随滑块移动)
最新推荐文章于 2024-07-14 20:31:20 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)