summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-28 15:50:52 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-28 15:50:52 -0500
commitebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (patch)
tree2b17bdf68dd5a96e5ef742207426f65010aedac6 /src/widgets
parentb129c37241b8777665c2c063713d496e43e934b2 (diff)
downloadqt3-ebcb1d80bf517aceb69778e1e9f67e5f4da8c484.tar.gz
qt3-ebcb1d80bf517aceb69778e1e9f67e5f4da8c484.zip
Fix build warnings
Thanks to Bruce Sass for the patch!
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/qaction.cpp3
-rw-r--r--src/widgets/qbutton.cpp4
-rw-r--r--src/widgets/qbuttongroup.cpp2
-rw-r--r--src/widgets/qdatetimeedit.cpp2
-rw-r--r--src/widgets/qdockarea.cpp2
-rw-r--r--src/widgets/qdockwindow.cpp4
-rw-r--r--src/widgets/qheader.cpp12
-rw-r--r--src/widgets/qlistbox.cpp6
-rw-r--r--src/widgets/qlistview.cpp12
-rw-r--r--src/widgets/qmainwindow.cpp2
-rw-r--r--src/widgets/qmenubar.cpp4
-rw-r--r--src/widgets/qpopupmenu.cpp6
-rw-r--r--src/widgets/qscrollbar.cpp2
-rw-r--r--src/widgets/qslider.cpp8
-rw-r--r--src/widgets/qspinwidget.cpp2
-rw-r--r--src/widgets/qtextedit.cpp8
-rw-r--r--src/widgets/qtooltip.cpp3
17 files changed, 42 insertions, 40 deletions
diff --git a/src/widgets/qaction.cpp b/src/widgets/qaction.cpp
index 1e68de0..3dd6b27 100644
--- a/src/widgets/qaction.cpp
+++ b/src/widgets/qaction.cpp
@@ -287,11 +287,12 @@ void QActionPrivate::update( uint upd )
if ( upd & Visibility )
mi->popup->setItemVisible( mi->id, visible );
- if ( upd & Icons )
+ if ( upd & Icons ) {
if ( iconset )
mi->popup->changeItem( mi->id, *iconset, t );
else
mi->popup->changeItem( mi->id, QIconSet(), t );
+ }
if ( upd & EverythingElse ) {
mi->popup->changeItem( mi->id, t );
if ( !whatsthis.isEmpty() )
diff --git a/src/widgets/qbutton.cpp b/src/widgets/qbutton.cpp
index 57178fb..044ccf9 100644
--- a/src/widgets/qbutton.cpp
+++ b/src/widgets/qbutton.cpp
@@ -998,8 +998,8 @@ bool QButton::isExclusiveToggle() const
{
#ifndef QT_NO_BUTTONGROUP
return group() && ( group()->isExclusive() ||
- group()->isRadioButtonExclusive() &&
- ::qt_cast<QRadioButton*>(this) );
+ ( group()->isRadioButtonExclusive() &&
+ ::qt_cast<QRadioButton*>(this) ) );
#else
return FALSE;
#endif
diff --git a/src/widgets/qbuttongroup.cpp b/src/widgets/qbuttongroup.cpp
index ebcc580..8737804 100644
--- a/src/widgets/qbuttongroup.cpp
+++ b/src/widgets/qbuttongroup.cpp
@@ -434,7 +434,7 @@ void QButtonGroup::buttonClicked()
void QButtonGroup::buttonToggled( bool on )
{
// introduce a QButtonListIt if calling anything
- if ( !on || !excl_grp && !radio_excl )
+ if ( !on || ( !excl_grp && !radio_excl ) )
return;
QButton *bt = ::qt_cast<QButton*>(sender()); // object that sent the signal
#if defined(QT_CHECK_NULL)
diff --git a/src/widgets/qdatetimeedit.cpp b/src/widgets/qdatetimeedit.cpp
index 6f6ca71..dfd8353 100644
--- a/src/widgets/qdatetimeedit.cpp
+++ b/src/widgets/qdatetimeedit.cpp
@@ -624,7 +624,7 @@ bool QDateTimeEditor::eventFilter( QObject *o, QEvent *e )
QWidget *w = this;
bool hadDateEdit = FALSE;
while ( w ) {
- if ( ::qt_cast<QDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 ||
+ if ( ( ::qt_cast<QDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 ) ||
::qt_cast<QDateTimeEdit*>(w) )
break;
hadDateEdit = hadDateEdit || ::qt_cast<QDateEdit*>(w);
diff --git a/src/widgets/qdockarea.cpp b/src/widgets/qdockarea.cpp
index 2d4d957..663c3d9 100644
--- a/src/widgets/qdockarea.cpp
+++ b/src/widgets/qdockarea.cpp
@@ -691,7 +691,7 @@ void QDockArea::moveDockWindow( QDockWindow *w, const QPoint &p, const QRect &r,
QRect lr = *lines.at( lineOf( dockWindowIndex ) );
if ( dockWindowIndex != -1 ) {
if ( lineStarts.find( w ) != -1 &&
- ( dockWindowIndex < (int)dockWindows->count() - 1 && lineStarts.find( dockWindows->at( dockWindowIndex + 1 ) ) != -1 ||
+ ( ( dockWindowIndex < (int)dockWindows->count() - 1 && lineStarts.find( dockWindows->at( dockWindowIndex + 1 ) ) != -1 ) ||
dockWindowIndex == (int)dockWindows->count() - 1 ) )
wasAloneInLine = TRUE;
dockWindow = dockWindows->take( dockWindowIndex );
diff --git a/src/widgets/qdockwindow.cpp b/src/widgets/qdockwindow.cpp
index 8646ec9..8cdbe17 100644
--- a/src/widgets/qdockwindow.cpp
+++ b/src/widgets/qdockwindow.cpp
@@ -1620,8 +1620,8 @@ void QDockWindow::setCloseMode( int m )
bool QDockWindow::isCloseEnabled() const
{
- return ( ( cMode & Docked ) == Docked && place() == InDock ||
- ( cMode & Undocked ) == Undocked && place() == OutsideDock );
+ return ( ( ( cMode & Docked ) == Docked && place() == InDock ) ||
+ ( ( cMode & Undocked ) == Undocked && place() == OutsideDock ) );
}
int QDockWindow::closeMode() const
diff --git a/src/widgets/qheader.cpp b/src/widgets/qheader.cpp
index 82fd012..a22e299 100644
--- a/src/widgets/qheader.cpp
+++ b/src/widgets/qheader.cpp
@@ -602,10 +602,10 @@ void QHeader::keyPressEvent( QKeyEvent *e )
repaint( sRect( handleIdx ) );
emit pressed( d->i2s[i] );
}
- } else if ( orientation() == Horizontal &&
- (e->key() == Key_Right || e->key() == Key_Left)
- || orientation() == Vertical &&
- (e->key() == Key_Up || e->key() == Key_Down) ) {
+ } else if ( ( orientation() == Horizontal &&
+ (e->key() == Key_Right || e->key() == Key_Left) )
+ || ( orientation() == Vertical &&
+ (e->key() == Key_Up || e->key() == Key_Down) ) ) {
int dir = e->key() == Key_Right || e->key() == Key_Down ? 1 : -1;
int s = d->i2s[i];
if ( e->state() & ControlButton && d->resize[s] ) {
@@ -1638,8 +1638,8 @@ void QHeader::paintEvent( QPaintEvent *e )
style().drawPrimitive( QStyle::PE_FocusRect, &p, fr,
colorGroup() );
}
- if ( orient == Horizontal && r. right() >= e->rect().right() ||
- orient == Vertical && r. bottom() >= e->rect().bottom() )
+ if ( ( orient == Horizontal && r. right() >= e->rect().right() ) ||
+ ( orient == Vertical && r. bottom() >= e->rect().bottom() ) )
return;
}
}
diff --git a/src/widgets/qlistbox.cpp b/src/widgets/qlistbox.cpp
index f5e0057..1083cab 100644
--- a/src/widgets/qlistbox.cpp
+++ b/src/widgets/qlistbox.cpp
@@ -2191,7 +2191,7 @@ void QListBox::mouseReleaseEvent( QMouseEvent *e )
}
QListBoxItem * i = itemAt( e->pos() );
- bool emitClicked = d->mousePressColumn != -1 && d->mousePressRow != -1 || !d->pressedItem;
+ bool emitClicked = ( d->mousePressColumn != -1 && d->mousePressRow != -1 ) || !d->pressedItem;
emitClicked = emitClicked && d->pressedItem == i;
d->pressedItem = 0;
d->mousePressRow = -1;
@@ -2261,7 +2261,7 @@ void QListBox::mouseMoveEvent( QMouseEvent *e )
// move outside the listbox without having seen a press, discard
// it.
if ( !QRect( 0, 0, visibleWidth(), visibleHeight() ).contains( e->pos() ) &&
- ( d->mousePressColumn < 0 && d->mousePressRow < 0 ||
+ ( (d->mousePressColumn < 0 && d->mousePressRow < 0) ||
(e->state() == NoButton && !d->pressedItem) ) )
return;
@@ -4647,7 +4647,7 @@ void QListBox::selectRange( QListBoxItem *from, QListBoxItem *to, bool invert, b
}
} else {
bool sel = !i->s;
- if ( (bool)i->s != sel && sel && i->isSelectable() || !sel ) {
+ if ( ( (bool)i->s != sel && sel && i->isSelectable() ) || !sel ) {
i->s = sel;
changed = TRUE;
updateItem( i );
diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp
index d441a59..304ad18 100644
--- a/src/widgets/qlistview.cpp
+++ b/src/widgets/qlistview.cpp
@@ -1739,7 +1739,7 @@ void QListViewItem::setExpandable( bool enable )
void QListViewItem::enforceSortOrder() const
{
QListView *lv = listView();
- if ( !lv || lv && (lv->d->clearing || lv->d->sortcolumn == Unsorted) )
+ if ( !lv || (lv && (lv->d->clearing || lv->d->sortcolumn == Unsorted)) )
return;
if ( parentItem &&
(parentItem->lsc != lsc || parentItem->lso != lso) )
@@ -5178,7 +5178,7 @@ QListViewItem * QListView::itemAt( const QPoint & viewPos ) const
while( c && c->i && ( c->y + c->i->height() <= g ||
!c->i->isVisible() ||
- c->i->parent() && !c->i->parent()->isVisible() ) )
+ ( c->i->parent() && !c->i->parent()->isVisible() ) ) )
c = d->drawables->next();
QListViewItem *i = (c && c->y <= g) ? c->i : 0;
@@ -6449,7 +6449,7 @@ void QCheckListItem::activate()
{
QListView * lv = listView();
- if ( lv && !lv->isEnabled() || !isEnabled() )
+ if ( ( lv && !lv->isEnabled() ) || !isEnabled() )
return;
QPoint pos;
@@ -7200,7 +7200,7 @@ void QListView::contentsDragEnterEvent( QDragEnterEvent *e )
d->focusItem->dragEntered();
d->focusItem->repaint();
}
- if ( i && i->dropEnabled() && i->acceptDrop( e ) || acceptDrops() )
+ if ( ( i && i->dropEnabled() && i->acceptDrop( e ) ) || acceptDrops() )
e->accept();
else
e->ignore();
@@ -7227,7 +7227,7 @@ void QListView::contentsDragMoveEvent( QDragMoveEvent *e )
} else {
d->autoopenTimer->stop();
}
- if ( i && i->dropEnabled() && i->acceptDrop( e ) || acceptDrops() )
+ if ( ( i && i->dropEnabled() && i->acceptDrop( e ) ) || acceptDrops() )
e->accept();
else
e->ignore();
@@ -7988,7 +7988,7 @@ void QListView::selectRange( QListViewItem *from, QListViewItem *to, bool invert
}
} else {
bool sel = !i->selected;
- if ( (bool)i->selected != sel && sel && i->isSelectable() || !sel ) {
+ if ( ( (bool)i->selected != sel && sel && i->isSelectable() ) || !sel ) {
i->setSelected( sel );
changed = TRUE;
}
diff --git a/src/widgets/qmainwindow.cpp b/src/widgets/qmainwindow.cpp
index 7ad2781..8574866 100644
--- a/src/widgets/qmainwindow.cpp
+++ b/src/widgets/qmainwindow.cpp
@@ -1626,7 +1626,7 @@ bool QMainWindow::eventFilter( QObject* o, QEvent *e )
setUpLayout();
d->tll->activate();
} else if ( e->type() == QEvent::ContextMenu && d->dockMenu &&
- ( ::qt_cast<QDockArea*>(o) && dockMainWindow( o ) || o == d->hideDock || o == d->mb ) ) {
+ ( ( ::qt_cast<QDockArea*>(o) && dockMainWindow( o ) ) || o == d->hideDock || o == d->mb ) ) {
if ( showDockMenu( ( (QMouseEvent*)e )->globalPos() ) ) {
( (QContextMenuEvent*)e )->accept();
return TRUE;
diff --git a/src/widgets/qmenubar.cpp b/src/widgets/qmenubar.cpp
index 45e0ffb..e832fd4 100644
--- a/src/widgets/qmenubar.cpp
+++ b/src/widgets/qmenubar.cpp
@@ -1240,8 +1240,8 @@ void QMenuBar::mouseReleaseEvent( QMouseEvent *e )
return;
mouseBtDn = FALSE; // mouse button up
int item = itemAtPos( e->pos() );
- if ( item >= 0 && !mitems->at(item)->isEnabledAndVisible() ||
- actItem >= 0 && !mitems->at(actItem)->isEnabledAndVisible() ) {
+ if ( ( item >= 0 && !mitems->at(item)->isEnabledAndVisible() ) ||
+ ( actItem >= 0 && !mitems->at(actItem)->isEnabledAndVisible() ) ) {
hidePopups();
setActiveItem( -1 );
return;
diff --git a/src/widgets/qpopupmenu.cpp b/src/widgets/qpopupmenu.cpp
index 9e1e01c..f20cbfc 100644
--- a/src/widgets/qpopupmenu.cpp
+++ b/src/widgets/qpopupmenu.cpp
@@ -652,19 +652,19 @@ void QPopupMenu::popup( const QPoint &pos, int indexAtPoint )
int hGuess = qApp->reverseLayout() ? QEffects::LeftScroll : QEffects::RightScroll;
int vGuess = QEffects::DownScroll;
if ( qApp->reverseLayout() ) {
- if ( snapToMouse && ( x + w/2 > mouse.x() ) ||
+ if ( ( snapToMouse && ( x + w/2 > mouse.x() ) ) ||
( parentMenu && parentMenu->isPopupMenu &&
( x + w/2 > ((QPopupMenu*)parentMenu)->x() ) ) )
hGuess = QEffects::RightScroll;
} else {
- if ( snapToMouse && ( x + w/2 < mouse.x() ) ||
+ if ( ( snapToMouse && ( x + w/2 < mouse.x() ) ) ||
( parentMenu && parentMenu->isPopupMenu &&
( x + w/2 < ((QPopupMenu*)parentMenu)->x() ) ) )
hGuess = QEffects::LeftScroll;
}
#ifndef QT_NO_MENUBAR
- if ( snapToMouse && ( y + h/2 < mouse.y() ) ||
+ if ( ( snapToMouse && ( y + h/2 < mouse.y() ) ) ||
( parentMenu && parentMenu->isMenuBar &&
( y + h/2 < ((QMenuBar*)parentMenu)->mapToGlobal( ((QMenuBar*)parentMenu)->pos() ).y() ) ) )
vGuess = QEffects::UpScroll;
diff --git a/src/widgets/qscrollbar.cpp b/src/widgets/qscrollbar.cpp
index 9a5e8f4..5ffe7e9 100644
--- a/src/widgets/qscrollbar.cpp
+++ b/src/widgets/qscrollbar.cpp
@@ -643,7 +643,7 @@ void QScrollBar::mousePressEvent( QMouseEvent *e )
pressedControl == QStyle::SC_ScrollBarSubPage ||
pressedControl == QStyle::SC_ScrollBarSlider ) &&
((midButtonAbsPos && e->button() == MidButton) ||
- style().styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition) && e->button() == LeftButton)) {
+ (style().styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition) && e->button() == LeftButton)) ) {
QRect sr = style().querySubControlMetrics(QStyle::CC_ScrollBar, this,
QStyle::SC_ScrollBarSlider ),
diff --git a/src/widgets/qslider.cpp b/src/widgets/qslider.cpp
index 1573294..f190f4f 100644
--- a/src/widgets/qslider.cpp
+++ b/src/widgets/qslider.cpp
@@ -447,8 +447,8 @@ void QSlider::mousePressEvent( QMouseEvent *e )
moveSlider( pos - slideLength / 2 );
state = Dragging;
clickOffset = slideLength / 2;
- } else if ( orient == Horizontal && e->pos().x() < r.left() //### goodPart
- || orient == Vertical && e->pos().y() < r.top() ) {
+ } else if ( ( orient == Horizontal && e->pos().x() < r.left() ) //### goodPart
+ || ( orient == Vertical && e->pos().y() < r.top() ) ) {
if ( orient == Horizontal && QApplication::reverseLayout() ) {
state = TimingUp;
addPage();
@@ -460,8 +460,8 @@ void QSlider::mousePressEvent( QMouseEvent *e )
timer = new QTimer( this );
connect( timer, SIGNAL(timeout()), SLOT(repeatTimeout()) );
timer->start( thresholdTime, TRUE );
- } else if ( orient == Horizontal && e->pos().x() > r.right() //### goodPart
- || orient == Vertical && e->pos().y() > r.bottom() ) {
+ } else if ( ( orient == Horizontal && e->pos().x() > r.right() ) //### goodPart
+ || ( orient == Vertical && e->pos().y() > r.bottom() ) ) {
if ( orient == Horizontal && QApplication::reverseLayout() ) {
state = TimingDown;
subtractPage();
diff --git a/src/widgets/qspinwidget.cpp b/src/widgets/qspinwidget.cpp
index 427f710..30cf05e 100644
--- a/src/widgets/qspinwidget.cpp
+++ b/src/widgets/qspinwidget.cpp
@@ -323,7 +323,7 @@ void QSpinWidget::paintEvent( QPaintEvent * )
QStyle::SFlags flags = QStyle::Style_Default;
if (isEnabled())
flags |= QStyle::Style_Enabled;
- if (hasFocus() || focusProxy() && focusProxy()->hasFocus())
+ if (hasFocus() || (focusProxy() && focusProxy()->hasFocus()))
flags |= QStyle::Style_HasFocus;
QStyle::SCFlags active;
diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp
index 0908e84..e45e42d 100644
--- a/src/widgets/qtextedit.cpp
+++ b/src/widgets/qtextedit.cpp
@@ -1395,11 +1395,11 @@ void QTextEdit::keyPressEvent( QKeyEvent *e )
break;
default: {
if ( e->text().length() &&
- ( !( e->state() & ControlButton ) &&
+ ( ( !( e->state() & ControlButton ) &&
#ifndef Q_OS_MACX
!( e->state() & AltButton ) &&
#endif
- !( e->state() & MetaButton ) ||
+ !( e->state() & MetaButton ) ) ||
( ( (e->state()&ControlButton) | AltButton ) == (ControlButton|AltButton) ) ) &&
( !e->ascii() || e->ascii() >= 32 || e->text() == "\t" ) ) {
clearUndoRedoInfo = FALSE;
@@ -2812,7 +2812,7 @@ void QTextEdit::handleMouseMove( const QPoint& pos )
if ( !mousePressed )
return;
- if ( !scrollTimer->isActive() && pos.y() < contentsY() || pos.y() > contentsY() + visibleHeight() )
+ if ( (!scrollTimer->isActive() && pos.y() < contentsY()) || pos.y() > contentsY() + visibleHeight() )
scrollTimer->start( 100, FALSE );
else if ( scrollTimer->isActive() && pos.y() >= contentsY() && pos.y() <= contentsY() + visibleHeight() )
scrollTimer->stop();
@@ -7181,7 +7181,7 @@ void QTextEdit::optimDoAutoScroll()
repaintContents( contentsX(), y, width(), h, FALSE );
}
- if ( !scrollTimer->isActive() && pos.y() < 0 || pos.y() > height() )
+ if ( (!scrollTimer->isActive() && pos.y() < 0) || pos.y() > height() )
scrollTimer->start( 100, FALSE );
else if ( scrollTimer->isActive() && pos.y() >= 0 && pos.y() <= height() )
scrollTimer->stop();
diff --git a/src/widgets/qtooltip.cpp b/src/widgets/qtooltip.cpp
index c327859..ed1a34e 100644
--- a/src/widgets/qtooltip.cpp
+++ b/src/widgets/qtooltip.cpp
@@ -262,11 +262,12 @@ void QTipManager::remove( QWidget *w, const QRect & r, bool delayhide )
if ( t == 0 )
return;
- if ( t == currentTip )
+ if ( t == currentTip ) {
if (!delayhide)
hideTip();
else
currentTip->autoDelete = TRUE;
+ }
if ( t == previousTip )
previousTip = 0;