void MyStringTable::resizeEvent(QResizeEvent * event) { int w = event->size().width(); if(ColCount()>0) { int ws = w / ColCount(); int ns; int ww = 0; int nn = 0; for(ns=0;ns<ColCount();ns++) { ws = ColWidth(ns); if(ws>0) ww += ws; else nn++; } if(nn>0) { ww = (w - ww) / nn; if(ww<10) ww=10; } for(ns=0;ns<ColCount();ns++) { ws = ColWidth(ns); if(ws<1) ws = ww; horizontalHeader()->resizeSection(ns,ws); } } QTableView::resizeEvent(event); }
static size_t NumPatches(const Arguments<T> &args) { return ColHeight(args) * ColWidth(args) * args.channels; }