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

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
SessionListModel.h
Go to the documentation of this file.
1 /*
2  This source file is part of Konsole, a terminal emulator.
3 
4  Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301 USA.
20 */
21 
22 #ifndef SESSIONLISTMODEL_H
23 #define SESSIONLISTMODEL_H
24 
25 // Qt
26 #include <QtCore/QAbstractListModel>
27 #include <QtCore/QVariant>
28 
29 namespace Konsole
30 {
31 class Session;
32 
42 class SessionListModel : public QAbstractListModel
43 {
44  Q_OBJECT
45 
46 public:
47  explicit SessionListModel(QObject* parent = 0);
48 
54  void setSessions(const QList<Session*>& sessions);
55 
56  // reimplemented from QAbstractItemModel
57  virtual QModelIndex index(int row, int column, const QModelIndex& parent) const;
58  virtual QVariant data(const QModelIndex& index, int role) const;
59  virtual QVariant headerData(int section, Qt::Orientation orientation,
60  int role) const;
61  virtual int columnCount(const QModelIndex& parent) const;
62  virtual int rowCount(const QModelIndex& parent) const;
63  virtual QModelIndex parent(const QModelIndex& index) const;
64 
65 protected:
66  virtual void sessionRemoved(Session*) {}
67 
68 private slots:
69  void sessionFinished();
70 
71 private:
72  QList<Session*> _sessions;
73 };
74 }
75 
76 #endif //SESSIONLISTMODEL_H
QModelIndex
Konsole::Session
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition: Session.h:78
Konsole::SessionListModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition: SessionListModel.cpp:88
Konsole::SessionListModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: SessionListModel.cpp:51
Konsole::SessionListModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: SessionListModel.cpp:136
Konsole::SessionListModel
Item-view model which contains a flat list of sessions.
Definition: SessionListModel.h:42
Konsole::SessionListModel::SessionListModel
SessionListModel(QObject *parent=0)
Definition: SessionListModel.cpp:35
QObject
QAbstractListModel
Konsole::SessionListModel::setSessions
void setSessions(const QList< Session * > &sessions)
Sets the list of sessions displayed in the model.
Definition: SessionListModel.cpp:40
QList
Konsole::SessionListModel::rowCount
virtual int rowCount(const QModelIndex &parent) const
Definition: SessionListModel.cpp:113
Konsole::SessionListModel::columnCount
virtual int columnCount(const QModelIndex &parent) const
Definition: SessionListModel.cpp:108
QObject::parent
QObject * parent() const
Konsole::SessionListModel::sessionRemoved
virtual void sessionRemoved(Session *)
Definition: SessionListModel.h:66
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

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