com.trolltech.qt.gui
Enum QAbstractItemView.SelectionMode

java.lang.Object
  extended by java.lang.Enum<QAbstractItemView.SelectionMode>
      extended by com.trolltech.qt.gui.QAbstractItemView.SelectionMode
All Implemented Interfaces:
QtEnumerator, java.io.Serializable, java.lang.Comparable<QAbstractItemView.SelectionMode>
Enclosing class:
QAbstractItemView

public static enum QAbstractItemView.SelectionMode
extends java.lang.Enum<QAbstractItemView.SelectionMode>
implements QtEnumerator

This enum indicates how the view responds to user selections.

ConstantValueDescription
SingleSelection1When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item.
ContiguousSelection4When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item.
ExtendedSelection3When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them.
MultiSelection2When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone. Multiple items can be toggled by dragging the mouse over them.
NoSelection0Items cannot be selected.

The most commonly used modes are SingleSelection and ExtendedSelection.


Enum Constant Summary
ContiguousSelection
          When the user selects an item in the usual way, the selection is cleared and the new item selected.
ExtendedSelection
          When the user selects an item in the usual way, the selection is cleared and the new item selected.
MultiSelection
          When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone.
NoSelection
          Items cannot be selected.
SingleSelection
          When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item.
 
Method Summary
static QAbstractItemView.SelectionMode resolve(int value)
           
 int value()
           
static QAbstractItemView.SelectionMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static QAbstractItemView.SelectionMode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NoSelection

public static final QAbstractItemView.SelectionMode NoSelection

Items cannot be selected.


SingleSelection

public static final QAbstractItemView.SelectionMode SingleSelection

When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item.


MultiSelection

public static final QAbstractItemView.SelectionMode MultiSelection

When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone. Multiple items can be toggled by dragging the mouse over them.


ExtendedSelection

public static final QAbstractItemView.SelectionMode ExtendedSelection

When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them.


ContiguousSelection

public static final QAbstractItemView.SelectionMode ContiguousSelection

When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item.

Method Detail

values

public static final QAbstractItemView.SelectionMode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(QAbstractItemView.SelectionMode c : QAbstractItemView.SelectionMode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static QAbstractItemView.SelectionMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

value

public int value()
Specified by:
value in interface QtEnumerator

resolve

public static QAbstractItemView.SelectionMode resolve(int value)