qtbase: Warnings fixes.

Change-Id: Ie97e36bc168b3de3cae2d0eb615e777884529a06
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
bb10
Friedemann Kleint 2011-11-17 17:09:32 +01:00 committed by Qt by Nokia
parent 572ca43637
commit abe5a0a432
13 changed files with 17 additions and 25 deletions

View File

@ -185,7 +185,7 @@ public:
ExtraButton24 = 0x04000000,
MaxMouseButton = ExtraButton24,
// 4 high-order bits remain available for future use (0x08000000 through 0x40000000).
MouseButtonMask = 0xffffffff,
MouseButtonMask = 0xffffffff
};
Q_DECLARE_FLAGS(MouseButtons, MouseButton)

View File

@ -620,7 +620,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
}
else { // Check to see if a new button has been pressed/released.
for (int check = Qt::LeftButton;
check <= Qt::MaxMouseButton;
check <= int(Qt::MaxMouseButton);
check = check << 1) {
if (check & stateChange) {
button = Qt::MouseButton(check);

View File

@ -458,13 +458,12 @@ bool QWindowsOleEnumFmtEtc::copyFormatEtc(LPFORMATETC dest, LPFORMATETC src) con
*dest = *src;
if (src->ptd) {
LPVOID pout;
LPMALLOC pmalloc;
if (CoGetMalloc(MEMCTX_TASK, &pmalloc) != NOERROR)
return false;
pout = (LPVOID)pmalloc->Alloc(src->ptd->tdSize);
pmalloc->Alloc(src->ptd->tdSize);
memcpy(dest->ptd, src->ptd, size_t(src->ptd->tdSize));
pmalloc->Release();

View File

@ -105,9 +105,6 @@ int QPageSetupDialog::exec()
QWindow *parentWindow = parent->windowHandle();
psd.hwndOwner = parentWindow ? (HWND)QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", parentWindow) : 0;
QRect paperRect = d->printer->paperRect();
QRect pageRect = d->printer->pageRect();
psd.Flags = PSD_MARGINS;
double multiplier = 1;
switch (QLocale::system().measurementSystem()) {

View File

@ -1707,7 +1707,6 @@ void QWin32PrintEnginePrivate::readDevmode(HGLOBAL globalDevmode)
static void draw_text_item_win(const QPointF &pos, const QTextItemInt &ti, HDC hdc,
bool convertToText, const QTransform &xform, const QPointF &topLeft)
{
QFontEngine *fe = ti.fontEngine;
QPointF baseline_pos = xform.inverted().map(xform.map(pos) - topLeft);
SetTextAlign(hdc, TA_BASELINE);

View File

@ -841,7 +841,7 @@ void QAccessibleWidget::doAction(const QString &actionName)
}
}
QStringList QAccessibleWidget::keyBindingsForAction(const QString &actionName) const
QStringList QAccessibleWidget::keyBindingsForAction(const QString & /* actionName */) const
{
return QStringList();
}

View File

@ -906,6 +906,7 @@ QStringList QFileDialogPrivate::typedFiles() const
files << qt_tildeExpansion(editText);
#else
files << editText;
Q_UNUSED(q)
#endif
} else {
// " is used to separate files like so: "file1" "file2" "file3" ...

View File

@ -3436,9 +3436,9 @@ void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int sta
Q_UNUSED(start)
Q_UNUSED(end)
Q_Q(QAbstractItemView);
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsInserted(index, start, end);
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
@ -3487,10 +3487,10 @@ void QAbstractItemViewPrivate::_q_modelDestroyed()
*/
void QAbstractItemViewPrivate::_q_layoutChanged()
{
Q_Q(QAbstractItemView);
doDelayedItemsLayout();
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->modelReset();
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);

View File

@ -284,6 +284,7 @@ void QInputContext::update()
*/
void QInputContext::widgetDestroyed(QWidget *widget)
{
Q_UNUSED(widget)
// nothing to be done here, as we use a weak pointer in the input panel
}

View File

@ -375,7 +375,6 @@ void QWidgetPrivate::updateWidgetTransform()
*/
QInputContext *QWidget::inputContext()
{
Q_D(QWidget);
if (!testAttribute(Qt::WA_InputMethodEnabled))
return 0;

View File

@ -749,7 +749,6 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
cg = QPalette::Inactive;
QRect textRect = subElementRect(QStyle::SE_ItemViewItemText, option, widget);
QRect itemRect = subElementRect(QStyle::SE_ItemViewItemFocusRect, option, widget).adjusted(-1, 0, 1, 0);
itemRect.setTop(vopt->rect.top());
itemRect.setBottom(vopt->rect.bottom());
@ -765,7 +764,6 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
QPixmap pixmap;
if (vopt->backgroundBrush.style() != Qt::NoBrush) {
QPointF oldBO = painter->brushOrigin();
painter->setBrushOrigin(vopt->rect.topLeft());
painter->fillRect(vopt->rect, vopt->backgroundBrush);
}
@ -1065,9 +1063,6 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *bar
= qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
int stateId = MBI_NORMAL;
if (disabled)
stateId = MBI_DISABLED;
bool isIndeterminate = (bar->minimum == 0 && bar->maximum == 0);
bool vertical = false;
bool inverted = false;
@ -1245,10 +1240,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins);
checkcol = qMax(menuitem->maxIconWidth, int(6 + size.cx + margins.cxLeftWidth + margins.cxRightWidth));
}
QColor darkLine = option->palette.background().color().darker(108);
QColor lightLine = option->palette.background().color().lighter(107);
QRect rect = option->rect;
QStyleOptionMenuItem mbiCopy = *menuitem;
//draw vertical menu line
QPoint p1 = QStyle::visualPos(option->direction, menuitem->rect, QPoint(checkcol, rect.top()));

View File

@ -2471,7 +2471,6 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight);
p->save();
QRect r = option->rect;
p->setPen(highlight.darker(120));
QColor dimHighlight(qMin(highlight.red()/2 + 110, 255),
qMin(highlight.green()/2 + 110, 255),

View File

@ -474,14 +474,19 @@ QMatchData QCompletionEngine::filterHistory()
QAbstractItemModel *source = c->proxy->sourceModel();
if (curParts.count() <= 1 || c->proxy->showAll || !source)
return QMatchData();
bool isDirModel = false;
bool isFsModel = false;
#ifndef QT_NO_DIRMODEL
isDirModel = (qobject_cast<QDirModel *>(source) != 0);
const bool isDirModel = (qobject_cast<QDirModel *>(source) != 0);
#else
const bool isDirModel = false;
#endif
Q_UNUSED(isDirModel)
#ifndef QT_NO_FILESYSTEMMODEL
isFsModel = (qobject_cast<QFileSystemModel *>(source) != 0);
const bool isFsModel = (qobject_cast<QFileSystemModel *>(source) != 0);
#else
const bool isFsModel = false;
#endif
Q_UNUSED(isFsModel)
QVector<int> v;
QIndexMapper im(v);
QMatchData m(im, -1, true);