forked from ciphrex/mSIGNA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxview.cpp
39 lines (32 loc) · 775 Bytes
/
txview.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
///////////////////////////////////////////////////////////////////////////////
//
// mSIGNA
//
// txview.cpp
//
// Copyright (c) 2013-2014 Eric Lombrozo
//
// All Rights Reserved.
#include "txview.h"
#include "txmodel.h"
#include <QMenu>
#include <QContextMenuEvent>
TxView::TxView(QWidget* parent)
: QTreeView(parent), m_model(nullptr), m_menu(nullptr)
{
setSelectionBehavior(QAbstractItemView::SelectRows);
}
void TxView::setModel(TxModel* model)
{
QTreeView::setModel(model);
m_model = model;
}
void TxView::updateColumns()
{
if (!m_model) return;
for (int i = 0; i < m_model->columnCount(); i++) { resizeColumnToContents(i); }
}
void TxView::contextMenuEvent(QContextMenuEvent* event)
{
if (m_menu) m_menu->exec(event->globalPos());
}