summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/qdialogbuttons.cpp6
-rw-r--r--src/widgets/qdialogbuttons_p.h1
-rw-r--r--src/widgets/qgroupbox.cpp3
-rw-r--r--src/widgets/qlabel.cpp3
-rw-r--r--src/widgets/qtabbar.cpp28
-rw-r--r--src/widgets/qtoolbox.cpp3
6 files changed, 32 insertions, 12 deletions
diff --git a/src/widgets/qdialogbuttons.cpp b/src/widgets/qdialogbuttons.cpp
index 0762e6c79..4153fb597 100644
--- a/src/widgets/qdialogbuttons.cpp
+++ b/src/widgets/qdialogbuttons.cpp
@@ -150,6 +150,12 @@ TQDialogButtons::isButtonVisible(Button button) const
return ((int)(d->visible & button)) == button;
}
+TQ_UINT32
+TQDialogButtons::visibleButtons() const
+{
+ return d->visible;
+}
+
void
TQDialogButtons::addWidget(TQWidget *w)
{
diff --git a/src/widgets/qdialogbuttons_p.h b/src/widgets/qdialogbuttons_p.h
index d41c6bea5..85507ec18 100644
--- a/src/widgets/qdialogbuttons_p.h
+++ b/src/widgets/qdialogbuttons_p.h
@@ -72,6 +72,7 @@ public:
inline void hideButton(Button b) { setButtonVisible(b, FALSE); }
virtual void setButtonVisible(Button, bool visible);
bool isButtonVisible(Button) const;
+ TQ_UINT32 visibleButtons() const;
void addWidget(TQWidget *);
diff --git a/src/widgets/qgroupbox.cpp b/src/widgets/qgroupbox.cpp
index d78ae735f..39f43a470 100644
--- a/src/widgets/qgroupbox.cpp
+++ b/src/widgets/qgroupbox.cpp
@@ -364,8 +364,9 @@ void TQGroupBox::paintEvent( TQPaintEvent *event )
if(va & AlignTop)
r.moveBy(0, fm.descent());
TQColor pen( (TQRgb) style().styleHint(TQStyle::SH_GroupBox_TextLabelColor, this ) );
- if (!style().styleHint(TQStyle::SH_UnderlineAccelerator, this))
+ if ((!style().styleHint(TQStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(TQStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown()))) {
va |= NoAccel;
+ }
style().drawItem( &paint, r, ShowPrefix | AlignHCenter | va, colorGroup(),
isEnabled(), 0, str, -1, ownPalette() ? 0 : &pen );
paint.setClipRegion( event->region().subtract( r ) ); // clip everything but title
diff --git a/src/widgets/qlabel.cpp b/src/widgets/qlabel.cpp
index c78b99104..314bfe219 100644
--- a/src/widgets/qlabel.cpp
+++ b/src/widgets/qlabel.cpp
@@ -838,8 +838,9 @@ void TQLabel::drawContents( TQPainter *p )
}
#endif
int alignment = align;
- if ((align & ShowPrefix) && !style().styleHint(TQStyle::SH_UnderlineAccelerator, this))
+ if ((align & ShowPrefix) && ((!style().styleHint(TQStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(TQStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown())))) {
alignment |= NoAccel;
+ }
// ordinary text or pixmap label
style().drawItem( p, cr, alignment, colorGroup(), isEnabled(),
pix, ltext );
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;
}
diff --git a/src/widgets/qtoolbox.cpp b/src/widgets/qtoolbox.cpp
index 74f1e6046..d1c30012c 100644
--- a/src/widgets/qtoolbox.cpp
+++ b/src/widgets/qtoolbox.cpp
@@ -240,8 +240,9 @@ void TQToolBoxButton::drawButton( TQPainter *p )
fill = &cg.color( TQPalette::foregroundRoleFromMode( tb->backgroundMode() ) );
int alignment = AlignLeft | AlignVCenter | ShowPrefix;
- if (!style().styleHint(TQStyle::SH_UnderlineAccelerator, this))
+ if ((!style().styleHint(TQStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(TQStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown()))) {
alignment |= NoAccel;
+ }
style().drawItem( p, tr, alignment, cg,
isEnabled(), 0, txt, -1, fill );