openshot-audio
0.1.2
|
#include <juce_gui_basics.h>
Classes | |
class | ContentComponent |
struct | InsertPoint |
class | InsertPointHighlight |
struct | LookAndFeelMethods |
class | TargetGroupHighlight |
class | TreeViewport |
Public Types | |
enum | ColourIds { backgroundColourId = 0x1000500, linesColourId = 0x1000501, dragAndDropIndicatorColourId = 0x1000502, selectedItemBackgroundColourId = 0x1000503 } |
![]() | |
enum | FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly } |
Public Member Functions | |
TreeView (const String &componentName=String::empty) | |
~TreeView () | |
void | setRootItem (TreeViewItem *newRootItem) |
TreeViewItem * | getRootItem () const noexcept |
void | deleteRootItem () |
void | setRootItemVisible (bool shouldBeVisible) |
bool | isRootItemVisible () const noexcept |
void | setDefaultOpenness (bool isOpenByDefault) |
bool | areItemsOpenByDefault () const noexcept |
void | setMultiSelectEnabled (bool canMultiSelect) |
bool | isMultiSelectEnabled () const noexcept |
void | setOpenCloseButtonsVisible (bool shouldBeVisible) |
bool | areOpenCloseButtonsVisible () const noexcept |
void | clearSelectedItems () |
int | getNumSelectedItems (int maximumDepthToSearchTo=-1) const noexcept |
TreeViewItem * | getSelectedItem (int index) const noexcept |
void | moveSelectedRow (int deltaRows) |
int | getNumRowsInTree () const |
TreeViewItem * | getItemOnRow (int index) const |
TreeViewItem * | getItemAt (int yPosition) const noexcept |
void | scrollToKeepItemVisible (TreeViewItem *item) |
Viewport * | getViewport () const noexcept |
int | getIndentSize () noexcept |
void | setIndentSize (int newIndentSize) |
TreeViewItem * | findItemFromIdentifierString (const String &identifierString) const |
XmlElement * | getOpennessState (bool alsoIncludeScrollPosition) const |
void | restoreOpennessState (const XmlElement &newState, bool restoreStoredSelection) |
void | paint (Graphics &) override |
void | resized () override |
bool | keyPressed (const KeyPress &) override |
void | colourChanged () override |
void | enablementChanged () override |
bool | isInterestedInFileDrag (const StringArray &files) override |
void | fileDragEnter (const StringArray &files, int x, int y) override |
void | fileDragMove (const StringArray &files, int x, int y) override |
void | fileDragExit (const StringArray &files) override |
void | filesDropped (const StringArray &files, int x, int y) override |
bool | isInterestedInDragSource (const SourceDetails &) override |
void | itemDragEnter (const SourceDetails &) override |
void | itemDragMove (const SourceDetails &) override |
void | itemDragExit (const SourceDetails &) override |
void | itemDropped (const SourceDetails &) override |
![]() | |
Component () noexcept | |
virtual | ~Component () |
Component (const String &componentName) noexcept | |
const String & | getName () const noexcept |
virtual void | setName (const String &newName) |
const String & | getComponentID () const noexcept |
void | setComponentID (const String &newID) |
virtual void | setVisible (bool shouldBeVisible) |
bool | isVisible () const noexcept |
virtual void | visibilityChanged () |
bool | isShowing () const |
virtual void | addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr) |
void | removeFromDesktop () |
bool | isOnDesktop () const noexcept |
ComponentPeer * | getPeer () const |
virtual void | userTriedToCloseWindow () |
virtual void | minimisationStateChanged (bool isNowMinimised) |
virtual float | getDesktopScaleFactor () const |
void | toFront (bool shouldAlsoGainFocus) |
void | toBack () |
void | toBehind (Component *other) |
void | setAlwaysOnTop (bool shouldStayOnTop) |
bool | isAlwaysOnTop () const noexcept |
int | getX () const noexcept |
int | getY () const noexcept |
int | getWidth () const noexcept |
int | getHeight () const noexcept |
int | getRight () const noexcept |
Point< int > | getPosition () const noexcept |
int | getBottom () const noexcept |
const Rectangle< int > & | getBounds () const noexcept |
Rectangle< int > | getLocalBounds () const noexcept |
Rectangle< int > | getBoundsInParent () const noexcept |
int | getScreenX () const |
int | getScreenY () const |
Point< int > | getScreenPosition () const |
Rectangle< int > | getScreenBounds () const |
Point< int > | getLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const |
Point< float > | getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const |
Rectangle< int > | getLocalArea (const Component *sourceComponent, const Rectangle< int > &areaRelativeToSourceComponent) const |
Point< int > | localPointToGlobal (Point< int > localPoint) const |
Point< float > | localPointToGlobal (Point< float > localPoint) const |
Rectangle< int > | localAreaToGlobal (const Rectangle< int > &localArea) const |
void | setTopLeftPosition (int x, int y) |
void | setTopLeftPosition (Point< int > newTopLeftPosition) |
void | setTopRightPosition (int x, int y) |
void | setSize (int newWidth, int newHeight) |
void | setBounds (int x, int y, int width, int height) |
void | setBounds (const Rectangle< int > &newBounds) |
void | setBounds (const RelativeRectangle &newBounds) |
void | setBounds (const String &newBoundsExpression) |
void | setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight) |
void | setBoundsInset (const BorderSize< int > &borders) |
void | setBoundsToFit (int x, int y, int width, int height, Justification justification, bool onlyReduceInSize) |
void | setCentrePosition (int x, int y) |
void | setCentreRelative (float x, float y) |
void | centreWithSize (int width, int height) |
void | setTransform (const AffineTransform &transform) |
AffineTransform | getTransform () const |
bool | isTransformed () const noexcept |
int | proportionOfWidth (float proportion) const noexcept |
int | proportionOfHeight (float proportion) const noexcept |
int | getParentWidth () const noexcept |
int | getParentHeight () const noexcept |
Rectangle< int > | getParentMonitorArea () const |
int | getNumChildComponents () const noexcept |
Component * | getChildComponent (int index) const noexcept |
int | getIndexOfChildComponent (const Component *child) const noexcept |
Component * | findChildWithID (StringRef componentID) const noexcept |
void | addChildComponent (Component *child, int zOrder=-1) |
void | addChildComponent (Component &child, int zOrder=-1) |
void | addAndMakeVisible (Component *child, int zOrder=-1) |
void | addAndMakeVisible (Component &child, int zOrder=-1) |
void | addChildAndSetID (Component *child, const String &componentID) |
void | removeChildComponent (Component *childToRemove) |
Component * | removeChildComponent (int childIndexToRemove) |
void | removeAllChildren () |
void | deleteAllChildren () |
Component * | getParentComponent () const noexcept |
template<class TargetClass > | |
TargetClass * | findParentComponentOfClass () const |
Component * | getTopLevelComponent () const noexcept |
bool | isParentOf (const Component *possibleChild) const noexcept |
virtual void | parentHierarchyChanged () |
virtual void | childrenChanged () |
virtual bool | hitTest (int x, int y) |
void | setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept |
void | getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept |
bool | contains (Point< int > localPoint) |
bool | reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild) |
Component * | getComponentAt (int x, int y) |
Component * | getComponentAt (Point< int > position) |
void | repaint () |
void | repaint (int x, int y, int width, int height) |
void | repaint (const Rectangle< int > &area) |
void | setBufferedToImage (bool shouldBeBuffered) |
Image | createComponentSnapshot (const Rectangle< int > &areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f) |
void | paintEntireComponent (Graphics &context, bool ignoreAlphaLevel) |
void | setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept |
void | setComponentEffect (ImageEffectFilter *newEffect) |
ImageEffectFilter * | getComponentEffect () const noexcept |
LookAndFeel & | getLookAndFeel () const noexcept |
void | setLookAndFeel (LookAndFeel *newLookAndFeel) |
virtual void | lookAndFeelChanged () |
void | sendLookAndFeelChange () |
void | setOpaque (bool shouldBeOpaque) |
bool | isOpaque () const noexcept |
void | setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept |
bool | isBroughtToFrontOnMouseClick () const noexcept |
void | setWantsKeyboardFocus (bool wantsFocus) noexcept |
bool | getWantsKeyboardFocus () const noexcept |
void | setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus) |
bool | getMouseClickGrabsKeyboardFocus () const noexcept |
void | grabKeyboardFocus () |
bool | hasKeyboardFocus (bool trueIfChildIsFocused) const |
void | moveKeyboardFocusToSibling (bool moveToNext) |
virtual KeyboardFocusTraverser * | createFocusTraverser () |
int | getExplicitFocusOrder () const |
void | setExplicitFocusOrder (int newFocusOrderIndex) |
void | setFocusContainer (bool shouldBeFocusContainer) noexcept |
bool | isFocusContainer () const noexcept |
bool | isEnabled () const noexcept |
void | setEnabled (bool shouldBeEnabled) |
void | setAlpha (float newAlpha) |
float | getAlpha () const |
void | setMouseCursor (const MouseCursor &cursorType) |
virtual MouseCursor | getMouseCursor () |
void | updateMouseCursor () const |
virtual void | paintOverChildren (Graphics &g) |
virtual void | mouseMove (const MouseEvent &event) override |
virtual void | mouseEnter (const MouseEvent &event) override |
virtual void | mouseExit (const MouseEvent &event) override |
virtual void | mouseDown (const MouseEvent &event) override |
virtual void | mouseDrag (const MouseEvent &event) override |
virtual void | mouseUp (const MouseEvent &event) override |
virtual void | mouseDoubleClick (const MouseEvent &event) override |
virtual void | mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) override |
virtual void | mouseMagnify (const MouseEvent &event, float scaleFactor) |
void | setRepaintsOnMouseActivity (bool shouldRepaint) noexcept |
void | addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents) |
void | removeMouseListener (MouseListener *listenerToRemove) |
void | addKeyListener (KeyListener *newListener) |
void | removeKeyListener (KeyListener *listenerToRemove) |
virtual bool | keyStateChanged (bool isKeyDown) |
virtual void | modifierKeysChanged (const ModifierKeys &modifiers) |
virtual void | focusGained (FocusChangeType cause) |
virtual void | focusLost (FocusChangeType cause) |
virtual void | focusOfChildComponentChanged (FocusChangeType cause) |
bool | isMouseOver (bool includeChildren=false) const |
bool | isMouseButtonDown () const |
bool | isMouseOverOrDragging () const |
Point< int > | getMouseXYRelative () const |
virtual void | moved () |
virtual void | childBoundsChanged (Component *child) |
virtual void | parentSizeChanged () |
virtual void | broughtToFront () |
void | addComponentListener (ComponentListener *newListener) |
void | removeComponentListener (ComponentListener *listenerToRemove) |
void | postCommandMessage (int commandId) |
virtual void | handleCommandMessage (int commandId) |
int | runModalLoop () |
void | enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false) |
void | exitModalState (int returnValue) |
bool | isCurrentlyModal () const noexcept |
bool | isCurrentlyBlockedByAnotherModalComponent () const |
virtual bool | canModalEventBeSentToComponent (const Component *targetComponent) |
virtual void | inputAttemptWhenModal () |
NamedValueSet & | getProperties () noexcept |
const NamedValueSet & | getProperties () const noexcept |
Colour | findColour (int colourId, bool inheritFromParent=false) const |
void | setColour (int colourId, Colour newColour) |
void | removeColour (int colourId) |
bool | isColourSpecified (int colourId) const |
void | copyAllExplicitColoursTo (Component &target) const |
virtual MarkerList * | getMarkers (bool xAxis) |
void * | getWindowHandle () const |
Positioner * | getPositioner () const noexcept |
void | setPositioner (Positioner *newPositioner) |
void | setCachedComponentImage (CachedComponentImage *newCachedImage) |
CachedComponentImage * | getCachedComponentImage () const noexcept |
JUCE_DEPRECATED (Point< int > relativePositionToGlobal(Point< int >) const) | |
JUCE_DEPRECATED (Point< int > globalPositionToRelative(Point< int >) const) | |
JUCE_DEPRECATED (Point< int > relativePositionToOtherComponent(const Component *, Point< int >) const) | |
![]() | |
virtual | ~MouseListener () |
![]() | |
virtual | ~SettableTooltipClient () |
virtual void | setTooltip (const String &newTooltip) |
virtual String | getTooltip () |
![]() | |
virtual | ~TooltipClient () |
![]() | |
virtual | ~FileDragAndDropTarget () |
![]() | |
virtual | ~DragAndDropTarget () |
virtual bool | shouldDrawDragImageWhenOver () |
Friends | |
class | TreeViewItem |
class | ContentComponent |
struct | ContainerDeletePolicy< TreeViewport > |
struct | ContainerDeletePolicy< InsertPointHighlight > |
struct | ContainerDeletePolicy< TargetGroupHighlight > |
Additional Inherited Members | |
![]() | |
static Component *JUCE_CALLTYPE | getCurrentlyFocusedComponent () noexcept |
static void JUCE_CALLTYPE | unfocusAllComponents () |
static void JUCE_CALLTYPE | beginDragAutoRepeat (int millisecondsBetweenCallbacks) |
static bool JUCE_CALLTYPE | isMouseButtonDownAnywhere () noexcept |
static int JUCE_CALLTYPE | getNumCurrentlyModalComponents () noexcept |
static Component *JUCE_CALLTYPE | getCurrentlyModalComponent (int index=0) noexcept |
![]() | |
virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
![]() | |
SettableTooltipClient () | |
A tree-view component.
Use one of these to hold and display a structure of TreeViewItem objects.
A set of colour IDs to use to change the colour of various aspects of the treeview.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
TreeView::TreeView | ( | const String & | componentName = String::empty | ) |
Creates an empty treeview.
Once you've got a treeview component, you'll need to give it something to display, using the setRootItem() method.
TreeView::~TreeView | ( | ) |
Destructor.
|
inlinenoexcept |
Returns true if the tree's items default to being open.
|
inlinenoexcept |
Returns whether open/close buttons are shown.
void TreeView::clearSelectedItems | ( | ) |
Deselects any items that are currently selected.
|
overridevirtual |
This method is called when a colour is changed by the setColour() method.
Reimplemented from juce::Component.
void TreeView::deleteRootItem | ( | ) |
This will remove and delete the current root item. It's a convenient way of deleting the item and calling setRootItem (nullptr).
|
overridevirtual |
Callback to indicate that this component has been enabled or disabled.
This can be triggered by one of the component's parent components being enabled or disabled, as well as changes to the component itself.
The default implementation of this method does nothing; your class may wish to repaint itself or something when this happens.
Reimplemented from juce::Component.
|
overridevirtual |
Callback to indicate that some files are being dragged over this component.
This gets called when the user moves the mouse into this component while dragging.
Use this callback as a trigger to make your component repaint itself to give the user feedback about whether the files can be dropped here or not.
files | the set of (absolute) pathnames of the files that the user is dragging |
x | the mouse x position, relative to this component |
y | the mouse y position, relative to this component |
Reimplemented from juce::FileDragAndDropTarget.
|
overridevirtual |
Callback to indicate that the mouse has moved away from this component.
This gets called when the user moves the mouse out of this component while dragging the files.
If you've used fileDragEnter() to repaint your component and give feedback, use this as a signal to repaint it in its normal state.
files | the set of (absolute) pathnames of the files that the user is dragging |
Reimplemented from juce::FileDragAndDropTarget.
|
overridevirtual |
Callback to indicate that the user is dragging some files over this component.
This gets called when the user moves the mouse over this component while dragging. Normally overriding itemDragEnter() and itemDragExit() are enough, but this lets you know what happens in-between.
files | the set of (absolute) pathnames of the files that the user is dragging |
x | the mouse x position, relative to this component |
y | the mouse y position, relative to this component |
Reimplemented from juce::FileDragAndDropTarget.
|
overridevirtual |
Callback to indicate that the user has dropped the files onto this component.
When the user drops the files, this get called, and you can use the files in whatever way is appropriate.
Note that after this is called, the fileDragExit method may not be called, so you should clean up in here if there's anything you need to do when the drag finishes.
files | the set of (absolute) pathnames of the files that the user is dragging |
x | the mouse x position, relative to this component |
y | the mouse y position, relative to this component |
Implements juce::FileDragAndDropTarget.
TreeViewItem * TreeView::findItemFromIdentifierString | ( | const String & | identifierString | ) | const |
Searches the tree for an item with the specified identifier. The identifier string must have been created by calling TreeViewItem::getItemIdentifierString(). If no such item exists, this will return false. If the item is found, all of its items will be automatically opened.
|
noexcept |
Returns the number of pixels by which each nested level of the tree is indented.
|
noexcept |
Returns the item that contains a given y position. The y is relative to the top of the TreeView component.
TreeViewItem * TreeView::getItemOnRow | ( | int | index | ) | const |
Returns the item on a particular row of the tree. If the index is out of range, this will return nullptr.
int TreeView::getNumRowsInTree | ( | ) | const |
Returns the number of rows the tree is using. This will depend on which items are open.
|
noexcept |
Returns the number of items that are currently selected. If maximumDepthToSearchTo is >= 0, it lets you specify a maximum depth to which the tree will be recursed.
XmlElement * TreeView::getOpennessState | ( | bool | alsoIncludeScrollPosition | ) | const |
Saves the current state of open/closed nodes so it can be restored later.
This takes a snapshot of which nodes have been explicitly opened or closed, and records it as XML. To identify node objects it uses the TreeViewItem::getUniqueName() method to create named paths. This means that the same state of open/closed nodes can be restored to a completely different instance of the tree, as long as it contains nodes whose unique names are the same.
The caller is responsible for deleting the object that is returned.
alsoIncludeScrollPosition | if this is true, the state will also include information about where the tree has been scrolled to vertically, so this can also be restored |
|
inlinenoexcept |
Returns the tree's root item.
This will be the last object passed to setRootItem(), or nullptr if none has been set.
|
noexcept |
Returns one of the selected items in the tree.
index | the index, 0 to (getNumSelectedItems() - 1) |
|
overridevirtual |
Callback to check whether this target is interested in the type of object being dragged.
dragSourceDetails | contains information about the source of the drag operation. |
Implements juce::DragAndDropTarget.
|
overridevirtual |
Callback to check whether this target is interested in the set of files being offered.
Note that this will be called repeatedly when the user is dragging the mouse around over your component, so don't do anything time-consuming in here, like opening the files to have a look inside them!
files | the set of (absolute) pathnames of the files that the user is dragging |
Implements juce::FileDragAndDropTarget.
|
inlinenoexcept |
Returns whether multi-select has been enabled for the tree.
|
inlinenoexcept |
Returns true if the root item is visible.
|
overridevirtual |
Callback to indicate that something is being dragged over this component.
This gets called when the user moves the mouse into this component while dragging something.
Use this callback as a trigger to make your component repaint itself to give the user feedback about whether the item can be dropped here or not.
dragSourceDetails | contains information about the source of the drag operation. |
Reimplemented from juce::DragAndDropTarget.
|
overridevirtual |
Callback to indicate that something has been dragged off the edge of this component.
This gets called when the user moves the mouse out of this component while dragging something.
If you've used itemDragEnter() to repaint your component and give feedback, use this as a signal to repaint it in its normal state.
dragSourceDetails | contains information about the source of the drag operation. |
Reimplemented from juce::DragAndDropTarget.
|
overridevirtual |
Callback to indicate that the user is dragging something over this component.
This gets called when the user moves the mouse over this component while dragging something. Normally overriding itemDragEnter() and itemDragExit() are enough, but this lets you know what happens in-between.
dragSourceDetails | contains information about the source of the drag operation. |
Reimplemented from juce::DragAndDropTarget.
|
overridevirtual |
Callback to indicate that the user has dropped something onto this component.
When the user drops an item this get called, and you can use the description to work out whether your object wants to deal with it or not.
Note that after this is called, the itemDragExit method may not be called, so you should clean up in here if there's anything you need to do when the drag finishes.
dragSourceDetails | contains information about the source of the drag operation. |
Implements juce::DragAndDropTarget.
|
overridevirtual |
Called when a key is pressed.
When a key is pressed, the component that has the keyboard focus will have this method called. Remember that a component will only be given the focus if its setWantsKeyboardFocus() method has been used to enable this.
If your implementation returns true, the event will be consumed and not passed on to any other listeners. If it returns false, the key will be passed to any KeyListeners that have been registered with this component. As soon as one of these returns true, the process will stop, but if they all return false, the event will be passed upwards to this component's parent, and so on.
The default implementation of this method does nothing and returns false.
Reimplemented from juce::Component.
void TreeView::moveSelectedRow | ( | int | deltaRows | ) |
Moves the selected row up or down by the specified number of rows.
|
overridevirtual |
Components can override this method to draw their content.
The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.
Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.
If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In Juce (and almost all modern UI frameworks), you never redraw something synchronously.
You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().
g | the graphics context that must be used to do the drawing operations. |
Reimplemented from juce::Component.
|
overridevirtual |
Called when this component's size has been changed.
A component can implement this method to do things such as laying out its child components when its width or height changes.
The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).
If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.
Reimplemented from juce::Component.
void TreeView::restoreOpennessState | ( | const XmlElement & | newState, |
bool | restoreStoredSelection | ||
) |
Restores a previously saved arrangement of open/closed nodes.
This will try to restore a snapshot of the tree's state that was created by the getOpennessState() method. If any of the nodes named in the original XML aren't present in this tree, they will be ignored.
If restoreStoredSelection is true, it will also try to re-select any items that were selected in the stored state.
void TreeView::scrollToKeepItemVisible | ( | TreeViewItem * | item | ) |
Tries to scroll the tree so that this item is on-screen somewhere.
void TreeView::setDefaultOpenness | ( | bool | isOpenByDefault | ) |
Sets whether items are open or closed by default.
Normally, items are closed until the user opens them, but you can use this to make them default to being open until explicitly closed.
void TreeView::setIndentSize | ( | int | newIndentSize | ) |
Changes the distance by which each nested level of the tree is indented.
void TreeView::setMultiSelectEnabled | ( | bool | canMultiSelect | ) |
This sets a flag to indicate that the tree can be used for multi-selection.
You can always select multiple items internally by calling the TreeViewItem::setSelected() method, but this flag indicates whether the user is allowed to multi-select by clicking on the tree.
By default it is disabled.
void TreeView::setOpenCloseButtonsVisible | ( | bool | shouldBeVisible | ) |
Sets a flag to indicate whether to hide the open/close buttons.
void TreeView::setRootItem | ( | TreeViewItem * | newRootItem | ) |
Sets the item that is displayed in the treeview.
A tree has a single root item which contains as many sub-items as it needs. If you want the tree to contain a number of root items, you should still use a single root item above these, but hide it using setRootItemVisible().
You can pass nullptr to this method to clear the tree and remove its current root item.
The object passed in will not be deleted by the treeview, it's up to the caller to delete it when no longer needed. BUT make absolutely sure that you don't delete this item until you've removed it from the tree, either by calling setRootItem (nullptr), or by deleting the tree first. You can also use deleteRootItem() as a quick way to delete it.
void TreeView::setRootItemVisible | ( | bool | shouldBeVisible | ) |
Changes whether the tree's root item is shown or not.
If the root item is hidden, only its sub-items will be shown in the treeview - this lets you make the tree look as if it's got many root items. If it's hidden, this call will also make sure the root item is open (otherwise the treeview would look empty).
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |