Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QColumnView Class

The QColumnView class provides a model/view implementation of a column view. More...

 #include <QColumnView>

Inherits: QAbstractItemView.

This class was introduced in Qt 4.3.

Public Types

enum DragDropMode { NoDragDrop, DragOnly, DropOnly, DragDrop, InternalMove }
enum EditTrigger { NoEditTriggers, CurrentChanged, DoubleClicked, SelectedClicked, ..., AllEditTriggers }
flags EditTriggers
enum PaintDeviceMetric { PdmWidth, PdmHeight, PdmWidthMM, PdmHeightMM, ..., PdmPhysicalDpiY }
enum ScrollHint { EnsureVisible, PositionAtTop, PositionAtBottom, PositionAtCenter }
enum ScrollMode { ScrollPerItem, ScrollPerPixel }
enum SelectionBehavior { SelectItems, SelectRows, SelectColumns }
enum SelectionMode { SingleSelection, ContiguousSelection, ExtendedSelection, MultiSelection, NoSelection }

Properties

Public Functions

QAbstractItemView(QWidget * parent = 0)
QColumnView(QWidget * parent = 0)
~QAbstractItemView()
~QColumnView()
virtual ~QPaintDevice()
bool alternatingRowColors() const
int autoScrollMargin() const
void closePersistentEditor(const QModelIndex & index)
int colorCount() const
QList<int> columnWidths() const
QModelIndex currentIndex() const
Qt::DropAction defaultDropAction() const
int depth() const
DragDropMode dragDropMode() const
bool dragDropOverwriteMode() const
bool dragEnabled() const
EditTriggers editTriggers() const
bool hasAutoScroll() const
int height() const
int heightMM() const
ScrollMode horizontalScrollMode() const
QSize iconSize() const
virtual QModelIndex indexAt(const QPoint & point) const = 0
QWidget * indexWidget(const QModelIndex & index) const
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
QAbstractItemDelegate * itemDelegate() const
QAbstractItemDelegate * itemDelegate(const QModelIndex & index) const
QAbstractItemDelegate * itemDelegateForColumn(int column) const
QAbstractItemDelegate * itemDelegateForRow(int row) const
virtual void keyboardSearch(const QString & search)
int logicalDpiX() const
int logicalDpiY() const
QAbstractItemModel * model() const
void openPersistentEditor(const QModelIndex & index)
virtual QPaintEngine * paintEngine() const = 0
bool paintingActive() const
int physicalDpiX() const
int physicalDpiY() const
QWidget * previewWidget() const
bool resizeGripsVisible() const
QModelIndex rootIndex() const
virtual void scrollTo(const QModelIndex & index, ScrollHint hint = EnsureVisible) = 0
QAbstractItemView::SelectionBehavior selectionBehavior() const
QAbstractItemView::SelectionMode selectionMode() const
QItemSelectionModel * selectionModel() const
void setAlternatingRowColors(bool enable)
void setAutoScroll(bool enable)
void setAutoScrollMargin(int margin)
void setColumnWidths(const QList<int> & list)
void setDefaultDropAction(Qt::DropAction dropAction)
void setDragDropMode(DragDropMode behavior)
void setDragDropOverwriteMode(bool overwrite)
void setDragEnabled(bool enable)
void setDropIndicatorShown(bool enable)
void setEditTriggers(EditTriggers triggers)
void setHorizontalScrollMode(ScrollMode mode)
void setIconSize(const QSize & size)
void setIndexWidget(const QModelIndex & index, QWidget * widget)
void setItemDelegate(QAbstractItemDelegate * delegate)
void setItemDelegateForColumn(int column, QAbstractItemDelegate * delegate)
void setItemDelegateForRow(int row, QAbstractItemDelegate * delegate)
virtual void setModel(QAbstractItemModel * model)
void setPreviewWidget(QWidget * widget)
void setResizeGripsVisible(bool visible)
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
virtual void setSelectionModel(QItemSelectionModel * selectionModel)
void setTabKeyNavigation(bool enable)
void setTextElideMode(Qt::TextElideMode mode)
void setVerticalScrollMode(ScrollMode mode)
bool showDropIndicator() const
virtual int sizeHintForColumn(int column) const
QSize sizeHintForIndex(const QModelIndex & index) const
virtual int sizeHintForRow(int row) const
bool tabKeyNavigation() const
Qt::TextElideMode textElideMode() const
ScrollMode verticalScrollMode() const
virtual QRect visualRect(const QModelIndex & index) const = 0
int width() const
int widthMM() const

