X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=InfoPanel.cpp;h=81cf31725b4b1b5a2b64aeaa9165fc4741d95a29;hb=refs%2Ftags%2Fkoi_10.91.0;hp=bc57e341ccb9b55812174bd449cc6d2da3728bd8;hpb=ededa7e3ef24a8cea9e513fa008ef481c1675457;p=apps%2Fpoi-yelp.git diff --git a/InfoPanel.cpp b/InfoPanel.cpp index bc57e34..81cf317 100644 --- a/InfoPanel.cpp +++ b/InfoPanel.cpp @@ -22,22 +22,30 @@ #define LABEL_IMG_HEIGHT 220 #define LABEL_REVIEWS_HEIGHT 24 -InfoPanel::InfoPanel(QWidget *parent, Business & business, QRect rect): - nameLabel(parent, rect), - imageLabel(parent, rect), - addressLabel(parent, rect), - phoneLabel(parent, rect), - imgRatingLabel(parent, rect), - nbReviewsLabel(parent, rect), - btnsBackground(parent, rect), - cancelButton("Cancel", parent), - goButton("Go !", parent), +InfoPanel::InfoPanel(QWidget *parent, QRect rect): + QWidget(parent), + nameLabel(this, rect), + imageLabel(this, rect), + addressLabel(this, rect), + phoneLabel(this, rect), + imgRatingLabel(this, rect), + nbReviewsLabel(this, rect), + btnsBackground(this, rect), + cancelButton("Cancel", this), + goButton("Go !", this), networkManager(parent) +{ + setGeometry(rect); + setVisible(false); +} + +void InfoPanel::populateInfo(Business & business) { int y = 0; QPixmap pixmap; bool isImageDownloaded = false; QFont font, fontBold; + QRect rect = this->geometry(); font = nameLabel.font(); font.setPointSize(FONT_SIZE); @@ -110,12 +118,11 @@ InfoPanel::InfoPanel(QWidget *parent, Business & business, QRect rect): cancelButton.setStyleSheet(BTN_STYLE); cancelButton.setFont(font); cancelButton.setMinimumSize(QSize(rect.width()/4, 50)); - cancelButton.setGeometry(QRect(rect.x()+rect.width()/8, rect.y()+y-60, rect.width()/4, 50)); - cancelButton.setVisible(true); + //cancelButton.setGeometry(QRect(rect.x()+rect.width()/8, rect.y()+y-60, rect.width()/4, 50)); + cancelButton.setGeometry(QRect(rect.width()/8, y-60, rect.width()/4, 50)); goButton.setStyleSheet(BTN_STYLE); goButton.setFont(font); goButton.setMinimumSize(QSize(rect.width()/4, 50)); - goButton.setGeometry(QRect(rect.x()+rect.width()*5/8, rect.y()+y-60, rect.width()/4, 50)); - goButton.setVisible(true); + goButton.setGeometry(QRect(rect.width()*5/8, y-60, rect.width()/4, 50)); }