void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QItemSelectionRange changedArea(topLeft, bottomRight); QModelIndex currentTopicIndex = selectionModel()->currentIndex().sibling(selectionModel()->currentIndex().row(), 1); if (changedArea.contains(currentTopicIndex)) setTopic(selectionModel()->currentIndex()); };
void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QItemSelectionRange changedArea(topLeft, bottomRight); if (changedArea.contains(selectionModel()->currentIndex())) { updateEnabledState(); } };
void TitleSetter::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QItemSelectionRange changedArea(topLeft, bottomRight); QModelIndex currentTopicIndex = selectionModel()->currentIndex().sibling(selectionModel()->currentIndex().row(), 0); if (changedArea.contains(currentTopicIndex)) changeWindowTitle(currentTopicIndex); };
void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QItemSelectionRange changedArea(topLeft, bottomRight); if (changedArea.contains(selectionModel()->currentIndex())) { updateEnabledState(); bool encrypted = false; IrcChannel *chan = qobject_cast<IrcChannel *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcChannelRole).value<QObject *>()); if (chan) encrypted = chan->encrypted(); IrcUser *user = qobject_cast<IrcUser *>(Client::bufferModel()->data(selectionModel()->currentIndex(), NetworkModel::IrcUserRole).value<QObject *>()); if (user) encrypted = user->encrypted(); if (encrypted) ui.encryptionIconLabel->show(); else ui.encryptionIconLabel->hide(); } }