| 107 | } |
| 108 | |
| 109 | void SessionChooserDialog::itemEntered(const QModelIndex& index) |
| 110 | { |
| 111 | // The last row says "Create new session", we don't want to delete that |
| 112 | if(index.row() == m_model->rowCount()-1) { |
| 113 | m_deleteButton->hide(); |
| 114 | m_deleteButtonTimer.stop(); |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | // align the delete-button to stay on the right border of the item |
| 119 | // we need the right most column's index |
| 120 | QModelIndex in = m_model->index( index.row(), 1 ); |
| 121 | const QRect rect = m_view->visualRect(in); |
| 122 | m_deleteButton->resize(rect.height(), rect.height()); |
| 123 | |
| 124 | QPoint p(rect.right() - m_deleteButton->size().width(), rect.top()+rect.height()/2-m_deleteButton->height()/2); |
| 125 | m_deleteButton->move(p); |
| 126 | |
| 127 | m_deleteCandidateRow = index.row(); |
| 128 | m_deleteButtonTimer.start(); |
| 129 | } |
| 130 | |
| 131 | void SessionChooserDialog::showDeleteButton() |
| 132 | { |