310 |
andreas |
1 |
/*
|
|
|
2 |
* Copyright (C) 2023 by Andreas Theofilu <andreas@theosys.at>
|
|
|
3 |
*
|
|
|
4 |
* This program is free software; you can redistribute it and/or modify
|
|
|
5 |
* it under the terms of the GNU General Public License as published by
|
|
|
6 |
* the Free Software Foundation; either version 3 of the License, or
|
|
|
7 |
* (at your option) any later version.
|
|
|
8 |
*
|
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
* GNU General Public License for more details.
|
|
|
13 |
*
|
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
|
15 |
* along with this program; if not, write to the Free Software Foundation,
|
|
|
16 |
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
#include <QWidget>
|
|
|
20 |
#include <QKeyEvent>
|
|
|
21 |
|
|
|
22 |
#include "tqmultiline.h"
|
|
|
23 |
#include "terror.h"
|
|
|
24 |
|
|
|
25 |
using std::string;
|
|
|
26 |
|
|
|
27 |
TQMultiLine::TQMultiLine(QWidget *parent)
|
|
|
28 |
{
|
|
|
29 |
DECL_TRACER("TQMultiLine::TQMultiLine(QWidget *parent)");
|
|
|
30 |
|
|
|
31 |
setParent(parent);
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
TQMultiLine::TQMultiLine(QWidget *parent, const string& text)
|
|
|
35 |
{
|
|
|
36 |
DECL_TRACER("TQMultiLine::TQMultiLine(QWidget *parent, const string& text)");
|
|
|
37 |
|
|
|
38 |
setParent(parent);
|
|
|
39 |
setText(text.c_str());
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
/*******************************************************************************
|
|
|
43 |
* Signal handling
|
|
|
44 |
******************************************************************************/
|
|
|
45 |
|
|
|
46 |
void TQMultiLine::keyPressEvent(QKeyEvent *e)
|
|
|
47 |
{
|
|
|
48 |
DECL_TRACER("TQMultiLine::keyPressEvent(QKeyEvent *e)");
|
|
|
49 |
|
|
|
50 |
emit keyPressed(e->key());
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
void TQMultiLine::focusInEvent(QFocusEvent *e)
|
|
|
54 |
{
|
|
|
55 |
DECL_TRACER("TQMultiLine::focusInEvent(QFocusEvent *e)");
|
|
|
56 |
|
|
|
57 |
Q_UNUSED(e);
|
|
|
58 |
emit focusChanged(true);
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
void TQMultiLine::focusOutEvent(QFocusEvent *e)
|
|
|
62 |
{
|
|
|
63 |
DECL_TRACER("TQMultiLine::focusOutEvent(QFocusEvent *e)");
|
|
|
64 |
|
|
|
65 |
Q_UNUSED(e);
|
|
|
66 |
emit focusChanged(false);
|
|
|
67 |
}
|