return sizeHint() + QSize(ViewItem::HighlightRadius, 0);
}
-shared_ptr<RowItem> Header::get_mouse_over_item(const QPoint &pt)
+shared_ptr<ViewItem> Header::get_mouse_over_item(const QPoint &pt)
{
const QRect r(0, 0, width() - BaselineOffset, height());
for (auto &i : view_)
QApplication::keyboardModifiers() & Qt::ControlModifier;
// Unselect everything if control is not pressed
- const shared_ptr<RowItem> mouse_over =
+ const shared_ptr<ViewItem> mouse_over =
get_mouse_over_item(event->pos());
for (auto &r : view_)
void Header::contextMenuEvent(QContextMenuEvent *event)
{
- const shared_ptr<RowItem> r = get_mouse_over_item(mouse_point_);
+ const shared_ptr<ViewItem> r = get_mouse_over_item(mouse_point_);
if (!r)
return;
class RowItem;
class View;
+class ViewItem;
class Header : public MarginWidget
{
static const int BaselineOffset;
private:
- std::shared_ptr<pv::view::RowItem> get_mouse_over_item(
+ /**
+ * Gets the first view item which has a label that contains @c pt .
+ * @param pt the point to search with.
+ * @return the view item that has been found, or and empty
+ * @c shared_ptr if no item was found.
+ */
+ std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
const QPoint &pt);
void clear_selection();