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