Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/debugger/variable/variabletooltip.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 95 | { | |||
---|---|---|---|---|---|
116 | m_view->header()->resizeSection(0, 150); | 116 | m_view->header()->resizeSection(0, 150); | ||
117 | m_view->header()->resizeSection(1, 90); | 117 | m_view->header()->resizeSection(1, 90); | ||
118 | m_view->setSelectionBehavior(QAbstractItemView::SelectRows); | 118 | m_view->setSelectionBehavior(QAbstractItemView::SelectRows); | ||
119 | m_view->setSelectionMode(QAbstractItemView::SingleSelection); | 119 | m_view->setSelectionMode(QAbstractItemView::SingleSelection); | ||
120 | m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | 120 | m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||
121 | m_view->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); | 121 | m_view->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); | ||
122 | l->addWidget(m_view); | 122 | l->addWidget(m_view); | ||
123 | 123 | | |||
124 | m_itemHeight = m_view->indexRowSizeHint(m_model->indexForItem(m_var, 0)); | 124 | QModelIndex varIndex = m_proxy->mapFromSource(m_model->indexForItem(m_var, 0)); | ||
125 | m_itemHeight = m_view->indexRowSizeHint(varIndex); | ||||
125 | connect(m_view->verticalScrollBar(), | 126 | connect(m_view->verticalScrollBar(), | ||
126 | &QScrollBar::rangeChanged, | 127 | &QScrollBar::rangeChanged, | ||
127 | this, | 128 | this, | ||
128 | &VariableToolTip::slotRangeChanged); | 129 | &VariableToolTip::slotRangeChanged); | ||
129 | 130 | | |||
130 | m_selection = m_view->selectionModel(); | 131 | m_selection = m_view->selectionModel(); | ||
131 | m_selection->select(m_model->indexForItem(m_var, 0), | 132 | m_selection->select(varIndex, | ||
132 | QItemSelectionModel::Rows | 133 | QItemSelectionModel::Rows | QItemSelectionModel::ClearAndSelect); | ||
133 | | QItemSelectionModel::ClearAndSelect); | | |||
134 | 134 | | |||
135 | QHBoxLayout* buttonBox = new QHBoxLayout(); | 135 | QHBoxLayout* buttonBox = new QHBoxLayout(); | ||
136 | buttonBox->setContentsMargins(11, 0, 11, 6); | 136 | buttonBox->setContentsMargins(11, 0, 11, 6); | ||
137 | QPushButton* watchThisButton = new QPushButton(i18n("Watch This")); | 137 | QPushButton* watchThisButton = new QPushButton(i18n("Watch This")); | ||
138 | buttonBox->addWidget(watchThisButton); | 138 | buttonBox->addWidget(watchThisButton); | ||
139 | QPushButton* stopOnChangeButton = new QPushButton(i18n("Stop on Change")); | 139 | QPushButton* stopOnChangeButton = new QPushButton(i18n("Stop on Change")); | ||
140 | buttonBox->addWidget(stopOnChangeButton); | 140 | buttonBox->addWidget(stopOnChangeButton); | ||
141 | 141 | | |||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |