MCPcopy Create free account
hub / github.com/KDE/labplot / init

Method init

src/frontend/dockwidgets/CartesianPlotDock.cpp:258–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void CartesianPlotDock::init() {
259 // draw the icons for the border sides
260 QPainter pa;
261 int iconSize = 20;
262 QPixmap pm(iconSize, iconSize);
263
264 QPen pen(Qt::SolidPattern);
265 const QColor& color = GuiTools::isDarkMode() ? Qt::white : Qt::black;
266 pen.setColor(color);
267
268 // left
269 pm.fill(Qt::transparent);
270 pa.begin(&pm);
271 pa.setRenderHint(QPainter::Antialiasing); // must be set after every QPainter::begin()
272 pen.setStyle(Qt::SolidLine);
273 pen.setWidthF(1.0);
274 pa.setPen(pen);
275 pa.drawLine(1, 1, 1, 19);
276 pen.setStyle(Qt::DotLine);
277 pen.setWidthF(0.0);
278 pa.setPen(pen);
279 pa.drawLine(1, 19, 19, 19);
280 pa.drawLine(19, 19, 19, 1);
281 pa.drawLine(19, 1, 1, 1);
282 pa.end();
283 ui.tbBorderTypeLeft->setIcon(pm);
284
285 // top
286 pm.fill(Qt::transparent);
287 pa.begin(&pm);
288 pa.setRenderHint(QPainter::Antialiasing);
289 pen.setStyle(Qt::SolidLine);
290 pen.setWidthF(1.0);
291 pa.setPen(pen);
292 pa.drawLine(19, 1, 1, 1);
293 pen.setStyle(Qt::DotLine);
294 pen.setWidthF(0.0);
295 pa.setPen(pen);
296 pa.drawLine(1, 19, 19, 19);
297 pa.drawLine(1, 1, 1, 19);
298 pa.drawLine(19, 19, 19, 1);
299 pa.end();
300 ui.tbBorderTypeTop->setIcon(pm);
301
302 // right
303 pm.fill(Qt::transparent);
304 pa.begin(&pm);
305 pa.setRenderHint(QPainter::Antialiasing);
306 pen.setStyle(Qt::SolidLine);
307 pen.setWidthF(1.0);
308 pa.setPen(pen);
309 pa.drawLine(19, 19, 19, 1);
310 pen.setStyle(Qt::DotLine);
311 pen.setWidthF(0.0);
312 pa.setPen(pen);
313 pa.drawLine(1, 1, 1, 19);
314 pa.drawLine(1, 19, 19, 19);
315 pa.drawLine(19, 1, 1, 1);

Callers

nothing calls this directly

Calls 6

setPenMethod · 0.80
setColorMethod · 0.45
beginMethod · 0.45
setStyleMethod · 0.45
endMethod · 0.45
setIconMethod · 0.45

Tested by

no test coverage detected