Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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)
421 andreas 28
    : QTextEdit(parent)
310 andreas 29
{
30
    DECL_TRACER("TQMultiLine::TQMultiLine(QWidget *parent)");
31
}
32
 
33
TQMultiLine::TQMultiLine(QWidget *parent, const string& text)
421 andreas 34
    : QTextEdit(parent)
310 andreas 35
{
36
    DECL_TRACER("TQMultiLine::TQMultiLine(QWidget *parent, const string& text)");
37
 
419 andreas 38
    setText(text.c_str());
310 andreas 39
}
40
 
41
/*******************************************************************************
42
 * Signal handling
43
 ******************************************************************************/
44
 
45
void TQMultiLine::keyPressEvent(QKeyEvent *e)
46
{
47
    DECL_TRACER("TQMultiLine::keyPressEvent(QKeyEvent *e)");
48
 
421 andreas 49
    QTextEdit::keyPressEvent(e);
310 andreas 50
    emit keyPressed(e->key());
51
}
52
 
53
void TQMultiLine::focusInEvent(QFocusEvent *e)
54
{
55
    DECL_TRACER("TQMultiLine::focusInEvent(QFocusEvent *e)");
56
 
421 andreas 57
    QTextEdit::focusInEvent(e);
310 andreas 58
    emit focusChanged(true);
59
}
60
 
61
void TQMultiLine::focusOutEvent(QFocusEvent *e)
62
{
63
    DECL_TRACER("TQMultiLine::focusOutEvent(QFocusEvent *e)");
64
 
421 andreas 65
    QTextEdit::focusOutEvent(e);
310 andreas 66
    emit focusChanged(false);
67
}