42 int actionIndexAt(
const Widget *w,
const QPoint &pos, Qt::Orientation orientation)
44 const auto actions = w->actions();
45 if (actions.isEmpty())
50 const bool checkTopRight = orientation == Qt::Horizontal && w->layoutDirection() == Qt::RightToLeft;
51 const QPoint topRight = QPoint(w->rect().width(), 0);
52 for (qsizetype index = 0, actionCount = actions.size(); index < actionCount; ++index) {
53 QRect g = w->actionGeometry(actions.at(index));
55 g.setTopRight(topRight);
57 g.setTopLeft(QPoint(0, 0));