Example #1
0
void MainWindow::selectBoardPosition( int boardPositionId )
{
  if ( isHumanTurnToPutPiece )
  {
    isHumanTurnToPutPiece = false;

    // allow the user to choose a piece
    isHumanTurnToChoose = true;

    // updating current board position id
    currentBoardPositionId = boardPositionId;

    // update board
    QPiece *piece = boardPieces[ currentBoardPositionId ];
    piece->setImage( getImageName( currentPieceId ) );
    piece->updateImage();

    // update pieces used
    piece = pieces[ currentPieceId ];
    piece->setImage( ":/images/p00.jpg" );
    piece->updateImage();

    // update current piece selected
    QPixmap pixMap( "" );
    selectedPiece->setPixmap( pixMap );

    // emit signal to indicate the human just played
    emit humanPlayed( currentPieceId, currentBoardPositionId );
  }
}
Example #2
0
isis::viewer::ui::AboutDialog::AboutDialog ( QWidget *parent, isis::viewer::QViewerCore *core )
	: QDialog ( parent ),
	  m_ViewerCore( core )

{
	m_Interface.setupUi( this );

	connect( m_Interface.authorsList, SIGNAL( currentTextChanged( QString ) ), this, SLOT( onAuthorClicked( QString ) ) );
	connect( m_Interface.sendMailButton, SIGNAL( pressed() ), this, SLOT( sendEmailClicked() ) );
	m_Interface.sendMailButton->setIcon( QIcon( ":/common/icon_email.gif" ) );

	m_Interface.sendMailButton->setEnabled( false );

	QPixmap pixMap( m_ViewerCore->getSettings()->getPropertyAs<std::string>( "vastSymbol" ).c_str() );
	const float ratio = pixMap.height() / ( float )pixMap.width();
	m_Interface.vastSymbolLabel->setPixmap( QPixmap(
			m_ViewerCore->getSettings()->getPropertyAs<std::string>( "vastSymbol" ).c_str() ).scaled( 200 / ratio , m_Interface.vastSymbolLabel->height(), Qt::KeepAspectRatio ) );
	QPalette pal;
	pal.setColor( QPalette::Text, Qt::blue );
	m_Interface.contactEdit->setPalette( pal );

	m_authorMap["Erik Tuerke"] = std::string( "*****@*****.**" );
	m_authorMap["Enrico Reimer"] = std::string( "*****@*****.**" );

}
Example #3
0
void Color::setValue(const QColor& f)
{
	PropertyInterface::setValue(f);
   QPixmap pixMap(22,22);
   pixMap.fill(f);
   m_changeColor->setIcon(QIcon(pixMap));
}
Example #4
0
void SettingsDialog::refresh(){
    QPixmap pixMap(40, 20);
    QPainter painter(&pixMap);
    painter.setBrush(QBrush(QColor(mBgColorDialog->currentColor())));
    painter.setPen(QPen(Qt::black, 2));
    painter.drawRect(0, 0, 40, 20);
    mBgColorBotton->setIcon(QIcon(pixMap));
    mBgColorBotton->setIconSize(QSize(40, 20));
}
Example #5
0
AntBot* GraphicsAntWorldScene::createAnt( const AntPosition& position )
{
  QPixmap pixMap( ":/resources/ant.png" );
  GraphicsAntItem* ant = new GraphicsAntItem( this,
                                              position,
                                              pixMap.scaled( AntConfig::AntSize, AntConfig::AntSize, Qt::KeepAspectRatio ) );

  addItem( ant );
  return ant;
}
Example #6
0
void MainWindow::humanPieceSelect( int pieceId )
{
  currentPieceId = pieceId;

  string imageName = getImageName( pieceId );
  QPixmap pixMap( imageName.c_str() );
  selectedPiece->setPixmap( pixMap );

  isHumanTurnToPutPiece = true;
}
Example #7
0
QWidget* Color::createEditor(QWidget * parent, const QModelIndex & index)
{
	Q_UNUSED(index);
	m_changeColor = new ChangeColor(parent);
   QPixmap pixMap(22,22);
   QColor color = value().value<QColor>();
   pixMap.fill(color);
   m_changeColor->setIcon(QIcon(pixMap));
	connect(m_changeColor, SIGNAL(colorChanged(const QColor&)), this, SLOT(setValue(const QColor&)));
	return m_changeColor;
}
Example #8
0
void MainWindow::computerPlay( int pieceId, int boardPositionId )
{
  if ( ( pieceId < boardPieces.size() ) &&
     ( boardPositionId < pieces.size() ) )
  {
    QPiece *piece = boardPieces[ boardPositionId ];
    piece->setImage( getImageName( pieceId ) );
    piece->updateImage();

    piece = pieces[ pieceId ];
    piece->setImage( ":/images/p00.jpg" );
    piece->updateImage();

    QPixmap pixMap( "" );
    selectedPiece->setPixmap( pixMap );
  }
}
Example #9
0
void MainWindow::selectPiece( int pieceId )
{
  if ( isHumanTurnToChoose )
  {
    isHumanTurnToChoose = false;

    // update current piece selected id
    currentPieceId = pieceId;

    // update pieces used
    QPiece *piece = pieces[ pieceId ];
    piece->setImage( ":/images/p00.jpg" );
    piece->updateImage();

    // previsualize selected piece
    string imageName = getImageName( pieceId );
    QPixmap pixMap( imageName.c_str() );
    selectedPiece->setPixmap( pixMap );

    // emit signal to allow the computer play
    emit computerPieceSelected( pieceId );
  }
}
Example #10
0
void picture_view::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{
    QString coat = index.model()->data(index, Qt::EditRole).toString();

    if (index.column() != 4)
    {
        QStyledItemDelegate::paint(painter, option, index);
        return;
    }

    if (coat.contains("https://ro.pinterest.com/pin/330592428882379838/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat1.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/325877723031145418/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat2.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/385691155582932812/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat3.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/786581891142613685/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat4.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/112730796902556958/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat5.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/334181234844356254/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat6.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/472948398360263019/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat7.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/340795896794626329/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat8.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/388435536596977576/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat9.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/292100725826174961/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat10.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/198510296059706051/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat11.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
    else if (coat.contains("https://ro.pinterest.com/pin/36310340731571686/"))
    {
        QPixmap pixMap("/Users/teofanamoisi/Desktop/qt_lab/coat12.jpg");
        painter->drawPixmap(option.rect, pixMap);
    }
}