summaryrefslogtreecommitdiffhomepage
path: root/gui/process-detector-fancy-table.cpp
blob: f1144afa92bf358f5a25fb52ec2774502785afe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "process-detector-fancy-table.hpp"

#include <QHeaderView>

void FancyTable::resizeEvent(QResizeEvent* e)
{
    QTableView::resizeEvent(e);
    int w = width();
    setContentsMargins(QMargins(0, 0, 0, 0));
    w -= 64;
    setColumnWidth(2, 32);
    setColumnWidth(0, w / 2);
    setColumnWidth(1, w / 2);
    horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
}

FancyTable::FancyTable(QWidget* parent) : QTableWidget(parent) {}