1
//////////////////////////////////////////////////////////////////////////////
2
// oxygentabdemowidget.cpp
3
// oxygen tabwidget demo widget
6
// Copyright (c) 2010 Hugo Pereira Da Costa <hugo@oxygen-icons.org>
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to
10
// deal in the Software without restriction, including without limitation the
11
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
// sell copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
15
// The above copyright notice and this permission notice shall be included in
16
// all copies or substantial portions of the Software.
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25
//////////////////////////////////////////////////////////////////////////////
27
#include "oxygentabdemowidget.h"
28
#include "oxygentabdemowidget.moc"
29
#include "oxygentabwidget.moc"
31
#include <QtGui/QToolButton>
37
//______________________________________________________________
38
TabDemoWidget::TabDemoWidget( QWidget* parent ):
40
_left( new QToolButton(0) ),
41
_right( new QToolButton(0) )
44
connect( ui.tabPositionComboBox, SIGNAL( currentIndexChanged( int ) ), SLOT( changeTabPosition( int ) ) );
45
connect( ui.textPositionComboBox, SIGNAL( currentIndexChanged( int ) ), SLOT( changeTextPosition( int ) ) );
46
connect( ui.documentModeCheckBox, SIGNAL( toggled( bool ) ), SLOT( toggleDocumentMode( bool ) ) );
47
connect( ui.cornerWidgetsCheckBox, SIGNAL( toggled( bool ) ), SLOT( toggleCornerWidgets( bool ) ) );
48
connect( ui.tabBarVisibilityCheckBox, SIGNAL( toggled( bool ) ), ui.tabWidget, SLOT( toggleTabBarVisibility( bool ) ) );
49
ui.textPositionComboBox->setCurrentIndex( 1 );
51
_left->setIcon( KIcon( "tab-new" ) );
52
_left->setVisible( false );
54
_right->setIcon( KIcon( "tab-close" ) );
55
_right->setVisible( false );
59
//______________________________________________________________
60
void TabDemoWidget::benchmark( void )
62
if( !isVisible() ) return;
66
simulator().selectComboBoxItem( ui.tabPositionComboBox, 1 );
67
simulator().selectComboBoxItem( ui.tabPositionComboBox, 2 );
68
simulator().selectComboBoxItem( ui.tabPositionComboBox, 3 );
69
simulator().selectComboBoxItem( ui.tabPositionComboBox, 0 );
71
simulator().selectComboBoxItem( ui.textPositionComboBox, 0 );
72
simulator().selectComboBoxItem( ui.textPositionComboBox, 2 );
73
simulator().selectComboBoxItem( ui.textPositionComboBox, 1 );
79
simulator().click( ui.documentModeCheckBox );
80
simulator().click( ui.documentModeCheckBox );
82
simulator().click( ui.cornerWidgetsCheckBox );
83
simulator().click( ui.cornerWidgetsCheckBox );
85
simulator().click( ui.tabBarVisibilityCheckBox );
86
simulator().click( ui.tabBarVisibilityCheckBox );
91
simulator().selectTab( ui.tabWidget, 1 );
92
simulator().selectTab( ui.tabWidget, 2 );
93
simulator().selectTab( ui.tabWidget, 3 );
94
simulator().selectTab( ui.tabWidget, 0 );