Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{alias:qdelete}

Name

qdelete — delete object

...

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

...