Skip to content

Commit

Permalink
Double-click first, then single click.
Browse files Browse the repository at this point in the history
  • Loading branch information
textbrowser committed Dec 5, 2024
1 parent 71eeef1 commit 5db6f6d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Source/qtchess_gui_board.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ qtchess_gui_board::qtchess_gui_board(QWidget *parent):QWidget(parent)
connect(m_labels[i][j],
SIGNAL(double_clicked(qtchess_piece *)),
this,
SLOT(slot_piece_double_clicked(qtchess_piece *)));
SLOT(slot_piece_double_clicked(qtchess_piece *)),
Qt::QueuedConnection);
connect(m_labels[i][j],
SIGNAL(pressed(qtchess_piece *)),
this,
Expand Down Expand Up @@ -225,9 +226,6 @@ void qtchess_gui_board::paint(void)

void qtchess_gui_board::slot_piece_double_clicked(qtchess_piece *piece)
{
if(!(QApplication::keyboardModifiers() & Qt::ControlModifier))
return;

if(!chess || !piece)
return;

Expand Down Expand Up @@ -286,19 +284,16 @@ void qtchess_gui_board::slot_piece_double_clicked(qtchess_piece *piece)

void qtchess_gui_board::slot_piece_pressed(qtchess_piece *piece)
{
if(QApplication::keyboardModifiers() & Qt::ControlModifier)
return;

#ifdef QTCHESS_DEBUG
if(!chess || !gui || !piece)
return;
#else
if(!chess ||
chess->get_turn() != MY_TURN ||
chess->is_game_over() ||
!chess->is_ready() ||
!gui ||
!piece)
!piece ||
chess->get_turn() != MY_TURN ||
chess->is_game_over())
return;
#endif

Expand Down

0 comments on commit 5db6f6d

Please sign in to comment.