예제 #1
0
void GraphicsBoard::setHighlights(const QList<Chess::Square>& squares)
{
	clearHighlights();
	if (squares.isEmpty())
		return;

	TargetHighlights* targets = new TargetHighlights(this);

	QRectF rect;
	rect.setSize(QSizeF(m_squareSize / 3, m_squareSize / 3));
	rect.moveCenter(QPointF(0, 0));
	QPen pen(Qt::white, m_squareSize / 20);
	QBrush brush(Qt::black);

	for (const auto& sq : squares)
	{
		QGraphicsEllipseItem* dot = new QGraphicsEllipseItem(rect, targets);

		dot->setCacheMode(DeviceCoordinateCache);
		dot->setPen(pen);
		dot->setBrush(brush);
		dot->setPos(squarePos(sq));
	}

	m_highlightAnim = new QPropertyAnimation(targets, "opacity");
	targets->setParent(m_highlightAnim);

	m_highlightAnim->setStartValue(0.0);
	m_highlightAnim->setEndValue(1.0);
	m_highlightAnim->setDuration(500);
	m_highlightAnim->setEasingCurve(QEasingCurve::InOutQuad);
	m_highlightAnim->start(QAbstractAnimation::KeepWhenStopped);
}
예제 #2
0
void GraphicsBoard::setFlipped(bool flipped)
{
	if (flipped == m_flipped)
		return;

	clearHighlights();
	m_flipped = flipped;
	update();
}
void TelephoneNumberOverlayController::selectedTelephoneNumberRangesChanged(const Vector<RefPtr<Range>>& ranges)
{
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1090
    m_currentSelectionRanges = ranges;
    
    clearHighlights();
    
    if (m_currentSelectionRanges.isEmpty())
        destroyOverlay();
    else
        createOverlayIfNeeded();
#else
    UNUSED_PARAM(ranges);
#endif
}
예제 #4
0
void testTurn(){ 
	
	Grid<char> board = makeRandomBoard(StandardCubes); 
	Vector<pointT> moves = makeDeltas();

	DrawBoard(4,4); 
	addLetters(board); 
	
	while (true){ 
		cout << "Enter Word: " << endl;
		string s = GetLine(); 
		if (s == "") break; 
		
		cout << "Word entered: " << s << endl;
		Vector<pointT> path; 
		bool res = checkWord(s, board, moves,path); 
		if (res) cout << "checkWord returned true" << endl;
		if (!res) cout << "checkWord returned false" << endl; 
		highlightPath(path); 
		Pause(0.5); 
		clearHighlights(board); 
		
	}
}
예제 #5
0
QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
{
  clearHighlights();
  if ( mActionPopup )
    delete mActionPopup;
}