diff --git a/src/gui/official/JPushButton.cpp b/src/gui/official/JPushButton.cpp index 511cea7d56a6d84cccc4cb850a7b4330b68d552a..1377aa1dacdac1ae2d7680f92ed5f22fa616c994 100644 --- a/src/gui/official/JPushButton.cpp +++ b/src/gui/official/JPushButton.cpp @@ -23,7 +23,6 @@ #include <QEvent> #include <QMouseEvent> -#include <QPixmap> #include "JPushButton.hpp" @@ -33,29 +32,26 @@ JPushButton::JPushButton(const QPixmap &released, Qt::WFlags flags) : QLabel(parent, flags) { - mImages[0] = new QPixmap(released); - mImages[1] = new QPixmap(pressed); + mImages[0] = released; + mImages[1] = pressed; release(); } JPushButton::~JPushButton() -{ - delete mImages[0]; - delete mImages[1]; -} +{} void JPushButton::release() { - resize(mImages[0]->size()); - setPixmap (*mImages[0]); + resize(mImages[0].size()); + setPixmap (mImages[0]); } void JPushButton::press() { - resize(mImages[1]->size()); - setPixmap (*mImages[1]); + resize(mImages[1].size()); + setPixmap (mImages[1]); } // Mouse button released diff --git a/src/gui/official/JPushButton.hpp b/src/gui/official/JPushButton.hpp index 7c09ede48c11bd2c94981a46c0dfc60b9203661f..72bef609d659f6fe51ef1599c84845ca00f21927 100644 --- a/src/gui/official/JPushButton.hpp +++ b/src/gui/official/JPushButton.hpp @@ -25,6 +25,7 @@ #define __J_PUSH_BUTTON_H__ #include <QLabel> +#include <QPixmap> /** * This class Emulate a PushButton but takes two @@ -49,7 +50,7 @@ private: private: - QPixmap* mImages[2]; + QPixmap mImages[2]; protected: void mousePressEvent(QMouseEvent *); @@ -58,6 +59,7 @@ protected: signals: void clicked(void); + }; #endif // defined(__J_PUSH_BUTTON_H__) diff --git a/src/gui/official/SFLPhoneWindow.cpp b/src/gui/official/SFLPhoneWindow.cpp index 86f844d615de7554e0a879abcf4217dfbdf99338..fb3117e86f475515c11f1de99f3e1eeecb459d0b 100644 --- a/src/gui/official/SFLPhoneWindow.cpp +++ b/src/gui/official/SFLPhoneWindow.cpp @@ -13,8 +13,6 @@ SFLPhoneWindow::SFLPhoneWindow() : QMainWindow(NULL, 0) // Qt::FramelessWindowHint) { - setAttribute(Qt::WA_DeleteOnClose); - QLabel *l = new QLabel(this); QPixmap main(":/images/main-img.png"); l->setPixmap(main); @@ -24,6 +22,11 @@ SFLPhoneWindow::SFLPhoneWindow() initLineButtons(); } +SFLPhoneWindow::~SFLPhoneWindow() +{ + int i = 0; + i++; +} void SFLPhoneWindow::initLineButtons() @@ -32,6 +35,7 @@ SFLPhoneWindow::initLineButtons() int ypos = 151; int offset = 31; for(int i = 0; i < NBLINES; i++) { + std::cout << i << std::endl; JPushButton *line = new JPushButton(QPixmap(QString(":/images/line") + QString::number(i + 1) + "off-img.png"), diff --git a/src/gui/official/SFLPhoneWindow.hpp b/src/gui/official/SFLPhoneWindow.hpp index a0ecc2b0a500eb1297f4c13095da93118b9f65a3..792899515a84ef3153c354e6a456889cc4637594 100644 --- a/src/gui/official/SFLPhoneWindow.hpp +++ b/src/gui/official/SFLPhoneWindow.hpp @@ -8,6 +8,7 @@ class SFLPhoneWindow : public QMainWindow { public: SFLPhoneWindow(); + ~SFLPhoneWindow(); void initLineButtons(); diff --git a/src/gui/official/globals.h b/src/gui/official/globals.h new file mode 100644 index 0000000000000000000000000000000000000000..cfd5df044890b0a4edbd0ec96680bd24f9715a84 --- /dev/null +++ b/src/gui/official/globals.h @@ -0,0 +1,8 @@ +#ifndef SFLPHONE_GLOBAL_H +#define SFLPHONE_GLOBAL_H + +#define PROGNAME "SFLPhone" +#define VERSION "0.4.2" + + +#endif diff --git a/src/gui/official/official.pro b/src/gui/official/sflphone.pro similarity index 88% rename from src/gui/official/official.pro rename to src/gui/official/sflphone.pro index 267d1b6038550bf289a1432bce1d60b065547a8d..65628f81788c831837dd9c23d9b8f6278ff1406d 100644 --- a/src/gui/official/official.pro +++ b/src/gui/official/sflphone.pro @@ -6,10 +6,10 @@ TEMPLATE = app TARGET += DEPENDPATH += . INCLUDEPATH += . - # Input HEADERS += JPushButton.hpp \ - SFLPhoneWindow.hpp + SFLPhoneWindow.hpp \ + globals.h SOURCES += main.cpp \ JPushButton.cpp \ SFLPhoneWindow.cpp