summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2012-08-08 15:38:38 -0500
committerDarrell Anderson <[email protected]>2012-08-08 15:38:38 -0500
commita236ea2ad383387255621fc8eaddc3c5d17f1e30 (patch)
treeecacdf1f8c9c02f545e06f8a430a145998fe11ea /src/widgets
parent92b8aca467ad650f9b77a5b6a0f56c27ecbfe80a (diff)
parent47132557a4c58d4ad69bc2898bb2bd9c424b3b64 (diff)
downloadqt3-a236ea2ad383387255621fc8eaddc3c5d17f1e30.tar.gz
qt3-a236ea2ad383387255621fc8eaddc3c5d17f1e30.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
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 787a406..39f6d67 100644
--- a/src/widgets/qdialogbuttons.cpp
+++ b/src/widgets/qdialogbuttons.cpp
@@ -150,6 +150,12 @@ QDialogButtons::isButtonVisible(Button button) const
return ((int)(d->visible & button)) == button;
}
+Q_UINT32
+QDialogButtons::visibleButtons() const
+{
+ return d->visible;
+}
+
void
QDialogButtons::addWidget(QWidget *w)
{
diff --git a/src/widgets/qdialogbuttons_p.h b/src/widgets/qdialogbuttons_p.h
index 73bbfee..56c34c2 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;
+ Q_UINT32 visibleButtons() const;
void addWidget(QWidget *);
diff --git a/src/widgets/qgroupbox.cpp b/src/widgets/qgroupbox.cpp
index 6097ece..7ffcb2a 100644
--- a/src/widgets/qgroupbox.cpp
+++ b/src/widgets/qgroupbox.cpp
@@ -364,8 +364,9 @@ void QGroupBox::paintEvent( QPaintEvent *event )
if(va & AlignTop)
r.moveBy(0, fm.descent());
QColor pen( (QRgb) style().styleHint(QStyle::SH_GroupBox_TextLabelColor, this ) );
- if (!style().styleHint(QStyle::SH_UnderlineAccelerator, this))
+ if ((!style().styleHint(QStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(QStyle::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 40f2b38..ff2e7bc 100644
--- a/src/widgets/qlabel.cpp
+++ b/src/widgets/qlabel.cpp
@@ -838,8 +838,9 @@ void QLabel::drawContents( QPainter *p )
}
#endif
int alignment = align;
- if ((align & ShowPrefix) && !style().styleHint(QStyle::SH_UnderlineAccelerator, this))
+ if ((align & ShowPrefix) && ((!style().styleHint(QStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(QStyle::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 fca4957..383285d 100644
--- a/src/widgets/qtabbar.cpp
+++ b/src/widgets/qtabbar.cpp
@@ -335,7 +335,7 @@ private:
*/
QTabBar::QTabBar( QWidget * parent, const char *name )
- : QWidget( parent, name, WNoAutoErase | WNoMousePropagation )
+ : QWidget( parent, name, WNoAutoErase | WNoMousePropagation ), l(NULL)
{
d = new QTabPrivate;
d->pressed = 0;
@@ -839,7 +839,10 @@ void QTabBar::show()
int QTabBar::currentTab() const
{
- const QTab * t = l->getLast();
+ const QTab * t = 0;
+ if (l) {
+ t = l->getLast();
+ }
return t ? t->id : -1;
}
@@ -965,10 +968,12 @@ void QTabBar::keyPressEvent( QKeyEvent * e )
QTab * QTabBar::tab( int id ) const
{
- QTab * t;
- for( t = l->first(); t; t = l->next() )
- if ( t && t->id == id )
- return t;
+ if (l) {
+ QTab * t;
+ for( t = l->first(); t; t = l->next() )
+ if ( t && t->id == id )
+ return t;
+ }
return 0;
}
@@ -982,7 +987,8 @@ QTab * QTabBar::tab( int id ) const
QTab * QTabBar::tabAt( int index ) const
{
QTab * t;
- t = lstatic->at( index );
+ QPtrList<QTab> internalList = *lstatic;
+ t = internalList.at( index );
return t;
}
@@ -996,8 +1002,9 @@ QTab * QTabBar::tabAt( int index ) const
int QTabBar::indexOf( int id ) const
{
QTab * t;
+ QPtrList<QTab> 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 QTabBar::indexOf( int id ) const
*/
int QTabBar::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 64fc148..b48f416 100644
--- a/src/widgets/qtoolbox.cpp
+++ b/src/widgets/qtoolbox.cpp
@@ -240,8 +240,9 @@ void QToolBoxButton::drawButton( QPainter *p )
fill = &cg.color( QPalette::foregroundRoleFromMode( tb->backgroundMode() ) );
int alignment = AlignLeft | AlignVCenter | ShowPrefix;
- if (!style().styleHint(QStyle::SH_UnderlineAccelerator, this))
+ if ((!style().styleHint(QStyle::SH_UnderlineAccelerator, this)) || ((style().styleHint(QStyle::SH_HideUnderlineAcceleratorWhenAltUp, this)) && (!style().acceleratorsShown()))) {
alignment |= NoAccel;
+ }
style().drawItem( p, tr, alignment, cg,
isEnabled(), 0, txt, -1, fill );