# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
-EXTRACT_PRIVATE = YES
+EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
InfoTab::InfoTab(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
{
- layout = new QGridLayout(this);
- userPicture = new QLabel;
- userNameLabel = new QLabel;
- messageLabel = new QLabel;
- addressLabel = new QLabel;
- timeLabel = new QLabel;
- QLabel *clockLabel = new QLabel;
- QLabel *envelopeLabel = new QLabel;
- QLabel *compassLabel = new QLabel;
+ m_layout = new QGridLayout(this);
+ m_userPicture = new QLabel;
+ m_userNameLabel = new QLabel;
+ m_messageLabel = new QLabel;
+ m_addressLabel = new QLabel;
+ m_timeLabel = new QLabel;
+ QLabel *m_clockLabel = new QLabel;
+ QLabel *m_envelopeLabel = new QLabel;
+ QLabel *m_compassLabel = new QLabel;
QToolButton *sendLocationButton = new QToolButton;
QToolButton *updateStatusMessageButton = new QToolButton;
sendLocationButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/sendPosition_icon.png")));
- clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
- envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
- compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
- layout->addWidget(userPicture,0,0,4,1);
- layout->addWidget(userNameLabel,0,2,1,2);
- layout->addWidget(clockLabel,1,1,1,1);
- layout->addWidget(envelopeLabel,2,1,1,1);
- layout->addWidget(compassLabel,3,1,1,1);
- layout->addWidget(timeLabel,1,2,1,1);
- layout->addWidget(messageLabel,2,2,1,1);
- layout->addWidget(addressLabel,3,2,1,1);
- layout->addWidget(sendLocationButton,0,3,2,1);
- layout->addWidget(updateStatusMessageButton,1,3,2,1);
+ m_clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
+ m_envelopeLabel->setPixmap(QPixmap(":/resources/list_small.png"));
+ m_compassLabel->setPixmap(QPixmap(":/resources/compas_small.png"));
+ m_layout->addWidget(m_userPicture,0,0,4,1);
+ m_layout->addWidget(m_userNameLabel,0,2,1,2);
+ m_layout->addWidget(m_clockLabel,1,1,1,1);
+ m_layout->addWidget(m_envelopeLabel,2,1,1,1);
+ m_layout->addWidget(m_compassLabel,3,1,1,1);
+ m_layout->addWidget(m_timeLabel,1,2,1,1);
+ m_layout->addWidget(m_messageLabel,2,2,1,1);
+ m_layout->addWidget(m_addressLabel,3,2,1,1);
+ m_layout->addWidget(sendLocationButton,0,3,2,1);
+ m_layout->addWidget(updateStatusMessageButton,1,3,2,1);
}
InfoTab::~InfoTab()
{
- if (userPicture)
- delete userPicture;
- if (userNameLabel)
- delete userNameLabel;
- if (messageLabel)
- delete messageLabel;
- if (addressLabel)
- delete addressLabel;
- if (timeLabel)
- delete timeLabel;
- if (layout)
- delete layout;
- userPicture=NULL;
- userNameLabel=NULL;
- messageLabel=NULL;
- addressLabel=NULL;
- timeLabel=NULL;
- layout=NULL;
+ if (m_userPicture)
+ delete m_userPicture;
+ if (m_userNameLabel)
+ delete m_userNameLabel;
+ if (m_messageLabel)
+ delete m_messageLabel;
+ if (m_addressLabel)
+ delete m_addressLabel;
+ if (m_timeLabel)
+ delete m_timeLabel;
+ if (m_layout)
+ delete m_layout;
+ m_userPicture=NULL;
+ m_userNameLabel=NULL;
+ m_messageLabel=NULL;
+ m_addressLabel=NULL;
+ m_timeLabel=NULL;
+ m_layout=NULL;
}
void InfoTab::paintEvent(QPaintEvent *aPaintEvent)
void InfoTab::setAvatar(const QPixmap &avat)
{
- avatar = avat;
- userPicture->setPixmap(avat);
+ m_avatar = avat;
+ m_userPicture->setPixmap(m_avatar);
}
void InfoTab::setUserName(const QString &usernam)
{
- if(userName == usernam)
+ if(m_userName == usernam)
return;
- userName = usernam;
- userNameLabel->setText(userName);
+ m_userName = usernam;
+ m_userNameLabel->setText(m_userName);
}
void InfoTab::setMessageText(const QString &text)
{
- if(messageText == text)
+ if(m_messageText == text)
return;
- messageText = text;
- messageLabel->setText(messageText);
+ m_messageText = text;
+ m_messageLabel->setText(m_messageText);
}
void InfoTab::setAddress(const QString &addr)
{
- if(address == addr)
+ if(m_address == addr)
return;
- address = addr;
- addressLabel->setText(address);
+ m_address = addr;
+ m_addressLabel->setText(m_address);
}
void InfoTab::setTime(const QString &tim)
{
- if(time == tim)
+ if(m_time == tim)
return;
- time = tim;
- timeLabel->setText(time);
+ m_time = tim;
+ m_timeLabel->setText(m_time);
}
#include <QWidget>
/**
-* @brief Pixmap class.
+* @brief InfoTab class.
* Composite custom widget class used to show user information
* @author Jukka Saastamoinen
*/
class InfoTab : public QWidget
{
Q_OBJECT
+protected:
+ /**
+ * @brief This function is called when the widget is drawn
+ *
+ * @param aPaintEvent Pointer to paint event
+ */
+ void paintEvent(QPaintEvent *aPaintEvent);
public:
/**
* @brief Constructor
*/
InfoTab(QWidget *parent=0);
/**
- * @brief Destructor
*
+ * @brief Destructor
*/
~InfoTab();
public slots:
/**
- * @brief Sets the user picture
+ * @brief Sets the users current address
*
- * @param avat Reference to user picture
+ * @param addr Reference to users current address
*/
- void setAvatar(const QPixmap & avat);
+ void setAddress(const QString &addr);
/**
- * @brief Sets the user name
+ * @brief Sets the user picture
*
- * @param usernam Reference to user name
+ * @param avat Reference to user picture
*/
- void setUserName(const QString &usernam);
+ void setAvatar(const QPixmap &avat);
/**
* @brief Sets the message text
*
*/
void setMessageText(const QString &text);
/**
- * @brief Sets the users current address
- *
- * @param addr Reference to users current address
- */
- void setAddress(const QString &addr);
- /**
* @brief Sets the time of updated message
*
* @param tim Reference to time when message was sent.
*/
void setTime(const QString &tim);
-protected:
/**
- * @brief This function is called when the widget is drawn
+ * @brief Sets the user name
*
- * @param aPaintEvent Pointer to paint event
+ * @param usernam Reference to user name
*/
- void paintEvent(QPaintEvent *aPaintEvent);
+ void setUserName(const QString &usernam);
private:
- QLabel *userPicture;
- QLabel *userNameLabel;
- QLabel *messageLabel;
- QLabel *addressLabel;
- QLabel *timeLabel;
- QGridLayout *layout;
- QString messageText;
- QString userName;
- QString address;
- QString time;
- QPixmap avatar;
+ QLabel *m_userPicture; ///< Shows the user's avatar
+ QLabel *m_userNameLabel; ///< Shows the user's name
+ QLabel *m_messageLabel; ///< Shows the Situare message icon
+ QLabel *m_addressLabel; ///< Shows the Situare address icon
+ QLabel *m_timeLabel; ///< Shows the Situare time icon
+ QGridLayout *m_layout; ///< Layout for shown items
+ QString m_messageText; ///< User's message
+ QString m_userName; ///< User's name
+ QString m_address; ///< Address from where the new message was sent.
+ QString m_time; ///< Time when the new message was sent
+ QPixmap m_avatar; ///< User's avatar
};
#endif // INFOTAB_H
#include <QDebug>
ListViewScreen::ListViewScreen(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent)
{
- arrowbutton = new Pixmap(QPixmap(":/resources/arrow_right.png"));
+ m_arrowbutton = new Pixmap(QPixmap(":/resources/arrow_right.png"));
- personalInfo = new InfoTab;
- personalInfo->setAvatar(QPixmap(":/resources/facebook_user_64.png"));
- personalInfo->setUserName("Fred Facebook");
- personalInfo->setMessageText("Hello Maemo Situare !");
- personalInfo->setTime("1 hour ago");
- personalInfo->setAddress("Kiviharjunlenkki 1E, 91910 Oulu");
+ m_personalInfo = new InfoTab;
+ m_personalInfo->setAvatar(QPixmap(":/resources/facebook_user_64.png"));
+ m_personalInfo->setUserName("Fred Facebook");
+ m_personalInfo->setMessageText("Hello Maemo Situare !");
+ m_personalInfo->setTime("1 hour ago");
+ m_personalInfo->setAddress("Kiviharjunlenkki 1E, 91910 Oulu");
- widgetProxy = new QGraphicsProxyWidget();
- widgetProxy->setWidget(personalInfo);
+ m_widgetProxy = new QGraphicsProxyWidget();
+ m_widgetProxy->setWidget(m_personalInfo);
QGraphicsScene *scene= new QGraphicsScene(this);
scene->setBackgroundBrush(Qt::white);
- scene->addItem(widgetProxy);
- scene->addItem(arrowbutton);
+ scene->addItem(m_widgetProxy);
+ scene->addItem(m_arrowbutton);
qDebug() << "Scene width: " << scene->width();
qDebug() << "Scene heigth: " << scene->height();
machine->setInitialState(state1);
// State 1
- state1->assignProperty(widgetProxy,"pos",QPointF(-(personalInfo->width()),0));
- state1->assignProperty(arrowbutton,"pos",QPointF(0,(personalInfo->height()/4)));
+ state1->assignProperty(m_widgetProxy,"pos",QPointF(-(m_personalInfo->width()),0));
+ state1->assignProperty(m_arrowbutton,"pos",QPointF(0,(m_personalInfo->height()/4)));
// State 2
- state2->assignProperty(widgetProxy,"pos",QPointF(0,0));
- state2->assignProperty(arrowbutton,"pos",QPointF((personalInfo->width()),(personalInfo->height()/4)));
+ state2->assignProperty(m_widgetProxy,"pos",QPointF(0,0));
+ state2->assignProperty(m_arrowbutton,"pos",QPointF((m_personalInfo->width()),(m_personalInfo->height()/4)));
- trans1 = state1->addTransition(arrowbutton,SIGNAL(clicked()),state2);
- anim1 = new QPropertyAnimation(widgetProxy,"pos");
- anim2 = new QPropertyAnimation(arrowbutton,"pos");
- trans1->addAnimation(anim1);
- trans1->addAnimation(anim2);
+ m_trans1 = state1->addTransition(m_arrowbutton,SIGNAL(clicked()),state2);
+ m_anim1 = new QPropertyAnimation(m_widgetProxy,"pos");
+ m_anim2 = new QPropertyAnimation(m_arrowbutton,"pos");
+ m_trans1->addAnimation(m_anim1);
+ m_trans1->addAnimation(m_anim2);
- trans2 = state2->addTransition(arrowbutton,SIGNAL(clicked()),state1);
- anim3= new QPropertyAnimation(widgetProxy,"pos");
- anim4= new QPropertyAnimation(arrowbutton,"pos");
- trans2->addAnimation(anim3);
- trans2->addAnimation(anim4);
+ m_trans2 = state2->addTransition(m_arrowbutton,SIGNAL(clicked()),state1);
+ m_anim3= new QPropertyAnimation(m_widgetProxy,"pos");
+ m_anim4= new QPropertyAnimation(m_arrowbutton,"pos");
+ m_trans2->addAnimation(m_anim3);
+ m_trans2->addAnimation(m_anim4);
machine->start();
- vbox = new QVBoxLayout(this);
- vbox->addWidget(view);
- vbox->setMargin(0);
+ m_vbox = new QVBoxLayout(this);
+ m_vbox->addWidget(view);
+ m_vbox->setMargin(0);
}
ListViewScreen::~ListViewScreen()
{
- if (personalInfo)
- delete personalInfo;
- if (arrowbutton)
- delete arrowbutton;
- if (trans1)
- delete trans1;
- if (trans2)
- delete trans2;
- if (anim1)
- delete anim1;
- if (anim2)
- delete anim2;
- if (anim3)
- delete anim3;
- if (anim4)
- delete anim4;
- if (vbox)
- delete vbox;
+ if (m_personalInfo)
+ delete m_personalInfo;
+ if (m_arrowbutton)
+ delete m_arrowbutton;
+ if (m_trans1)
+ delete m_trans1;
+ if (m_trans2)
+ delete m_trans2;
+ if (m_anim1)
+ delete m_anim1;
+ if (m_anim2)
+ delete m_anim2;
+ if (m_anim3)
+ delete m_anim3;
+ if (m_anim4)
+ delete m_anim4;
+ if (m_vbox)
+ delete m_vbox;
}
Kaj Wallin - kaj.wallin@ixonos.com
Situare is free software; you can redistribute it and/or
- qt trace modify it under the terms of the GNU General Public License
+ modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
Situare is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- qt trace MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- qt trace You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU General Public License
along with Situare; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
~ListViewScreen();
private:
- QVBoxLayout *vbox;
- QGraphicsLinearLayout *graphLayout;
- InfoTab *personalInfo;
- Pixmap *arrowbutton;
- QGraphicsProxyWidget *widgetProxy;
- QAbstractTransition *trans1;
- QAbstractTransition *trans2;
- QPropertyAnimation *anim1;
- QPropertyAnimation *anim2;
- QPropertyAnimation *anim3;
- QPropertyAnimation *anim4;
+ QVBoxLayout *m_vbox; ///< Holds the graphics view
+ InfoTab *m_personalInfo; ///< Personal info tab
+ Pixmap *m_arrowbutton; ///< Button which reveals/hides the info tab when pressed
+ QGraphicsProxyWidget *m_widgetProxy; ///< Embeds InfoTab to graphics view
+ QAbstractTransition *m_trans1; ///< Animation transition from hidden state to visible
+ QAbstractTransition *m_trans2; ///< Animation transition from visible to hidden
+ QPropertyAnimation *m_anim1; ///< Animation for infotab from hidden to visible
+ QPropertyAnimation *m_anim2; ///< Animation for arrowbutton from hidden to visible
+ QPropertyAnimation *m_anim3; ///< Animation for infotab from visible to hidden
+ QPropertyAnimation *m_anim4; ///< Animation for arrowbutton from visible to hidden
};
#endif // LISTVIEWTAB_H
#include <QDebug>
Pixmap::Pixmap(const QPixmap &picture, QGraphicsObject *parent)
- : QGraphicsObject(parent), p(picture)
+ : QGraphicsObject(parent), m_p(picture)
{
}
void Pixmap::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
- painter->drawPixmap(QPointF(), p);
+ painter->drawPixmap(QPointF(), m_p);
}
QRectF Pixmap::boundingRect() const
{
- return QRectF( QPointF(0, 0), p.size());
+ return QRectF( QPointF(0, 0), m_p.size());
}
Q_OBJECT
public:
/**
- * @brief Constructor
+ * @brief Bounding box of the drawed pixmap
*
- * @param Reference to the picture displayed
- * @param parent Parent
+ * @return Rectangle shaped bounding box of the pixmap
*/
- Pixmap(const QPixmap &, QGraphicsObject *parent = 0);
+ QRectF boundingRect() const;
/**
* @brief Mouse press event
*
* @param event Mouse event
*/
void mousePressEvent(QGraphicsSceneMouseEvent *event);
- /**
- * @brief Bounding box of the drawed pixmap
- *
- * @return Rectangle shaped bounding box of the pixmap
- */
- QRectF boundingRect() const;
protected:
/**
* @brief Drawer of the given picture
* @param Pointer to the widget
*/
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param picture Reference to the picture displayed
+ * @param parent Parent
+ */
+ Pixmap(const QPixmap &picture, QGraphicsObject *parent = 0);
signals:
/**
* @brief Signal which is emitted when the pixmap
*/
void clicked();
private:
- QPixmap p;
+ QPixmap m_p; ///<Holds the buttons pixmap
};
#endif // PIXMAP_H