relicense to gplv2+
[kdeaccessibility.git] / kmouth / phraseedit.cpp
blob60c0351d8d02595b50fc3526513b18d694ab2356
1 /***************************************************************************
2 phraseedit.cpp - description
3 -------------------
4 begin : Don Sep 26 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #include "phraseedit.h"
20 #include <QtGui/QKeyEvent>
22 PhraseEdit::PhraseEdit(const QString &string, QWidget *parent)
23 : KLineEdit (string, parent) {
26 PhraseEdit::~PhraseEdit() {
29 void PhraseEdit::keyPressEvent (QKeyEvent *e) {
30 if (e->modifiers() & Qt::ControlModifier) {
31 if (e->key() == Qt::Key_C) {
32 if (!this->hasSelectedText()) {
33 e->ignore();
34 return;
37 else if (e->key() == Qt::Key_Insert) {
38 if (!hasSelectedText()) {
39 e->ignore();
40 return;
43 else if (e->key() == Qt::Key_X) {
44 if (!hasSelectedText()) {
45 e->ignore();
46 return;
50 else if (e->modifiers() & Qt::ShiftModifier) {
51 if (e->key() == Qt::Key_Delete) {
52 if (!hasSelectedText()) {
53 e->ignore();
54 return;
58 KLineEdit::keyPressEvent(e);