Changeset 845


Ignore:
Timestamp:
01/18/2011 12:58:40 PM (10 years ago)
Author:
lmalek
Message:

Add immages to binary file with Qt resource file

Location:
libs/SAMGAR/trunk
Files:
2 added
2 edited
13 moved

Legend:

Unmodified
Added
Removed
  • libs/SAMGAR/trunk/GUI/server3Gui.cpp

    r836 r845  
    9797 
    9898   if(this->isSelected()) 
    99       painter->drawPixmap(target2,QPixmap("Sprites.png"), source2); 
     99      painter->drawPixmap(target2,QPixmap(":/images/Sprites.png"), source2); 
    100100   else 
    101       painter->drawPixmap(target2,QPixmap("Sprites.png"), source2); 
     101      painter->drawPixmap(target2,QPixmap(":/images/Sprites.png"), source2); 
    102102 
    103103   QRectF target3(75+(mynum*95),-25,60,80); 
     
    168168         NewonetoAdd=false; 
    169169 
    170  Network::disconnect(TempConnect.GetMom()->GetRealName().c_str(),TempConnect.GetDad()->GetRealName().c_str()); 
    171  Network::disconnect(TempConnect.GetDad()->GetRealName().c_str(),TempConnect.GetMom()->GetRealName().c_str()); 
    172 /* 
    173170         cmd.clear(); 
    174171         cmd.addString("unsubscribe"); 
     
    184181                             TempConnect.GetDad()->GetRealName().c_str()); 
    185182       
    186 */   
    187   } 
     183      } 
    188184   } 
    189185   
     
    332328   if(place>360) 
    333329      place=0; 
    334    painter->drawPixmap(target2,QPixmap("Rotate.png"),Asource); 
     330   painter->drawPixmap(target2,QPixmap(":/images/Rotate.png"),Asource); 
    335331   painter->restore(); 
    336332 
     
    338334   { 
    339335      if(online) 
    340          painter->drawPixmap(target,QPixmap("Sprites.png"), Ssource); 
     336         painter->drawPixmap(target,QPixmap(":/images/Sprites.png"), Ssource); 
    341337      else         
    342          painter->drawPixmap(target,QPixmap("Sprites.png"), SOsource); 
     338         painter->drawPixmap(target,QPixmap(":/images/Sprites.png"), SOsource); 
    343339   } 
    344340   else 
    345341   { 
    346342      if(online) 
    347          painter->drawPixmap(target,QPixmap("Sprites.png"), Nsource); 
     343         painter->drawPixmap(target,QPixmap(":/images/Sprites.png"), Nsource); 
    348344      else 
    349          painter->drawPixmap(target,QPixmap("Sprites.png"), Osource); 
     345         painter->drawPixmap(target,QPixmap(":/images/Sprites.png"), Osource); 
    350346   } 
    351347 
     
    557553   } 
    558554 
    559    setBackgroundBrush(QPixmap("BackGround.png")); 
     555   setBackgroundBrush(QPixmap(":/images/BackGround.png")); 
    560556 
    561557   setScene(scene); 
     
    750746{ 
    751747   QString filename = QFileDialog::getOpenFileName(this,"Samgar File Load", 
    752                                                    QString(),"*.SAMstate"); 
     748                                                   QString(),".SAMstate"); 
    753749   QFile f( filename ); 
    754750   f.open( QIODevice::ReadOnly ); 
     
    802798   
    803799} 
    804 void MyConnectionView::LoadAuto(void) 
    805 { 
    806  
    807          
    808         if(QFile::exists(QString("AutoLoad.SAMstate"))) 
    809         { 
    810         this->mylogwindow->WriteToLog("Loading Autoconnect file",true); 
    811         QFile f(QString("AutoLoad.SAMstate")); 
    812    f.open( QIODevice::ReadOnly ); 
    813    QTextStream in(&f); 
    814    
    815    QString name; 
    816  
    817    // TODO: assume that the comment line special sighn is # and ignore all data 
    818    // that stands after it.  
    819    in.readLine();  
    820    in.readLine(); 
    821    in.readLine(); 
    822    in.readLine(); 
    823    in.readLine();// ignore first couple of lines cos there for humans 
    824  
    825    QString Data = in.readLine(); // get first valid line 
    826    while(!Data.isEmpty()&&!Data.isNull()) 
    827    { 
    828       string Pdata[10];// = {" "}; 
    829      
    830       QStringList list1 = Data.split(","); 
    831       string name=list1.at(0).toStdString(); 
    832       int x = list1.at(2).toInt(); 
    833       int y = list1.at(3).toInt(); 
    834      
    835       for(int zz = 4;zz<list1.size();zz++) 
    836       { 
    837          Pdata[zz-4]=list1.at(zz).toStdString(); 
    838       } 
    839       AddMod(name,Pdata,x,y); 
    840       Data = in.readLine(); 
    841    } 
    842    in.readLine(); in.readLine();in.readLine();in.readLine(); 
    843    
    844    // load connections // put stuff here to load connections, dont worry about 
    845    // threads as the conns themselves should be thread safe  
    846  
    847    Data = in.readLine(); // get first valid line 
    848    string fake[maxports]; 
    849    while(!Data.isEmpty()&&!Data.isNull()) 
    850    { 
    851       QStringList list1 = Data.split(","); 
    852       string dname=list1.at(0).toStdString(); 
    853       string mname=list1.at(1).toStdString(); 
    854       int conntype = list1.at(2).toInt(); 
    855       CreateConnection(dname,mname,conntype,true,false); 
    856       Data = in.readLine(); 
    857    } 
    858  
    859    f.close(); 
    860         } 
    861         else 
    862         { 
    863         this->mylogwindow->WriteToLog("No Autoconnect file exists",false); 
    864         } 
    865 } 
     800 
    866801void MyConnectionView::updateconnection(string d,string m,bool deleate, 
    867802                                        bool connected) 
  • libs/SAMGAR/trunk/INSTALL_Linux.txt

    r799 r845  
    3939cp SAMGAR/GUI/*.cpp yarp-2.3.1/src/yarpserver/src/ 
    4040cp SAMGAR/GUI/*.h yarp-2.3.1/src/yarpserver/src/ 
     41cp SAMGAR/GUI/*.qrc yarp-2.3.1/src/yarpserver/src/ 
     42cp -r SAMGAR/GUI/images yarp-2.3.1/src/yarpserver/src/ 
    4143 
    42445. Modify CMakeList.txt file responsible for compiling yarpserver 
     
    5052add following lines 
    5153 
    52 FIND_PACKAGE(Qt4 REQUIRED) 
     54FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED) 
    5355SET(QT_USE_QTXML 1) 
    5456INCLUDE(${QT_USE_FILE}) 
     
    6062add line 
    6163 
    62 qt_wrap_cpp(yarpserver3 SERVER3GUI_MOC ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.h) 
     64QT4_ADD_RESOURCES(SERVER3GUI_RC_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.qrc) 
     65QT_WRAP_CPP(yarpserver3 SERVER3GUI_MOC ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.h) 
    6366 
    6467add at the end of add_executable(yarpserver3 ...) file list following files 
    6568 
    66 ${CMAKE_CURRENT_SOURCE_DIR}/src/samheader.h ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.h ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.cpp ${SERVER3GUI_MOC} 
     69${CMAKE_CURRENT_SOURCE_DIR}/src/samheader.h ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.h ${CMAKE_CURRENT_SOURCE_DIR}/src/server3Gui.cpp ${SERVER3GUI_MOC} ${SERVER3GUI_RC_SRCS} 
    6770 
    6871Finally change the line  
Note: See TracChangeset for help on using the changeset viewer.