From 53376da9b3fced19ffc4dc8f6ade00d700fd342a Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Thu, 9 Sep 2010 10:58:42 +0000 Subject: add setters --- examples/GuiClient/profileDialog.cpp | 23 ++++++++++++++++++++++- examples/GuiClient/profileDialog.h | 6 ++++++ examples/GuiClient/profileDialog.ui | 31 ++++++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 4 deletions(-) (limited to 'examples/GuiClient') diff --git a/examples/GuiClient/profileDialog.cpp b/examples/GuiClient/profileDialog.cpp index 58d72449..79d51d7f 100644 --- a/examples/GuiClient/profileDialog.cpp +++ b/examples/GuiClient/profileDialog.cpp @@ -2,7 +2,7 @@ #include "ui_profileDialog.h" profileDialog::profileDialog(QWidget *parent) : - QDialog(parent), + QDialog(parent, Qt::WindowTitleHint|Qt::WindowSystemMenuHint), ui(new Ui::profileDialog) { ui->setupUi(this); @@ -12,3 +12,24 @@ profileDialog::~profileDialog() { delete ui; } + +void profileDialog::setAvatar(const QImage& image) +{ + ui->label_avatar->setPixmap(QPixmap::fromImage(image)); +} + +void profileDialog::setBareJid(const QString& bareJid) +{ + ui->label_jid->setText(bareJid); + setWindowTitle(bareJid); +} + +void profileDialog::setFullName(const QString& fullName) +{ + ui->label_fullName->setText(fullName); +} + +void profileDialog::setStatusText(const QString& status) +{ + ui->label_status->setText(status); +} diff --git a/examples/GuiClient/profileDialog.h b/examples/GuiClient/profileDialog.h index 264dd94b..ddcdd876 100644 --- a/examples/GuiClient/profileDialog.h +++ b/examples/GuiClient/profileDialog.h @@ -13,6 +13,12 @@ class profileDialog : public QDialog public: explicit profileDialog(QWidget *parent = 0); + + void setAvatar(const QImage&); + void setBareJid(const QString&); + void setFullName(const QString&); + void setStatusText(const QString&); + ~profileDialog(); private: diff --git a/examples/GuiClient/profileDialog.ui b/examples/GuiClient/profileDialog.ui index dfda1498..1c4887ba 100644 --- a/examples/GuiClient/profileDialog.ui +++ b/examples/GuiClient/profileDialog.ui @@ -6,18 +6,21 @@ 0 0 - 400 - 238 + 238 + 174 - Dialog + Profile + + QLayout::SetFixedSize + @@ -79,6 +82,12 @@ TextLabel + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + @@ -128,5 +137,21 @@ + + buttonBox + rejected() + profileDialog + close() + + + 237 + 216 + + + 230 + 172 + + + -- cgit v1.2.3