diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 4617cb1ce..3744170b7 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -24,6 +24,7 @@ #include "QRDUtils.h" #include +#include #include #include #include @@ -443,3 +444,37 @@ bool QFileFilterModel::filterAcceptsRow(int source_row, const QModelIndex &sourc return true; } + +void addGridLines(QGridLayout *grid) +{ + for(int y = 0; y < grid->rowCount(); y++) + { + for(int x = 0; x < grid->columnCount(); x++) + { + QLayoutItem *item = grid->itemAtPosition(y, x); + QLayoutItem *east = grid->itemAtPosition(y, x + 1); + QLayoutItem *south = grid->itemAtPosition(y + 1, x); + + if(item == NULL) + continue; + + QWidget *w = item->widget(); + + if(w == NULL) + continue; + + QString name = w->objectName(); + + QString style; + + style += "border: solid black; border-top-width: 1px; border-left-width: 1px;"; + + if(!east || !east->widget()) + style += "border-right-width: 1px;"; + if(!south || !south->widget()) + style += "border-bottom-width: 1px;"; + + w->setStyleSheet(style); + } + } +} diff --git a/qrenderdoc/Code/QRDUtils.h b/qrenderdoc/Code/QRDUtils.h index 34514d798..7fb265e73 100644 --- a/qrenderdoc/Code/QRDUtils.h +++ b/qrenderdoc/Code/QRDUtils.h @@ -502,3 +502,7 @@ public: return m_Size; } }; + +class QGridLayout; + +void addGridLines(QGridLayout *grid);