Reimplemented Public Functions

virtual QModelIndex indexAt(const QPoint & point) const
virtual void scrollTo(const QModelIndex & index, ScrollHint hint = EnsureVisible)
virtual void selectAll()
virtual void setModel(QAbstractItemModel * model)
virtual void setRootIndex(const QModelIndex & index)
virtual void setSelectionModel(QItemSelectionModel * newSelectionModel)
virtual QSize sizeHint() const
virtual QRect visualRect(const QModelIndex & index) const

Public Slots

void clearSelection()
void edit(const QModelIndex & index)
virtual void reset()
void scrollToBottom()
void scrollToTop()
virtual void selectAll()
void setCurrentIndex(const QModelIndex & index)
virtual void setRootIndex(const QModelIndex & index)
void update(const QModelIndex & index)
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Signals

void activated(const QModelIndex & index)
void clicked(const QModelIndex & index)
void doubleClicked(const QModelIndex & index)
void entered(const QModelIndex & index)
void pressed(const QModelIndex & index)
void updatePreviewWidget(const QModelIndex & index)
void viewportEntered()

Protected Types

enum CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, ..., MovePrevious }
enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport }
enum State { NoState, DraggingState, DragSelectingState, EditingState, ..., AnimatingState }

Protected Functions

QPaintDevice()
virtual QAbstractItemView * createColumn(const QModelIndex & index)
QPoint dirtyRegionOffset() const
virtual void dragEnterEvent(QDragEnterEvent * event)
virtual void dragLeaveEvent(QDragLeaveEvent * event)
virtual void dragMoveEvent(QDragMoveEvent * event)
virtual void dropEvent(QDropEvent * event)
DropIndicatorPosition dropIndicatorPosition() const
virtual bool edit(const QModelIndex & index, EditTrigger trigger, QEvent * event)
virtual bool event(QEvent * event)
void executeDelayedItemsLayout()
virtual void focusInEvent(QFocusEvent * event)
virtual bool focusNextPrevChild(bool next)
virtual void focusOutEvent(QFocusEvent * event)
virtual int horizontalOffset() const = 0
virtual void init(QPainter * painter) const
void initializeColumn(QAbstractItemView * column) const
virtual void inputMethodEvent(QInputMethodEvent * event)
virtual bool isIndexHidden(const QModelIndex & index) const = 0
virtual void keyPressEvent(QKeyEvent * event)
virtual int metric(PaintDeviceMetric metric) const
virtual void mouseDoubleClickEvent(QMouseEvent * event)
virtual void mouseMoveEvent(QMouseEvent * event)
virtual void mousePressEvent(QMouseEvent * event)
virtual void mouseReleaseEvent(QMouseEvent * event)
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) = 0
virtual QPaintDevice * redirected(QPoint * offset) const
virtual void resizeEvent(QResizeEvent * event)
void scheduleDelayedItemsLayout()
void scrollDirtyRegion(int dx, int dy)
virtual QModelIndexList selectedIndexes() const
virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex & index, const QEvent * event = 0) const
void setDirtyRegion(const QRegion & region)
virtual void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags flags) = 0
void setState(State state)
virtual QPainter * sharedPainter() const
virtual void startDrag(Qt::DropActions supportedActions)
State state() const
virtual void timerEvent(QTimerEvent * event)
virtual int verticalOffset() const = 0
virtual QStyleOptionViewItem viewOptions() const
virtual bool viewportEvent(QEvent * event)
virtual QRegion visualRegionForSelection(const QItemSelection & selection) const = 0

Reimplemented Protected Functions

virtual void currentChanged(const QModelIndex & current, const QModelIndex & previous)
virtual int horizontalOffset() const
virtual bool isIndexHidden(const QModelIndex & index) const
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
virtual void resizeEvent(QResizeEvent * event)
virtual void rowsInserted(const QModelIndex & parent, int start, int end)
virtual void scrollContentsBy(int dx, int dy)
virtual void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command)
virtual int verticalOffset() const
virtual QRegion visualRegionForSelection(const QItemSelection & selection) const

Protected Slots

virtual void closeEditor(QWidget * editor, QAbstractItemDelegate::EndEditHint hint)
virtual void commitData(QWidget * editor)
virtual void currentChanged(const QModelIndex & current, const QModelIndex & previous)
virtual void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QSet<int> & roles = QSet<int> ())
virtual void editorDestroyed(QObject * editor)
virtual void rowsAboutToBeRemoved(const QModelIndex & parent, int start, int end)
virtual void rowsInserted(const QModelIndex & parent, int start, int end)
virtual void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected)
virtual void updateGeometries()
  • 1 protected slot inherited from QWidget

