Пример #1
0
void TabbedWidget::interactiveRename()
{
    if (pressed_position != -1)
    {
        interactiveRename(pressed_position);
        pressed_position = -1;
    }
    else
    {
        interactiveRename(current_position);
    }
}
Пример #2
0
void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
{
    if (QWhatsThis::inWhatsThisMode()) return;

    m_lineEdit->hide();

    if (event->x() < 0) return;

    int index = tabAt(event->x());

    if (event->button() == Qt::LeftButton)
    {
        if (event->x() <= m_tabWidths.last())
            interactiveRename(m_tabs.at(index));
        else if (event->x() > m_tabWidths.last())
            emit newTabRequested();
    }

    QWidget::mouseDoubleClickEvent(event);
}
Пример #3
0
void TabbedWidget::mouseDoubleClickEvent(QMouseEvent* e)
{
    if (QWhatsThis::inWhatsThisMode()) return;

    int position;
    int width;

    inline_edit->hide();

    if (e->x() < 0)
        return ;

    for (position = 0, width = 0; (position < int(areas.count())) && (e->x() >= width); position++)
        width += areas[position];

    if ((e->x() <= width) && (e->button() == Qt::LeftButton) && current_position == position - 1)
    {
        interactiveRename(position - 1);
    }
    else if ((e->x() > width) && (e->button() == Qt::LeftButton))
        emit addItem();
}