hydrogen 1.2.3
SoundLibraryTree.cpp
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#include "SoundLibraryTree.h"
24#include <QMimeData>
25
27 : QTreeWidget( pParent )
28{
29 setHeaderLabels( QStringList( tr( "Sound library" ) ) );
30 setAlternatingRowColors( true );
31 setRootIsDecorated( false );
32
33 headerItem()->setHidden( true ); // hides the header
34
35}
36
37
38void SoundLibraryTree::mousePressEvent(QMouseEvent *event)
39{
40// INFOLOG( "[mousePressEvent]" );
41 QTreeWidget::mousePressEvent( event );
42
43 if ( event->button() == Qt::RightButton ) {
44 emit rightClicked( QPoint( event->globalX(), event->globalY() ) );
45
46 }
47 else if (event->button() == Qt::LeftButton ) {
48 emit leftClicked( QPoint( event->globalX(), event->globalY() ) );
49 }
50}
51
52
53
54void SoundLibraryTree::mouseMoveEvent(QMouseEvent *event)
55{
56 emit onMouseMove( event );
57}
58
59
60
SoundLibraryTree(QWidget *pParent)
virtual void mouseMoveEvent(QMouseEvent *event) override
virtual void mousePressEvent(QMouseEvent *event) override
void leftClicked(QPoint pos)
void rightClicked(QPoint pos)
void onMouseMove(QMouseEvent *event)