[Development] Compiler warnings

Kevin Kofler kevin.kofler at chello.at
Thu Oct 16 21:04:05 CEST 2014


Kurt Pattyn wrote:
> On second thought, I think this is a very bad example. Even while you keep
> binary compatibility, you break semantics here. This is typically a case
> where one should break binary compatibility.
> I am sure (or at least I hope so) that Qt does not allow these kind of
> things.

Qt also tries to maintain partial source compatibility with previous 
versions, so, e.g., Qt 4 has these Qt3Support members of QWidget:

void QWidget::repaint ( bool b )
The boolean parameter b is ignored. Use the no-argument overload instead.

void QWidget::repaint ( int x, int y, int w, int h, bool b )
The boolean parameter b is ignored. Use the four-argument overload instead.

void QWidget::repaint ( const QRect & r, bool b )
The boolean parameter b is ignored. Use the single rect-argument overload 
instead.

void QWidget::repaint ( const QRegion & rgn, bool b )
The boolean parameter b is ignored. Use the single region-argument overload 
instead.

void QWidget::setBackgroundMode ( Qt::BackgroundMode widgetBackground, 
Qt::BackgroundMode paletteBackground = Qt::PaletteBackground )
Sets the color role used for painting the widget's background to background 
mode widgetBackground. The paletteBackground mode parameter is ignored.


I also remember having encountered other functions where parameters were 
documented as no longer used, and even functions documented as having no 
effect anymore, but those were probably in KDE libraries, not in Qt itself.

        Kevin Kofler




More information about the Development mailing list