Example #1
0
void StarEditor::mouseMoveEvent(QMouseEvent *event) {
    int star = starAtPosition(event->x());

    if (star != m_starRating.starCount() && star != -1) {
        m_starRating.setStarCount(star);
        update();
    }
}
void StarEditor::mouseMoveEvent(QMouseEvent *event)
{
	int istar = starAtPosition(event->x());

	if (istar != star.starCount() && istar != -1) {
		star.setStarCount(istar);
		//qDebug() << "star.starCount():" << star.starCount();
		update();
	}
}
Example #3
0
void KNMusicRatingEditor::mouseMoveEvent(QMouseEvent *event)
{
    //Check the detecting switcher.
    if(m_detectOnMove)
    {
        //When the mouse is moving, change the value.
        int star=starAtPosition(event->x());
        //If the star number is valid, change the star number.
        if(star!=-1)
        {
            //Change the star number.
            setStarNum(star);
            //Repaint the widget.
            update();
        }
    }
}
Example #4
0
void KNMusicRatingEditor::mousePressEvent(QMouseEvent *event)
{
    //Check the detecting switcher.
    if(!m_detectOnMove)
    {
        //When the mouse moving detecting is disabled, mouse press will be the
        //most important things.
        int star=starAtPosition(event->x());
        //If the star number is valid, change the star number.
        if(star!=-1)
        {
            //Change the star number.
            setStarNum(star);
            //Repaint the widget.
            update();
        }
    }
}