Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Name

qdelete — delete object

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

qdelete [widget]

qdelete [treeitem]

qdelete [tableitem]

Description

The qdelete deletes an widget or item from memory. Any children the widget may have are also deleted. If the object is drawn on the screen it will be erased.

To make a widget invisible without deleting it use the qclose command. Many applications do not need qdelete, but rely on qshow, qclose, and qraise to manage visibility/invisibility issues.

Arguments

widget

The widget to be deleted. If this argument is omitted the current widget will be used.

treeitem

An item in a qtreewidget. If this argument is omitted the current treeitem will be used.

tableitem

An item in a qtablewidget. If this argument is omitted the current tableitem will be used.

Examples

Ex.1: Delete

Anchor
Delete
Delete

No Format
bgColor#eeeeee
borderWidth1
set w1 [qwidget ]
qsetwindowtitle "Window 1"

set w2 [qwidget]
qsetwindowtitle "Window 2"

set layout [qvboxlayout $w1]
set button [qpushbutton "Delete W2" { qdelete $w2 } ]
qaddwidget $layout $button

qshow $w1
qshow $w2

{noformat}

!att:_img_cmd^qdelete.png!

The above script creates two windows - pressing the button will delete the windows titled "Window 2". 


{pagebreak}

Image Added

The above script creates two windows - pressing the button will delete the windows titled "Window 2".