Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qtabwidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6565    \ingroup organizers
    6666    \ingroup basicwidgets
    67     \mainclass
     67
    6868
    6969    A tab widget provides a tab bar (see QTabBar) and a "page area"
     
    314314        break;
    315315    }
     316
    316317    option->tabBarSize = t;
     318
     319    if (QStyleOptionTabWidgetFrameV2 *tabframe = qstyleoption_cast<QStyleOptionTabWidgetFrameV2*>(option)) {
     320        QRect tbRect = tabBar()->geometry();
     321        QRect selectedTabRect = tabBar()->tabRect(tabBar()->currentIndex());
     322        tabframe->tabBarRect = tbRect;
     323        selectedTabRect.moveTopLeft(selectedTabRect.topLeft() + tbRect.topLeft());
     324        tabframe->selectedTabRect = selectedTabRect;
     325    }
    317326}
    318327
     
    505514
    506515/*!
    507     Returns true if the the page at position \a index is enabled; otherwise returns false.
     516    Returns true if the page at position \a index is enabled; otherwise returns false.
    508517
    509518    \sa setTabEnabled(), QWidget::isEnabled()
     
    691700    connect(d->tabs, SIGNAL(currentChanged(int)),
    692701            this, SLOT(_q_showTab(int)));
    693     connect(d->tabs, SIGNAL(tabMoved(int, int)),
    694             this, SLOT(_q_tabMoved(int, int)));
     702    connect(d->tabs, SIGNAL(tabMoved(int,int)),
     703            this, SLOT(_q_tabMoved(int,int)));
    695704    if (d->tabs->tabsClosable())
    696705        connect(d->tabs, SIGNAL(tabCloseRequested(int)),
     
    757766        return; // nothing to do
    758767
    759     QStyleOptionTabWidgetFrame option;
     768    QStyleOptionTabWidgetFrameV2 option;
    760769    initStyleOption(&option);
    761770
     
    10581067            }
    10591068        }
    1060         if (!qApp->focusWidget())
     1069        if (!QApplication::focusWidget())
    10611070            d->tabs->setFocus();
    10621071    } else {
     
    11681177{
    11691178    Q_D(QTabWidget);
    1170     QStylePainter p(this);
    11711179    if (documentMode()) {
     1180        QStylePainter p(this, tabBar());
    11721181        if (QWidget *w = cornerWidget(Qt::TopLeftCorner)) {
    11731182            QStyleOptionTabBarBaseV2 opt;
     
    11861195        return;
    11871196    }
    1188 
    1189     QStyleOptionTabWidgetFrame opt;
     1197    QStylePainter p(this);
     1198
     1199    QStyleOptionTabWidgetFrameV2 opt;
    11901200    initStyleOption(&opt);
    11911201    opt.rect = d->panelRect;
Note: See TracChangeset for help on using the changeset viewer.