Engauge Digitizer
2
Window
WindowAbstractBase.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include <QItemSelectionModel>
8
#include <QModelIndexList>
9
#include <QTableView>
10
#include "
WindowAbstractBase.h
"
11
12
WindowAbstractBase::WindowAbstractBase
(QWidget *parent) :
13
QDockWidget (parent)
14
{
15
}
16
17
WindowAbstractBase::~WindowAbstractBase
()
18
{
19
}
20
21
void
WindowAbstractBase::getTableStatus
(
bool
&tableIsActive,
22
bool
&tableIsCopyable)
const
23
{
24
tableIsActive =
false
;
25
tableIsCopyable =
false
;
26
27
if
(
view
() !=
nullptr
) {
28
29
QItemSelectionModel *selectionModel =
view
()->selectionModel ();
30
QModelIndexList selection = selectionModel->selectedIndexes ();
31
32
tableIsActive =
view
()->hasFocus ();
33
tableIsCopyable = (selection.count () > 0);
34
}
35
}
WindowAbstractBase::view
virtual QTableView * view() const =0
QTableView-based class used by child class.
WindowAbstractBase::WindowAbstractBase
WindowAbstractBase(QWidget *parent)
Single constructor. Parent is needed or else this widget cannot be redocked after being undocked.
Definition:
WindowAbstractBase.cpp:12
WindowAbstractBase::getTableStatus
void getTableStatus(bool &tableIsActive, bool &tableIsCopyable) const
Give table status so MainWindow can determine if table can be copied.
Definition:
WindowAbstractBase.cpp:21
WindowAbstractBase::~WindowAbstractBase
virtual ~WindowAbstractBase()
Definition:
WindowAbstractBase.cpp:17
WindowAbstractBase.h
Generated on Sat Jan 4 2020 12:00:00 for Engauge Digitizer by
1.8.16