コード例 #1
0
void FingerList::mousePressEvent(QMouseEvent *e)
{
    int col = e->x() / ICONCHORD;
#if QT_VERSION < 300
    int row = (e->y() + yOffset()) / ICONCHORD;
#else
    int row = (e->y() + contentsY ()) / ICONCHORD;
#endif

    int n = row * perRow + col;

    if ((n >= 0) && (n < num)) {
		curSel = row * perRow + col;
#if QT_VERSION < 300
		repaint(oldCol * ICONCHORD, oldRow * ICONCHORD - yOffset(),
				ICONCHORD, ICONCHORD);
		repaint(col * ICONCHORD, row * ICONCHORD - yOffset(),
				ICONCHORD, ICONCHORD);
#else
		repaintCell(oldRow, oldCol);
		repaintCell(row, col);
#endif
		oldCol = col;
		oldRow = row;
		emit chordSelected(appl[curSel].f);
    }
}
コード例 #2
0
void FingerList::setFirstChord() {
	if (!num) return;
	oldCol = 0;
	oldRow = 0;
	curSel = 0;
#if QT_VERSION < 300
	repaint(0, 0 - yOffset(), ICONCHORD, ICONCHORD);
#else
	repaintCell(0, 0);
#endif
	chordSelected(appl[0].f);
}
コード例 #3
0
ファイル: fingerlist.cpp プロジェクト: fil4028/TestGIT
void FingerList::mousePressEvent(QMouseEvent *e)
{
	int col = columnAt(e->x());
	int row = rowAt(e->y() + contentsY());

	int n = row * perRow + col;

	if ((n >= 0) && (n < num)) {
		curSel = row * perRow + col;
		repaintCell(oldRow, oldCol);
		repaintCell(row, col);
		oldCol = col;
		oldRow = row;
		emit chordSelected(appl[curSel].f);
	}
}
コード例 #4
0
ファイル: fingerlist.cpp プロジェクト: fil4028/TestGIT
void FingerList::selectFirst()
{
	emit chordSelected(appl[0].f);
}