QTfrontend/mapContainer.cpp
changeset 1797 fedd8649fdd9
parent 1790 c84223511ca8
child 1802 dd148e2506e2
equal deleted inserted replaced
1796:4bcdf0bf58b8 1797:fedd8649fdd9
    39 	mainLayout(this),
    39 	mainLayout(this),
    40 	pMap(0)
    40 	pMap(0)
    41 {
    41 {
    42 	hhSmall.load(":/res/hh_small.png");
    42 	hhSmall.load(":/res/hh_small.png");
    43 	hhLimit = 18;
    43 	hhLimit = 18;
       
    44     templateFilter = 0;
    44 	
    45 	
    45 	mainLayout.setContentsMargins(QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
    46 	mainLayout.setContentsMargins(QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
    46 		1,
    47 		1,
    47 		QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin),
    48 		QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin),
    48 		QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
    49 		QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
   196 void HWMapContainer::changeImage()
   197 void HWMapContainer::changeImage()
   197 {
   198 {
   198 	pMap = new HWMap();
   199 	pMap = new HWMap();
   199 	connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
   200 	connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
   200 	connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int)));
   201 	connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int)));
   201 	pMap->getImage(m_seed.toStdString());
   202 	pMap->getImage(m_seed.toStdString(), templateFilter);
   202 }
   203 }
   203 
   204 
   204 void HWMapContainer::themeSelected(int currentRow)
   205 void HWMapContainer::themeSelected(int currentRow)
   205 {
   206 {
   206 	QString theme = Themes->at(currentRow);
   207 	QString theme = Themes->at(currentRow);
   282 {
   283 {
   283 	if(!Themes->size()) return;
   284 	if(!Themes->size()) return;
   284 	quint32 themeNum = rand() % Themes->size();
   285 	quint32 themeNum = rand() % Themes->size();
   285 	lwThemes->setCurrentRow(themeNum);
   286 	lwThemes->setCurrentRow(themeNum);
   286 }
   287 }
       
   288 
       
   289 void HWMapContainer::setTemplateFilter(int filter)
       
   290 {
       
   291    templateFilter = filter;   
       
   292 }