Additional Inherited Members

  • 4 static public members inherited from QWidget
  • 11 static public members inherited from QObject

Detailed Description

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.

See also Model/View Programming.

Property Documentation

resizeGripsVisible : bool

This property holds the way to specify if the list views gets resize grips or not.

By default, visible is set to true

Access functions:

bool resizeGripsVisible() const
void setResizeGripsVisible(bool visible)

See also setRootIndex().

Member Function Documentation

QColumnView::QColumnView(QWidget * parent = 0)

Constructs a column view with a parent to represent a model's data. Use setModel() to set the model.

See also QAbstractItemModel.

QColumnView::~QColumnView()

Destroys the column view.

QList<int> QColumnView::columnWidths() const

Returns a list of the width of all the columns in this view.

See also setColumnWidths().

QAbstractItemView * QColumnView::createColumn(const QModelIndex & index) [virtual protected]

To use a custom widget for the final column when you select an item overload this function and return a widget. index is the root index that will be assigned to the view.

Return the new view. QColumnView will automatically take ownership of the widget.

See also setPreviewWidget().

void QColumnView::currentChanged(const QModelIndex & current, const QModelIndex & previous) [virtual protected]

Reimplemented from QAbstractItemView::currentChanged().

int QColumnView::horizontalOffset() const [virtual protected]

Reimplemented from QAbstractItemView::horizontalOffset().

QModelIndex QColumnView::indexAt(const QPoint & point) const [virtual]

Reimplemented from QAbstractItemView::indexAt().

void QColumnView::initializeColumn(QAbstractItemView * column) const [protected]

Copies the behavior and options of the column view and applies them to the column such as the iconSize(), textElideMode() and alternatingRowColors(). This can be useful when reimplementing createColumn().

This function was introduced in Qt 4.4.

See also createColumn().

bool QColumnView::isIndexHidden(const QModelIndex & index) const [virtual protected]

Reimplemented from QAbstractItemView::isIndexHidden().

QModelIndex QColumnView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) [virtual protected]

Reimplemented from QAbstractItemView::moveCursor().

Move left should go to the parent index Move right should go to the child index or down if there is no child

QWidget * QColumnView::previewWidget() const

Returns the preview widget, or 0 if there is none.

See also setPreviewWidget() and updatePreviewWidget().

void QColumnView::resizeEvent(QResizeEvent * event) [virtual protected]

Reimplemented from QWidget::resizeEvent().

void QColumnView::rowsInserted(const QModelIndex & parent, int start, int end) [virtual protected]

Reimplemented from QAbstractItemView::rowsInserted().

void QColumnView::scrollContentsBy(int dx, int dy) [virtual protected]

Reimplemented from QAbstractScrollArea::scrollContentsBy().

void QColumnView::scrollTo(const QModelIndex & index, ScrollHint hint = EnsureVisible) [virtual]

Reimplemented from QAbstractItemView::scrollTo().

void QColumnView::selectAll() [virtual]

Reimplemented from QAbstractItemView::selectAll().

void QColumnView::setColumnWidths(const QList<int> & 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.

See also columnWidths() and createColumn().

void QColumnView::setModel(QAbstractItemModel * model) [virtual]

Reimplemented from QAbstractItemView::setModel().

void QColumnView::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.

See also previewWidget() and updatePreviewWidget().

void QColumnView::setRootIndex(const QModelIndex & index) [virtual]

Reimplemented from QAbstractItemView::setRootIndex().

void QColumnView::setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) [virtual protected]

Reimplemented from QAbstractItemView::setSelection().

void QColumnView::setSelectionModel(QItemSelectionModel * newSelectionModel) [virtual]

Reimplemented from QAbstractItemView::setSelectionModel().

QSize QColumnView::sizeHint() const [virtual]

Reimplemented from QWidget::sizeHint().

void QColumnView::updatePreviewWidget(const QModelIndex & index) [signal]

This signal is emitted when the preview widget should be updated to provide rich information about index

See also previewWidget().

int QColumnView::verticalOffset() const [virtual protected]

Reimplemented from QAbstractItemView::verticalOffset().

QRect QColumnView::visualRect(const QModelIndex & index) const [virtual]

Reimplemented from QAbstractItemView::visualRect().

QRegion QColumnView::visualRegionForSelection(const QItemSelection & selection) const [virtual protected]

Reimplemented from QAbstractItemView::visualRegionForSelection().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web