Skip to content

UniDeskComBase Type

Component base control. All editable components in the visual editor inherit from UniDeskComBase. Provides core capabilities including drag-to-move, selection, context menu, rectangular border editing, and property persistence.

ItemDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskComBase.qml
InheritsQtQuick Item
QML Importimport UniDesk.Controls 1.0

Editor Only

This control is primarily intended for internal use by the Uniquenium visual editor. Regular developers can refer to its implementation when building custom components.

Custom Properties

PropertyTypeDefaultDescription
namestringComponent name
typestringComponent type
identificationstringUnique identifier
pageidstringParent page ID
canMoveboolchosenAllow drag-to-move
indicatedboolfalseShow indicator tooltip
selectedboolfalseIs selected
chosenboolfalseIs chosen (rect editor visibility)
comManagervarComponent manager reference
optionsWindowvarProperty panel window
marginsint4Margins
edgesint0Drag edge flags
movingboolfalseCurrently dragging
movedboolfalseHas been moved
itemOpacityreal1Component opacity
defaultRightClickMenubooltrueUse default context menu
pluginDirstring""Plugin directory
controlHoveredboolHover state
bgaliasrect_bgBackground rectangle alias
controlPressedaliasmouseArea.pressedPressed state alias

Signals

SignalDescription
closeSignal()Emitted on application quit
focusOut()Focus lost
leftClicked()Left click
rightClicked()Right click
endDrag()Drag ended
componentCompleted()Component initialization complete

Methods

MethodDescription
deleteCom()Delete component
copyCom()Copy component
createSubComponent()Create child component
containsGlobalPoint(point)Check if point is inside component
changeParentWithoutMovingAndSave(p)Reparent and save
currentLayer()Get current layer (Desktop/Wallpaper/TopMost)
isAncestorOf(p)Check if ancestor of another component
propertyData()Export property data as dict
loadPropertyData(data)Load property data from dict
saveComToFile()Save component to file

Context Menu

Default context menu includes:

  • Edit — Open property panel
  • Copy — Copy component
  • New Subcomponent — Create child component
  • Delete — Delete component

Example

qml
import UniDesk.Controls 1.0

UniDeskComBase {
    comManager: comManager
    name: "My Component"
    type: "UDCFrame"
    identification: "unique-id-001"
    pageid: "page-1"
}

Released under the CC BY-SA 4.0 open documentation license.