• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaExtraComponents

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • plasmaextracomponents
  • qml
ConditionalLoader.qml
Go to the documentation of this file.
1 
20 import QtQuick 1.1
21 
30 Item {
31  id: root
32 
37  property alias when: loader.when
38 
46  property alias source: loader.conditionalSource
47 
52  property alias item: loader.item
53 
54  implicitWidth: loader.item ? loader.item.implicitWidth : 0
55  implicitHeight: loader.item ? loader.item.implicitHeight : 0
56 
57  Loader {
58  id: loader
59  anchors.fill: parent
60 
61  property bool when: false
62  property variant conditionalSource
63 
64  //internal
65  property variant oldConditionalSource
66 
67  onWhenChanged: loadTimer.restart()
68  onConditionalSourceChanged: loadTimer.restart()
69 
70  Timer {
71  id: loadTimer
72  interval: 0
73 
74  onTriggered: {
75  if (loader.when &&
76  (loader.item === null ||
77  loader.conditionalSource !== loader.oldConditionalSource)) {
78  if (typeof(loader.conditionalSource) === "string") {
79  loader.source = loader.conditionalSource
80  } else {
81  loader.sourceComponent = loader.conditionalSource
82  }
83  loader.oldConditionalSource = loader.conditionalSource
84  loader.item.visible = true
85  loader.item.anchors.fill = loader.item.parent
86  }
87  }
88  }
89  }
90 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaExtraComponents

Skip menu "PlasmaExtraComponents"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal