Exemple #1
0
def step_impl(context):
    """
    :type context: behave.runner.Context
    """
    tracklist = context.main_window.tracklist
    viewport = tracklist.viewport()

    blank_start_time_cell = tracklist_cell_pos(
        context, row=5, column=TracklistModel.Columns.start_time)

    another_cell = tracklist_cell_pos(context, row=5, column=0)

    QTest.mouseClick(viewport, Qt.LeftButton, pos=blank_start_time_cell)
    QTest.mouseClick(viewport, Qt.LeftButton, pos=another_cell)
def open_context_menu_at(context, row, column):
    viewport = context.main_window.tracklist.viewport()
    url_cell_pos = tracklist_cell_pos(context, row=row, column=column)

    QTest.mouseClick(viewport, Qt.LeftButton, pos=url_cell_pos)
    # Right click doesn't work for some reason...
    # QTest.mouseClick(viewport, Qt.RightButton, pos=url_cell_pos)

    context.tracklist.show_context_menu(url_cell_pos)

    return QApplication.activePopupWidget()
def step_impl(context):
    """
    :type context: behave.runner.Context
    """
    viewport = context.main_window.tracklist.viewport()
    url_cell_pos = tracklist_cell_pos(context, row=1, column=TracklistModel.Columns.url)

    # Right click doesn't work for some reason...
    # QTest.mouseClick(viewport, Qt.RightButton, pos=url_cell_pos)

    context.tracklist.show_context_menu(url_cell_pos)