source/MainGUI.cpp
/**
 * The slot which is emitted a click event on the gamelist occured.
 *
 * @param mouseEvent The MouseEvent*.
 */
The slot which is emitted a click event on the gamelist occured.
@param mouseEvent The MouseEvent*.
The slot which is emitted a click event on the gamelist occured . @param mouseEvent The MouseEvent * .
void MainGUI::onGameListItemClicked (QMouseEvent *mouseEvent)
{
    widget.inputTextArea->setFocus();
    QListWidgetItem *item = widget.gameList->itemAt(mouseEvent->pos());
    if (!item)
    {
        return;
    }
    QString gamename = item->data(GamelistDelegate::GAMENAME).toString();
    if (mouseEvent->button() == Qt::LeftButton && !gamename.isEmpty()
            && gamename != "-" && gamename != "in channel ghostgraz")
    {
        gproxy->m_BNET->SetSearchGameName(gamename.toStdString());
        autosearch(false);
        addMessage(ColoredMessage("[BNET] looking for a game named \"" + gamename
                + "\" for up to two minutes", ColoredMessage::BNET));
    }
    else if (mouseEvent->button() == Qt::RightButton)
    {
        QApplication::clipboard()->setText(gamename);
    }
}
void MainGUI :: onGameListItemClicked ( QMouseEvent * mouseEvent ) { widget . inputTextArea -> setFocus ( ) ; QListWidgetItem * item = widget . gameList -> itemAt ( mouseEvent -> pos ( ) ) ; if ( ! item ) { return ; } QString gamename = item -> data ( GamelistDelegate :: GAMENAME ) . toString ( ) ; if ( mouseEvent -> button ( ) == Qt :: LeftButton && ! gamename . isEmpty ( ) && gamename != " " && gamename != " " ) { gproxy -> m_BNET -> SetSearchGameName ( gamename . toStdString ( ) ) ; autosearch ( false ) ; addMessage ( ColoredMessage ( " \" " + gamename + " \" " , ColoredMessage :: BNET ) ) ; } else if ( mouseEvent -> button ( ) == Qt :: RightButton ) { QApplication :: clipboard ( ) -> setText ( gamename ) ; } }
The slot which is emitted a click event on the gamelist occured.
The slot which is emitted a click event on the gamelist occured .