* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <QMenu>
+#include <QMouseEvent>
+
#include "view.hpp"
#include "marginwidget.hpp"
update();
}
+void MarginWidget::contextMenuEvent(QContextMenuEvent *event)
+{
+ const shared_ptr<ViewItem> r = get_mouse_over_item(mouse_point_);
+ if (!r)
+ return;
+
+ QMenu *menu = r->create_context_menu(this);
+ if (menu)
+ menu->exec(event->globalPos());
+}
+
void MarginWidget::clear_selection()
{
}
private:
void leaveEvent(QEvent *event);
+ virtual void contextMenuEvent(QContextMenuEvent *event);
+
public Q_SLOTS:
virtual void clear_selection();
#include <QApplication>
#include <QFontMetrics>
-#include <QMenu>
#include <QMouseEvent>
#include "ruler.hpp"
view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
}
-void Ruler::contextMenuEvent(QContextMenuEvent *event)
-{
- const shared_ptr<ViewItem> r = get_mouse_over_item(mouse_point_);
- if (!r)
- return;
-
- QMenu *menu = r->create_context_menu(this);
- if (menu)
- menu->exec(event->globalPos());
-}
-
void Ruler::keyPressEvent(QKeyEvent *e)
{
assert(e);
void mouseDoubleClickEvent(QMouseEvent *e);
- void contextMenuEvent(QContextMenuEvent *event);
-
void keyPressEvent(QKeyEvent *e);
private: