mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Don't custom size horizontal header by default in RDTableView
This commit is contained in:
@@ -262,7 +262,7 @@ void RDHeaderView::resizeSections(QHeaderView::ResizeMode mode)
|
||||
}
|
||||
|
||||
if(!m_customSizing)
|
||||
return resizeSections(mode);
|
||||
return QHeaderView::resizeSections(mode);
|
||||
|
||||
if(mode != ResizeToContents)
|
||||
return;
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
void setPinnedColumns(int numColumns) { m_pinnedColumns = numColumns; }
|
||||
int pinnedColumns() const { return m_pinnedColumns; }
|
||||
void setCustomSizing(bool sizing) { m_customSizing = sizing; }
|
||||
bool customSizing() const { return m_customSizing; }
|
||||
int pinnedWidth() { return m_pinnedWidth; }
|
||||
public slots:
|
||||
void setRootIndex(const QModelIndex &index) override;
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
RDTableView::RDTableView(QWidget *parent) : QTableView(parent)
|
||||
{
|
||||
m_horizontalHeader = new RDHeaderView(Qt::Horizontal, this);
|
||||
m_horizontalHeader->setCustomSizing(true);
|
||||
setHorizontalHeader(m_horizontalHeader);
|
||||
|
||||
QObject::connect(m_horizontalHeader, &QHeaderView::sectionResized,
|
||||
@@ -408,6 +407,9 @@ void RDTableView::scrollTo(const QModelIndex &index, ScrollHint hint)
|
||||
|
||||
void RDTableView::updateGeometries()
|
||||
{
|
||||
if(!m_horizontalHeader->customSizing())
|
||||
return QTableView::updateGeometries();
|
||||
|
||||
static bool recurse = false;
|
||||
if(recurse)
|
||||
return;
|
||||
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
void setColumnWidths(const QList<int> &widths);
|
||||
void resizeColumnsToContents();
|
||||
|
||||
void setCustomHeaderSizing(bool sizing) { m_horizontalHeader->setCustomSizing(sizing); }
|
||||
// these ones we CAN override, so even though the implementation is identical to QTableView we
|
||||
// reimplement so it can pick up the above functions
|
||||
QRect visualRect(const QModelIndex &index) const override;
|
||||
|
||||
@@ -1069,6 +1069,10 @@ BufferViewer::BufferViewer(ICaptureContext &ctx, bool meshview, QWidget *parent)
|
||||
|
||||
QMenu *menu = new QMenu(this);
|
||||
|
||||
ui->vsinData->setCustomHeaderSizing(true);
|
||||
ui->vsoutData->setCustomHeaderSizing(true);
|
||||
ui->gsoutData->setCustomHeaderSizing(true);
|
||||
|
||||
QObject::connect(ui->vsinData, &RDTableView::customContextMenuRequested,
|
||||
[this, menu](const QPoint &pos) { stageRowMenu(MeshDataStage::VSIn, menu, pos); });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user