~ubuntu-branches/ubuntu/vivid/regina-normal/vivid

« back to all changes in this revision

Viewing changes to qtui/src/edittableview.h

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2014-08-29 17:37:46 UTC
  • mfrom: (19.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140829173746-igmqc9b67y366a7u
Tags: 4.96-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/**************************************************************************
 
3
 *                                                                        *
 
4
 *  Regina - A Normal Surface Theory Calculator                           *
 
5
 *  Qt User Interface                                                     *
 
6
 *                                                                        *
 
7
 *  Copyright (c) 1999-2014, Ben Burton                                   *
 
8
 *  For further details contact Ben Burton (bab@debian.org).              *
 
9
 *                                                                        *
 
10
 *  This program is free software; you can redistribute it and/or         *
 
11
 *  modify it under the terms of the GNU General Public License as        *
 
12
 *  published by the Free Software Foundation; either version 2 of the    *
 
13
 *  License, or (at your option) any later version.                       *
 
14
 *                                                                        *
 
15
 *  As an exception, when this program is distributed through (i) the     *
 
16
 *  App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or     *
 
17
 *  (iii) Google Play by Google Inc., then that store may impose any      *
 
18
 *  digital rights management, device limits and/or redistribution        *
 
19
 *  restrictions that are required by its terms of service.               *
 
20
 *                                                                        *
 
21
 *  This program is distributed in the hope that it will be useful, but   *
 
22
 *  WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
23
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
24
 *  General Public License for more details.                              *
 
25
 *                                                                        *
 
26
 *  You should have received a copy of the GNU General Public             *
 
27
 *  License along with this program; if not, write to the Free            *
 
28
 *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,       *
 
29
 *  MA 02110-1301, USA.                                                   *
 
30
 *                                                                        *
 
31
 **************************************************************************/
 
32
 
 
33
/* end stub */
 
34
 
 
35
/*! \file edittableview.h
 
36
 *  \brief A subclass of QTableView with enhancements for use in packet editors.
 
37
 */
 
38
 
 
39
#ifndef __EDITTABLEVIEW_H
 
40
#define __EDITTABLEVIEW_H
 
41
 
 
42
#include <QTableView>
 
43
 
 
44
/**
 
45
 * A subclass of QTableView for use inside a packet editor.
 
46
 */
 
47
class EditTableView : public QTableView {
 
48
    public:
 
49
        EditTableView(QWidget* parent = 0);
 
50
 
 
51
        /**
 
52
         * Finish any cell editing operation that might be in progress.
 
53
         */
 
54
        void endEdit();
 
55
};
 
56
 
 
57
inline EditTableView::EditTableView(QWidget* parent) :
 
58
        QTableView(parent) {
 
59
}
 
60
 
 
61
inline void EditTableView::endEdit() {
 
62
    QModelIndex index = currentIndex();
 
63
    currentChanged(index, index);
 
64
}
 
65
 
 
66
#endif