MCPcopy Create free account
hub / github.com/KDE/kdevelop / checkArea2

Method checkArea2

kdevplatform/sublime/tests/test_areaoperation.cpp:341–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void TestAreaOperation::checkArea2(MainWindow *mw)
342{
343 auto* const splitter = checkAreaCommon(mw);
344 RETURN_IF_TEST_FAILED();
345 Area *area = mw->area();
346
347 //check that we have 4 properly initialized containers
348 const QList<Container*> containers = splitter->findChildren<Sublime::Container*>();
349 QCOMPARE(containers.count(), 4);
350
351 int widgetCount = 0;
352 for (Container* c : containers) {
353 for (int i = 0; i < c->count(); ++i)
354 QVERIFY(c->widget(i) != nullptr);
355 widgetCount += c->count();
356 }
357
358 ViewCounter c;
359 area->walkViews(c, area->rootIndex());
360 QCOMPARE(widgetCount, c.count);
361
362 //check that we have 7 splitters: 2 vertical and 1 horizontal, rest is not split
363 QList<QSplitter*> splitters = splitter->findChildren<QSplitter*>();
364 splitters.append(qobject_cast<QSplitter*>(splitter));
365 QCOMPARE(splitters.count(), 6+1); //6 child splitters + 1 central itself = 7 splitters
366 int verticalSplitterCount = 0;
367 int horizontalSplitterCount = 0;
368 for (QSplitter* s : std::as_const(splitters)) {
369 if (s->count() == 1)
370 continue; //this is a splitter with container inside, its orientation is not relevant
371 if (s->orientation() == Qt::Vertical)
372 verticalSplitterCount += 1;
373 else
374 horizontalSplitterCount += 1;
375 }
376 QCOMPARE(verticalSplitterCount, 2);
377 QCOMPARE(horizontalSplitterCount, 1);
378}
379
380void TestAreaOperation::areaCloning()
381{

Callers

nothing calls this directly

Calls 8

checkAreaCommonFunction · 0.85
walkViewsMethod · 0.80
rootIndexMethod · 0.80
areaMethod · 0.45
countMethod · 0.45
widgetMethod · 0.45
appendMethod · 0.45
orientationMethod · 0.45

Tested by

no test coverage detected