Tests/DemoGUI/FriendView.cpp
changeset 26 83d6a149c755
equal deleted inserted replaced
25:a180113055cb 26:83d6a149c755
       
     1 #include "FriendView.h"
       
     2 #include "ScreenSize.h"
       
     3 #include "qpushbutton.h"
       
     4 #include "ToolBar.h"
       
     5 #include <qmessagebox.h>
       
     6 
       
     7 //Forward declaration
       
     8 class ScreenSize;
       
     9 class CustomListWidget;
       
    10 class GridView;
       
    11 
       
    12 FriendView::FriendView(QString aHeadName):
       
    13         iHeadName(aHeadName)
       
    14 {
       
    15 
       
    16 }
       
    17 FriendView::~FriendView()
       
    18 {
       
    19 
       
    20 }
       
    21 void FriendView::SetupUI()
       
    22 {
       
    23     //iMainwindow = Mainwindow;
       
    24     QPushButton* HomeButton = new QPushButton(this);
       
    25     HomeButton->setText(iHeadName);
       
    26     HomeButton->setGeometry(0,0,ScreenSize::GetScreenRect().width(),KHeadNameHeight);
       
    27     HomeButton->setStyleSheet("background-color: rgb(0,0,0);"
       
    28                              "border-width: 2px;"
       
    29                              "font: bold 16px;"
       
    30                              "min-width: 10em;"
       
    31                              "padding: 4px;"
       
    32 							 "color: white;"
       
    33                             );
       
    34 
       
    35     HomeButton->setDisabled(true);
       
    36 
       
    37     TabWidget = new QTabWidget(this);
       
    38 
       
    39     iPostsListWidget = new CustomListWidget();
       
    40     TabWidget->addTab(iPostsListWidget,"Posts");
       
    41 
       
    42     AlbumView = new GridView();
       
    43     QStringList Iconpathlist;
       
    44     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    45     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    46     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    47     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    48     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    49     Iconpathlist.append("E:/Images/SMF/SMF.JPG");
       
    50 
       
    51     //TabWidget->addTab(AlbumView->CreateGridView(Iconpathlist),"Album");
       
    52 
       
    53     TabWidget->setGeometry(0,KHeadNameHeight + KWidgetGapFactor,ScreenSize::GetScreenRect().width(),ScreenSize::GetScreenRect().height() - (ToolbarIconHeight + KWidgetGapFactor));
       
    54 
       
    55     connect(TabWidget,SIGNAL(currentChanged(int)),this,SLOT(Navigated2OtherTab(int)));
       
    56     //Drawing Tool bar
       
    57     ToolBar* ToolBarwidget = new ToolBar;
       
    58     QStringList actionList;
       
    59     actionList.append("Post");
       
    60     actionList.append("Reply");
       
    61     actionList.append("Add Service");
       
    62     ToolBarwidget->GetToolBar(this,actionList);
       
    63     showFullScreen();
       
    64 }
       
    65 
       
    66 void FriendView::Navigated2OtherTab(int tabIndex)
       
    67 {
       
    68      if(tabIndex == 0)
       
    69         iPostsListWidget->AddListItem("E:/Images/SMF/SMF.JPG","Rajat","Hello !");
       
    70 
       
    71 }