Sayonara Player
Main Page
Modules
Namespaces
Classes
src
GUI
TagEdit
TagLineEdit.h
1
/* TagLineEdit.h */
2
3
/* Copyright (C) 2011-2016 Lucio Carreras
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
22
23
#ifndef TAGLINEEDIT_H
24
#define TAGLINEEDIT_H
25
26
#include <QLineEdit>
27
#include <QString>
28
#include <QFocusEvent>
33
struct
TextSelection
{
34
35
int
selection_start;
36
int
selection_size;
37
41
void
reset
(){
42
selection_start = -1;
43
selection_size = 0;
44
}
45
46
TextSelection
(){
47
reset
();
48
}
49
};
50
55
class
TagLineEdit
:
public
QLineEdit {
56
57
Q_OBJECT
58
59
public
:
60
TagLineEdit
(QWidget* parent=
nullptr
);
61
62
protected
:
63
64
TextSelection
_text_selection;
65
66
protected
:
71
void
focusInEvent(QFocusEvent* e)
override
;
72
77
void
focusOutEvent(QFocusEvent* e)
override
;
78
79
public
:
84
TextSelection
get_text_selection()
const
;
85
};
86
87
88
#endif // TAGLINEEDIT_H
TextSelection
Holds start and size of a selection.
Definition:
TagLineEdit.h:33
TagLineEdit
The TagLineEdit class.
Definition:
TagLineEdit.h:55
TextSelection::reset
void reset()
set selection_start to -1 and selection_size to 0
Definition:
TagLineEdit.h:41
Generated on Sun May 22 2016 19:56:34 for Sayonara Player by
1.8.11