• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • collection
containerview.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 // Own
17 #include "containerview.h"
18 
19 // Qt
20 #include <QHeaderView>
21 
22 // Parley/collection
23 #include "containermodel.h"
24 
25 
26 ContainerView::ContainerView(QWidget *parent) : QTreeView(parent)
27 {
28  header()->setStretchLastSection(false);
29  header()->setVisible(false);
30 
31  setAlternatingRowColors(true);
32 
33  // show the actions added by addAction() as right click menu.
34  setContextMenuPolicy(Qt::ActionsContextMenu);
35 
36  setDragEnabled(true);
37  setAcceptDrops(true);
38  setDropIndicatorShown(true);
39  setDragDropMode(QAbstractItemView::DragDrop);
40 }
41 
42 void ContainerView::setModel(ContainerModel *model)
43 {
44  QTreeView::setModel(model);
45  m_model = model;
46 
47  header()->setResizeMode(0, QHeaderView::Stretch);
48  header()->setResizeMode(1, QHeaderView::ResizeToContents);
49 }
50 
51 void ContainerView::slotRename()
52 {
53  edit(selectionModel()->currentIndex());
54 }
55 
56 #include "containerview.moc"
57 
58 
QWidget
QAbstractItemView::setAlternatingRowColors
void setAlternatingRowColors(bool enable)
QAbstractItemView::selectionModel
QItemSelectionModel * selectionModel() const
QAbstractItemView::setDragDropMode
void setDragDropMode(DragDropMode behavior)
QWidget::setVisible
virtual void setVisible(bool visible)
ContainerView::slotRename
void slotRename()
let the user type a new name for the container
Definition: containerview.cpp:51
ContainerView::setModel
virtual void setModel(ContainerModel *model)
Set the model for the view.
Definition: containerview.cpp:42
containermodel.h
ContainerModel
Model for the tree of containers (lessons, word types).
Definition: containermodel.h:33
QWidget::setAcceptDrops
void setAcceptDrops(bool on)
containerview.h
QWidget::setContextMenuPolicy
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
ContainerView::m_model
ContainerModel * m_model
ContainerModel for this view.
Definition: containerview.h:49
QTreeView
QTreeView::setModel
virtual void setModel(QAbstractItemModel *model)
QHeaderView::setResizeMode
void setResizeMode(ResizeMode mode)
QAbstractItemView::edit
void edit(const QModelIndex &index)
QTreeView::header
QHeaderView * header() const
QAbstractItemView::model
QAbstractItemModel * model() const
QAbstractItemView::currentIndex
QModelIndex currentIndex() const
QHeaderView::setStretchLastSection
void setStretchLastSection(bool stretch)
ContainerView::ContainerView
ContainerView(QWidget *parent=0)
Set up the lesson list widget.
Definition: containerview.cpp:26
QAbstractItemView::setDropIndicatorShown
void setDropIndicatorShown(bool enable)
QAbstractItemView::setDragEnabled
void setDragEnabled(bool enable)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal