11#include "calendarsupport_debug.h"
12#include <KLocalizedString>
14using namespace CalendarSupport;
16void CellItem::setSubCells(
int v)
21int CellItem::subCells()
const
26void CellItem::setSubCell(
int v)
31int CellItem::subCell()
const
38 return xi18n(
"<placeholder>undefined</placeholder>");
48 for (
int i = 0; i < overlappingItems.count(); i++) {
49 const auto checkItem = overlappingItems.at(i);
50 for (
const auto item : cells) {
51 if (item->overlaps(checkItem) && !overlappingItems.contains(item)) {
52 qCDebug(CALENDARSUPPORT_LOG) << item->label() <<
"overlaps" << checkItem->label();
53 overlappingItems.append(item);
54 if (item->subCell() >= maxSubCells) {
55 maxSubCells = item->subCells();
57 if (checkItem == placeItem) {
58 subCellsInUse.
insert(item->subCell());
64 if (overlappingItems.count() > 1) {
68 for (i = 0; i < maxSubCells; ++i) {
73 placeItem->setSubCell(i);
74 if (i == maxSubCells) {
76 for (
auto item : overlappingItems) {
77 item->setSubCells(maxSubCells);
80 placeItem->setSubCells(maxSubCells);
81 qCDebug(CALENDARSUPPORT_LOG) <<
"use subcell" << i <<
"of" << maxSubCells;
84 overlappingItems.clear();
85 placeItem->setSubCell(0);
86 placeItem->setSubCells(1);
89 return overlappingItems;
QString xi18n(const char *text, const TYPE &arg...)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:28 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.