summaryrefslogtreecommitdiffstats
path: root/src/widgets/qtabbar.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-05 01:01:34 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-05 01:01:34 -0500
commitc73edd8f63289c619c20a8e5d031a24d870c62ee (patch)
tree08cbff3bdbb8c46213f6cf416d5f027f58d4c5f5 /src/widgets/qtabbar.cpp
parentfe7969ef886d7287fa959929ddd33fbad8407884 (diff)
downloadtqt3-c73edd8f63289c619c20a8e5d031a24d870c62ee.tar.gz
tqt3-c73edd8f63289c619c20a8e5d031a24d870c62ee.zip
Automated update from Qt3
Diffstat (limited to 'src/widgets/qtabbar.cpp')
-rw-r--r--src/widgets/qtabbar.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/widgets/qtabbar.cpp b/src/widgets/qtabbar.cpp
index 697b28f5b..caa8e7d15 100644
--- a/src/widgets/qtabbar.cpp
+++ b/src/widgets/qtabbar.cpp
@@ -335,7 +335,7 @@ private:
*/
TQTabBar::TQTabBar( TQWidget * parent, const char *name )
- : TQWidget( parent, name, WNoAutoErase | WNoMousePropagation )
+ : TQWidget( parent, name, WNoAutoErase | WNoMousePropagation ), l(NULL)
{
d = new TQTabPrivate;
d->pressed = 0;
@@ -839,7 +839,10 @@ void TQTabBar::show()
int TQTabBar::currentTab() const
{
- const TQTab * t = l->getLast();
+ const TQTab * t = 0;
+ if (l) {
+ t = l->getLast();
+ }
return t ? t->id : -1;
}
@@ -965,10 +968,12 @@ void TQTabBar::keyPressEvent( TQKeyEvent * e )
TQTab * TQTabBar::tab( int id ) const
{
- TQTab * t;
- for( t = l->first(); t; t = l->next() )
- if ( t && t->id == id )
- return t;
+ if (l) {
+ TQTab * t;
+ for( t = l->first(); t; t = l->next() )
+ if ( t && t->id == id )
+ return t;
+ }
return 0;
}
@@ -982,7 +987,8 @@ TQTab * TQTabBar::tab( int id ) const
TQTab * TQTabBar::tabAt( int index ) const
{
TQTab * t;
- t = lstatic->at( index );
+ TQPtrList<TQTab> internalList = *lstatic;
+ t = internalList.at( index );
return t;
}
@@ -996,8 +1002,9 @@ TQTab * TQTabBar::tabAt( int index ) const
int TQTabBar::indexOf( int id ) const
{
TQTab * t;
+ TQPtrList<TQTab> internalList = *lstatic;
int idx = 0;
- for( t = lstatic->first(); t; t = lstatic->next() ) {
+ for( t = internalList.first(); t; t = internalList.next() ) {
if ( t && t->id == id )
return idx;
idx++;
@@ -1014,7 +1021,10 @@ int TQTabBar::indexOf( int id ) const
*/
int TQTabBar::count() const
{
- return l->count();
+ if (l) {
+ return l->count();
+ }
+ return 0;
}