MCPcopy Create free account
hub / github.com/baldurk/renderdoc / addGridLines

Function addGridLines

qrenderdoc/Code/QRDUtils.cpp:2753–2788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2751}
2752
2753void addGridLines(QGridLayout *grid, QColor gridColor)
2754{
2755 QString style =
2756 QFormatStr(
2757 "QLabel { border: solid #%1%2%3; border-bottom-width: 1px; border-right-width: 1px;")
2758 .arg(gridColor.red(), 2, 16, QLatin1Char('0'))
2759 .arg(gridColor.green(), 2, 16, QLatin1Char('0'))
2760 .arg(gridColor.blue(), 2, 16, QLatin1Char('0'));
2761
2762 for(int y = 0; y < grid->rowCount(); y++)
2763 {
2764 for(int x = 0; x < grid->columnCount(); x++)
2765 {
2766 QLayoutItem *item = grid->itemAtPosition(y, x);
2767
2768 if(item == NULL)
2769 continue;
2770
2771 QWidget *w = item->widget();
2772
2773 if(w == NULL)
2774 continue;
2775
2776 QString cellStyle = style;
2777
2778 if(x == 0)
2779 cellStyle += lit("border-left-width: 1px;");
2780 if(y == 0)
2781 cellStyle += lit("border-top-width: 1px;");
2782
2783 cellStyle += lit(" };");
2784
2785 w->setStyleSheet(cellStyle);
2786 }
2787 }
2788}
2789
2790int Formatter::m_minFigures = 2, Formatter::m_maxFigures = 5, Formatter::m_expNegCutoff = 5,
2791 Formatter::m_expPosCutoff = 7;

Callers 4

GLPipelineStateViewerMethod · 0.85

Calls 5

QLatin1CharClass · 0.85
argMethod · 0.45
rowCountMethod · 0.45
columnCountMethod · 0.45
widgetMethod · 0.45

Tested by

no test coverage detected