I would expect

    connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(messagesCountChanged()));

to work, and allow you to drop the intermediate slots