示例#1
0
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());
};
示例#2
0
void InputWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
    QItemSelectionRange changedArea(topLeft, bottomRight);
    if (changedArea.contains(selectionModel()->currentIndex())) {
        updateEnabledState();
    }
};
示例#3
0
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);
};
示例#4
0
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();
    }
}