1 /***************************************************************************
2 phraseedit.cpp - description
4 begin : Don Sep 26 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #include "phraseedit.h"
20 PhraseEdit::PhraseEdit(const QString
&string
, QWidget
*parent
)
21 : KLineEdit (string
, parent
) {
24 PhraseEdit::~PhraseEdit() {
27 void PhraseEdit::keyPressEvent (QKeyEvent
*e
) {
28 if ((e
->state() & Qt::KeyButtonMask
) == Qt::ControlButton
) {
29 if (e
->key() == Qt::Key_C
) {
30 if (!this->hasSelectedText()) {
35 else if (e
->key() == Qt::Key_Insert
) {
36 if (!hasSelectedText()) {
41 else if (e
->key() == Qt::Key_X
) {
42 if (!hasSelectedText()) {
48 else if ((e
->state() & Qt::KeyButtonMask
) == Qt::ShiftButton
) {
49 if (e
->key() == Qt::Key_Delete
) {
50 if (!hasSelectedText()) {
56 KLineEdit::keyPressEvent(e
);