-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 10 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index b71f929..671868c 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp @@ -1004,32 +1004,42 @@ void Keys::setKey(const int row, const int qcode, const ushort unicode, key->pressed = keys[i].at(j)->pressed; found = 1; } } if (!found) { key->pressed = new bool; *(key->pressed) = 0; } key->pix = pix; keys[row].append(key); } + +// Keys::~Keys {{{2 +Keys::~Keys() { + + for (int i = 1; i <= 5; i++) + for (unsigned int j = 0; j < keys[i].count(); j++) + delete keys[i].at(j); + +} + // Keys:: other functions {{{2 int Keys::width(const int row, const int col) { return keys[row].at(col)->width; } ushort Keys::uni(const int row, const int col) { return keys[row].at(col)->unicode; } int Keys::qcode(const int row, const int col) { return keys[row].at(col)->qcode; } diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 8ca50ea..400edc0 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h @@ -42,32 +42,33 @@ class KeyboardPicks : public PickboardPicks { Q_OBJECT public: KeyboardPicks(QWidget* parent=0, const char* name=0, WFlags f=0) : PickboardPicks(parent, name, f) { } void initialise(); virtual QSize sizeHint() const; KeyboardConfig *dc; }; class Keys { public: Keys(); Keys(const char * filename); + ~Keys(); ushort uni(const int row, const int col); int qcode(const int row, const int col); int width(const int row, const int col); bool pressed(const int row, const int col); bool *pressedPtr(const int row, const int col); ushort shift(const ushort); QPixmap *pix(const int row, const int col); int numKeys(const int row); void setKeysFromFile(const char *filename); void setKey(const int row, const int qcode, const ushort unicode, const int width, QPixmap *pix); void setPressed(const int row, const int col, const bool pressed); QString lang; QString title; private: |