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

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • vocabulary
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 #include "containerview.h"
17 
18 #include <QHeaderView>
19 
20 #include "containermodel.h"
21 
22 using namespace Editor;
23 
24 ContainerView::ContainerView(QWidget *parent) : QTreeView(parent)
25 {
26  header()->setStretchLastSection(false);
27  header()->setVisible(false);
28 
29  setAlternatingRowColors(true);
30 
31  // show the actions added by addAction() as right click menu.
32  setContextMenuPolicy(Qt::ActionsContextMenu);
33 
34  setDragEnabled(true);
35  setAcceptDrops(true);
36  setDropIndicatorShown(true);
37  setDragDropMode(QAbstractItemView::DragDrop);
38 }
39 
40 void ContainerView::setModel(ContainerModel *model)
41 {
42  QTreeView::setModel(model);
43  m_model = model;
44 
45  header()->setResizeMode(0, QHeaderView::Stretch);
46  header()->setResizeMode(1, QHeaderView::ResizeToContents);
47 }
48 
49 void ContainerView::slotRename()
50 {
51  edit(selectionModel()->currentIndex());
52 }
53 
54 #include "containerview.moc"
55 
56 
Editor::ContainerView::slotRename
void slotRename()
let the user type a new name for the container
Definition: containerview.cpp:49
QWidget
containermodel.h
Editor::ContainerView::setModel
virtual void setModel(ContainerModel *model)
Set the model for the view.
Definition: containerview.cpp:40
QTreeView
Editor::ContainerView::m_model
ContainerModel * m_model
ContainerModel for this view.
Definition: containerview.h:49
Editor::ContainerModel
Model for the tree of containers (lessons, word types).
Definition: containermodel.h:33
Editor::ContainerView::ContainerView
ContainerView(QWidget *parent=0)
Set up the lesson list widget.
Definition: containerview.cpp:24
containerview.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:05 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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