Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoDocumentResourceManager.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | * | 44 | * | ||
45 | * The properties come from the KoDocumentResourceManager::DocumentResource | 45 | * The properties come from the KoDocumentResourceManager::DocumentResource | ||
46 | * See KoShapeController::resourceManager | 46 | * See KoShapeController::resourceManager | ||
47 | * | 47 | * | ||
48 | * The manager can contain all sorts of variable types and there are accessors | 48 | * The manager can contain all sorts of variable types and there are accessors | ||
49 | * for the most common ones. All variables are always stored inside a QVariant | 49 | * for the most common ones. All variables are always stored inside a QVariant | ||
50 | * instance internally and you can always just use the resource() method to get | 50 | * instance internally and you can always just use the resource() method to get | ||
51 | * that directly. | 51 | * that directly. | ||
52 | * The way to store arbitairy data objects that are stored as pointers you can use | 52 | * The way to store arbitrary data objects that are stored as pointers you can use | ||
53 | * the following code snippets; | 53 | * the following code snippets; | ||
54 | * @code | 54 | * @code | ||
55 | * QVariant variant; | 55 | * QVariant variant; | ||
56 | * variant.setValue<void*>(textShapeData->document()); | 56 | * variant.setValue<void*>(textShapeData->document()); | ||
57 | * resourceManager->setResource(KoText::CurrentTextDocument, variant); | 57 | * resourceManager->setResource(KoText::CurrentTextDocument, variant); | ||
58 | * // and get it out again. | 58 | * // and get it out again. | ||
59 | * QVariant var = resourceManager->resource(KoText::CurrentTextDocument); | 59 | * QVariant var = resourceManager->resource(KoText::CurrentTextDocument); | ||
60 | * document = static_cast<QTextDocument*>(var.value<void*>()); | 60 | * document = static_cast<QTextDocument*>(var.value<void*>()); | ||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |