|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QFrame
com.trolltech.qt.gui.QAbstractScrollArea
com.trolltech.qt.gui.QAbstractItemView
com.trolltech.qt.gui.QColumnView
public class QColumnView
The QColumnView class provides a model/view implementation of a column view.
QColumnView displays a model in a number of QListViews, one for each hierarchy in the tree. This is sometimes referred to as a cascading list.
The QColumnView class is one of the Model/View Classes and is part of Qt's model/view framework.
QColumnView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractItemView |
---|
QAbstractItemView.CursorAction, QAbstractItemView.DragDropMode, QAbstractItemView.DropIndicatorPosition, QAbstractItemView.EditTrigger, QAbstractItemView.EditTriggers, QAbstractItemView.ScrollHint, QAbstractItemView.ScrollMode, QAbstractItemView.SelectionBehavior, QAbstractItemView.SelectionMode, QAbstractItemView.State |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QFrame |
---|
QFrame.Shadow, QFrame.Shape, QFrame.StyleMask |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<QModelIndex> |
updatePreviewWidget
This signal is emitted when the preview widget should be updated to provide rich information about index |
Fields inherited from class com.trolltech.qt.gui.QAbstractItemView |
---|
activated, clicked, doubleClicked, entered, pressed, viewportEntered |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QColumnView()
Equivalent to QColumnView(0). |
|
QColumnView(QWidget parent)
Constructs a column view with a parent to represent a model's data. |
Method Summary | |
---|---|
java.util.List<java.lang.Integer> |
columnWidths()
Returns a list of the width of all the columns in this view. |
protected QAbstractItemView |
createColumn(QModelIndex rootIndex)
To use a custom widget for the final column when you select an item overload this function and return a widget. |
protected void |
currentChanged(QModelIndex current,
QModelIndex previous)
This slot is called when a new item becomes the current item. |
static QColumnView |
fromNativePointer(QNativePointer nativePointer)
This function returns the QColumnView instance pointed to by nativePointer |
protected int |
horizontalOffset()
Returns the horizontal offset of the view. |
QModelIndex |
indexAt(QPoint point)
Returns the model index of the item at the viewport coordinates point. |
protected boolean |
isIndexHidden(QModelIndex index)
Returns true if the item referred to by the given index is hidden in the view, otherwise returns false. |
protected QModelIndex |
moveCursor(QAbstractItemView.CursorAction cursorAction,
Qt.KeyboardModifiers modifiers)
Moves the cursor in the view according to the given cursorAction and keyboard modifiers specified by modifiers. |
QWidget |
previewWidget()
Returns the preview widget, or 0 if there is none. |
protected void |
resizeEvent(QResizeEvent event)
This function is called with the given event when a resize event is sent to the widget. |
boolean |
resizeGripsVisible()
Returns the way to specify if the list views gets resize grips or not. |
protected void |
scrollContentsBy(int dx,
int dy)
This virtual handler is called when the scroll bars are moved by dx, dy, and consequently the viewport's contents should be scrolled accordingly. |
void |
scrollTo(QModelIndex index,
QAbstractItemView.ScrollHint hint)
Scrolls the view if necessary to ensure that the item at index is visible. |
void |
selectAll()
Selects all non-hidden items. |
void |
setColumnWidths(java.util.List<java.lang.Integer> list)
Sets the column widths to the values given in the list. |
void |
setModel(QAbstractItemModel model)
Sets the model for the view to present. |
void |
setPreviewWidget(QWidget widget)
Sets the preview widget. |
void |
setResizeGripsVisible(boolean visible)
Sets the way to specify if the list views gets resize grips or not to visible. |
void |
setRootIndex(QModelIndex index)
Sets the root item to the item at the given index. |
protected void |
setSelection(QRect rect,
QItemSelectionModel.SelectionFlags command)
Applies the selection command to the items in or touched by the rectangle, rect. |
void |
setSelectionModel(QItemSelectionModel selectionModel)
Sets the current selection model to the given selectionModel. |
QSize |
sizeHint()
Returns the recommended size for the widget. If the value of this property is an invalid size, no size is recommended. The default implementation of sizeHint returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise. |
protected int |
verticalOffset()
Returns the vertical offset of the view. |
QRect |
visualRect(QModelIndex index)
Returns the rectangle on the viewport occupied by the item at index. |
protected QRegion |
visualRegionForSelection(QItemSelection selection)
Returns the region from the viewport of the items in the given selection. |
Methods inherited from class com.trolltech.qt.gui.QFrame |
---|
changeEvent, drawFrame, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<QModelIndex> updatePreviewWidget
This signal is emitted when the preview widget should be updated to provide rich information about index
Constructor Detail |
---|
public QColumnView()
Equivalent to QColumnView(0).
public QColumnView(QWidget parent)
Constructs a column view with a parent to represent a model's data. Use setModel to set the model.
Method Detail |
---|
public final java.util.List<java.lang.Integer> columnWidths()
Returns a list of the width of all the columns in this view.
public final QWidget previewWidget()
Returns the preview widget, or 0 if there is none.
public final boolean resizeGripsVisible()
Returns the way to specify if the list views gets resize grips or not.
By default, visible is set to true
public final void setColumnWidths(java.util.List<java.lang.Integer> list)
Sets the column widths to the values given in the list. Extra values in the list are kept and used when the columns are created.
If list contains too few values, only width of the rest of the columns will not be modified.
public final void setPreviewWidget(QWidget widget)
Sets the preview widget.
The widget becomes a child of the column view, and will be destroyed when the column area is deleted or when a new widget is set.
public final void setResizeGripsVisible(boolean visible)
Sets the way to specify if the list views gets resize grips or not to visible.
By default, visible is set to true
protected QAbstractItemView createColumn(QModelIndex rootIndex)
To use a custom widget for the final column when you select an item overload this function and return a widget. rootIndex is the root index that will be assigned to the view.
Return the new view. QColumnView will automatically take ownership of the widget.
protected void currentChanged(QModelIndex current, QModelIndex previous)
This slot is called when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.
If you want to know about changes to items see the dataChanged signal.
currentChanged
in class QAbstractItemView
protected int horizontalOffset()
Returns the horizontal offset of the view.
In the base class this is a pure virtual function.
horizontalOffset
in class QAbstractItemView
public QModelIndex indexAt(QPoint point)
Returns the model index of the item at the viewport coordinates point.
In the base class this is a pure virtual function.
indexAt
in class QAbstractItemView
protected boolean isIndexHidden(QModelIndex index)
Returns true if the item referred to by the given index is hidden in the view, otherwise returns false.
Hiding is a view specific feature. For example in TableView a column can be marked as hidden or a row in the TreeView.
In the base class this is a pure virtual function.
isIndexHidden
in class QAbstractItemView
protected QModelIndex moveCursor(QAbstractItemView.CursorAction cursorAction, Qt.KeyboardModifiers modifiers)
Moves the cursor in the view according to the given cursorAction and keyboard modifiers specified by modifiers.
In the base class this is a pure virtual function.
moveCursor
in class QAbstractItemView
protected void resizeEvent(QResizeEvent event)
This function is called with the given event when a resize event is sent to the widget.
resizeEvent
in class QAbstractItemView
protected void scrollContentsBy(int dx, int dy)
This virtual handler is called when the scroll bars are moved by dx, dy, and consequently the viewport's contents should be scrolled accordingly.
The default implementation simply calls update on the entire viewport, subclasses can reimplement this handler for optimization purposes, or - like QScrollArea - to move a contents widget. The parameters dx and dy are there for convenience, so that the class knows how much should be scrolled (useful e.g. when doing pixel-shifts). You may just as well ignore these values and scroll directly to the position the scroll bars indicate.
Calling this function in order to scroll programmatically is an error, use the scroll bars instead (e.g. by calling QScrollBar::setValue() directly).
scrollContentsBy
in class QAbstractScrollArea
public void scrollTo(QModelIndex index, QAbstractItemView.ScrollHint hint)
Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.
In the base class this is a pure virtual function.
scrollTo
in class QAbstractItemView
public void selectAll()
Selects all non-hidden items.
selectAll
in class QAbstractItemView
public void setModel(QAbstractItemModel model)
Sets the model for the view to present.
Note: This function will also create and set a new selection model, replacing any previously set with setSelectionModel, but the old selection model will not be deleted.
setModel
in class QAbstractItemView
public void setRootIndex(QModelIndex index)
Sets the root item to the item at the given index.
setRootIndex
in class QAbstractItemView
protected void setSelection(QRect rect, QItemSelectionModel.SelectionFlags command)
Applies the selection command to the items in or touched by the rectangle, rect.
When implementing your own itemview setSelection should call selectionModel->select(selection, flags) where selection is either an empty QModelIndex or a QItemSelection that contains all items that are contained in rect.
setSelection
in class QAbstractItemView
public void setSelectionModel(QItemSelectionModel selectionModel)
Sets the current selection model to the given selectionModel.
Note that, if you call setModel after this function, the given selectionModel will be replaced by a one created by the view.
setSelectionModel
in class QAbstractItemView
public QSize sizeHint()
Returns the recommended size for the widget.
If the value of this property is an invalid size, no size is recommended.
The default implementation of sizeHint returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise.
sizeHint
in class QAbstractScrollArea
protected int verticalOffset()
Returns the vertical offset of the view.
In the base class this is a pure virtual function.
verticalOffset
in class QAbstractItemView
public QRect visualRect(QModelIndex index)
Returns the rectangle on the viewport occupied by the item at index.
If your item is displayed in several areas then visualRect should return the primary area that contains index and not the complete area that index might encompasses, touch or cause drawing.
In the base class this is a pure virtual function.
visualRect
in class QAbstractItemView
protected QRegion visualRegionForSelection(QItemSelection selection)
Returns the region from the viewport of the items in the given selection.
In the base class this is a pure virtual function.
visualRegionForSelection
in class QAbstractItemView
public static QColumnView fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |