Commit 13859b08 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECL_OVERRIDE

parent 792b4927
......@@ -78,7 +78,7 @@ namespace Breeze
protected:
virtual bool eventFilter( QObject* o, QEvent* e );
bool eventFilter( QObject* o, QEvent* e ) override;
private:
......
......@@ -53,13 +53,13 @@ namespace Breeze
//@{
//* return data for a given index
virtual QVariant data(const QModelIndex &index, int role) const;
QVariant data(const QModelIndex &index, int role) const override;
//* header data
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
//* number of columns for a given index
virtual int columnCount(const QModelIndex& ) const
int columnCount(const QModelIndex& ) const override
{ return nColumns; }
//@}
......@@ -67,7 +67,7 @@ namespace Breeze
protected:
//* sort
virtual void privateSort( int, Qt::SortOrder )
void privateSort( int, Qt::SortOrder ) override
{}
private:
......
......@@ -55,7 +55,7 @@ namespace Breeze
{ sort( sortColumn(), sortOrder() ); }
//* sort
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ) override;
//* current sorting column
const int& sortColumn( void ) const
......
......@@ -70,14 +70,14 @@ namespace Breeze
//@{
//! flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE
{
if (!index.isValid()) return 0;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
//! unique index for given row, column and parent index
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE
{
// check if index is valid
......@@ -92,11 +92,11 @@ namespace Breeze
}
//! index of parent
virtual QModelIndex parent(const QModelIndex &) const
QModelIndex parent(const QModelIndex &) const Q_DECL_OVERRIDE
{ return QModelIndex(); }
//! number of rows below given index
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE
{ return parent.isValid() ? 0:_values.size(); }
//@}
......
......@@ -65,7 +65,7 @@ namespace Breeze
virtual bool registerWidget( QObject* );
//* duration
virtual void setDuration( int );
void setDuration( int ) override;
//* set object as animated
virtual void setAnimated( const QObject*, bool );
......@@ -78,7 +78,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* );
bool unregisterWidget( QObject* ) override;
protected:
......
......@@ -41,7 +41,7 @@ namespace Breeze
{}
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) override;
//* subcontrol rect
virtual void setHandleRect( const QRect& rect )
......
......@@ -44,7 +44,7 @@ namespace Breeze
{}
//* register dial
virtual bool registerWidget( QWidget*, AnimationModes );
bool registerWidget( QWidget*, AnimationModes ) override;
//* control rect
virtual void setHandleRect( const QObject* object, const QRect& rect )
......
......@@ -43,7 +43,7 @@ namespace Breeze
{}
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) override;
};
......
......@@ -52,7 +52,7 @@ namespace Breeze
{ return _animation; }
//* duration
virtual void setDuration( int duration )
void setDuration( int duration ) override
{ _animation.data()->setDuration( duration ); }
//* opacity
......
......@@ -46,7 +46,7 @@ namespace Breeze
{}
//* duration
void setDuration( int duration )
void setDuration( int duration ) override
{
currentIndexAnimation().data()->setDuration( duration );
previousIndexAnimation().data()->setDuration( duration );
......@@ -124,7 +124,7 @@ namespace Breeze
protected:
//* dirty
virtual void setDirty( void ) const;
void setDirty( void ) const override;
private:
......
......@@ -63,14 +63,14 @@ namespace Breeze
{ return isAnimated( object, point ) ? _data.find( object ).data()->opacity( point ) : AnimationData::OpacityInvalid; }
//* enability
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_data.setEnabled( value );
}
//* duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_data.setDuration( value );
......@@ -79,7 +79,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* object )
bool unregisterWidget( QObject* object ) override
{ return _data.unregisterWidget( object ); }
private:
......
......@@ -46,7 +46,7 @@ namespace Breeze
{}
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) override;
//* needed to avoid warning about virtual function being hidden
using WidgetStateData::animation;
......@@ -102,7 +102,7 @@ namespace Breeze
}
//* duration
virtual void setDuration( int duration )
void setDuration( int duration ) override
{
WidgetStateData::setDuration( duration );
addLineAnimation().data()->setDuration( duration );
......
......@@ -44,7 +44,7 @@ namespace Breeze
{}
//* register scrollbar
virtual bool registerWidget( QWidget*, AnimationModes );
bool registerWidget( QWidget*, AnimationModes ) override;
//*@name accessors
//@{
......
......@@ -71,7 +71,7 @@ namespace Breeze
}
//* duration
virtual void setDuration( int duration )
void setDuration( int duration ) override
{
upArrowAnimation().data()->setDuration( duration );
downArrowAnimation().data()->setDuration( duration );
......
......@@ -76,14 +76,14 @@ namespace Breeze
}
//* enability
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_data.setEnabled( value );
}
//* duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_data.setDuration( value );
......@@ -93,7 +93,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* object )
bool unregisterWidget( QObject* object ) override
{ return _data.unregisterWidget( object ); }
private:
......
......@@ -52,10 +52,10 @@ namespace Breeze
protected Q_SLOTS:
//! initialize animation
virtual bool initializeAnimation( void );
bool initializeAnimation( void ) override;
//! animate
virtual bool animate( void );
bool animate( void ) override;
//! finish animation
virtual void finishAnimation( void );
......
......@@ -55,14 +55,14 @@ namespace Breeze
virtual bool registerWidget( QStackedWidget* );
//! duration
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_data.setEnabled( value );
}
//! duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_data.setDuration( value );
......@@ -71,7 +71,7 @@ namespace Breeze
public Q_SLOTS:
//! remove widget from map
virtual bool unregisterWidget( QObject* object )
bool unregisterWidget( QObject* object ) override
{ return _data.unregisterWidget( object ); }
private:
......
......@@ -47,7 +47,7 @@ namespace Breeze
{}
//* duration
void setDuration( int duration )
void setDuration( int duration ) override
{
currentIndexAnimation().data()->setDuration( duration );
previousIndexAnimation().data()->setDuration( duration );
......
......@@ -59,7 +59,7 @@ namespace Breeze
{ return isAnimated( object, point, mode ) ? data( object, mode ).data()->opacity( point ) : AnimationData::OpacityInvalid; }
//* enability
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_hoverData.setEnabled( value );
......@@ -67,7 +67,7 @@ namespace Breeze
}
//* duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_hoverData.setDuration( value );
......@@ -77,7 +77,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* object )
bool unregisterWidget( QObject* object ) override
{
if( !object ) return false;
bool found = false;
......
......@@ -45,14 +45,14 @@ namespace Breeze
{}
//* enability
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_data.setEnabled( value );
}
//* duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_data.setDuration( value );
......@@ -74,7 +74,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* data )
bool unregisterWidget( QObject* data ) override
{
if( !data ) return false;
......
......@@ -173,10 +173,10 @@ namespace Breeze
protected:
//* generic event filter
virtual bool event( QEvent* );
bool event( QEvent* ) override;
//* paint event
virtual void paintEvent( QPaintEvent* );
void paintEvent( QPaintEvent* ) override;
//* grab widget background
/*!
......
......@@ -104,7 +104,7 @@ namespace Breeze
}
//* duration
virtual void setEnabled( bool value )
void setEnabled( bool value ) override
{
BaseEngine::setEnabled( value );
_hoverData.setEnabled( value );
......@@ -114,7 +114,7 @@ namespace Breeze
}
//* duration
virtual void setDuration( int value )
void setDuration( int value ) override
{
BaseEngine::setDuration( value );
_hoverData.setDuration( value );
......@@ -126,7 +126,7 @@ namespace Breeze
public Q_SLOTS:
//* remove widget from map
virtual bool unregisterWidget( QObject* object )
bool unregisterWidget( QObject* object ) override
{
if( !object ) return false;
bool found = false;
......
......@@ -44,7 +44,7 @@ namespace Breeze
//* event filter
/** blocks all AddChild events */
virtual bool eventFilter( QObject*, QEvent* event )
bool eventFilter( QObject*, QEvent* event ) Q_DECL_OVERRIDE
{ return event->type() == QEvent::ChildAdded; }
};
......
......@@ -63,7 +63,7 @@ namespace Breeze
{ return _registeredWidgets.contains( widget ); }
//* event filter
virtual bool eventFilter( QObject*, QEvent*);
bool eventFilter( QObject*, QEvent*) Q_DECL_OVERRIDE;
//* update state
void updateState( const QWidget*, bool focus, bool hover, qreal opacity, AnimationMode ) const;
......@@ -127,7 +127,7 @@ namespace Breeze
protected:
//* painting
virtual void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
//* return viewport associated to parent widget
virtual QWidget* viewport( void ) const;
......
......@@ -61,7 +61,7 @@ namespace Breeze
protected:
//* painting
virtual void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
private:
......@@ -106,7 +106,7 @@ namespace Breeze
{ return _registeredWidgets.contains( widget ); }
//* event filter
virtual bool eventFilter( QObject*, QEvent*);
bool eventFilter( QObject*, QEvent*) Q_DECL_OVERRIDE;
protected:
......
......@@ -50,7 +50,7 @@ namespace Breeze
void setMode( int );
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
//* true if mnemonics are enabled
const bool& enabled( void ) const
......
......@@ -84,7 +84,7 @@ namespace Breeze
void unregisterWidget( QWidget* );
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
//* shadow tiles
/** is public because it is also needed for mdi windows */
......
......@@ -95,7 +95,7 @@ namespace Breeze
virtual ~SplitterProxy( void );
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
//* enable state
void setEnabled( bool );
......@@ -107,7 +107,7 @@ namespace Breeze
protected:
//* event handler
virtual bool event( QEvent* );
bool event( QEvent* ) Q_DECL_OVERRIDE;
protected:
......
......@@ -113,7 +113,7 @@ namespace BreezePrivate
{}
//* paint
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE
{
// call either proxy or parent class
if( _proxy ) _proxy.data()->paint( painter, option, index );
......@@ -121,7 +121,7 @@ namespace BreezePrivate
}
//* size hint for index
virtual QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const
QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const Q_DECL_OVERRIDE
{
// get size from either proxy or parent class
......
......@@ -96,50 +96,50 @@ namespace Breeze
using ParentStyleClass::unpolish;
//* widget polishing
virtual void polish( QWidget* );
void polish( QWidget* ) Q_DECL_OVERRIDE;
//* widget unpolishing
virtual void unpolish( QWidget* );
void unpolish( QWidget* ) Q_DECL_OVERRIDE;
//* polish scrollarea
void polishScrollArea( QAbstractScrollArea* );
//* pixel metrics
virtual int pixelMetric(PixelMetric, const QStyleOption* = nullptr, const QWidget* = nullptr) const;
int pixelMetric(PixelMetric, const QStyleOption* = nullptr, const QWidget* = nullptr) const Q_DECL_OVERRIDE;
//* style hints
virtual int styleHint(StyleHint, const QStyleOption* = nullptr, const QWidget* = nullptr, QStyleHintReturn* = nullptr) const;
int styleHint(StyleHint, const QStyleOption* = nullptr, const QWidget* = nullptr, QStyleHintReturn* = nullptr) const Q_DECL_OVERRIDE;
//* returns rect corresponding to one widget's subelement
virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* ) const;
QRect subElementRect( SubElement, const QStyleOption*, const QWidget* ) const Q_DECL_OVERRIDE;
//* returns rect corresponding to one widget's subcontrol
virtual QRect subControlRect( ComplexControl, const QStyleOptionComplex*, SubControl, const QWidget* ) const;
QRect subControlRect( ComplexControl, const QStyleOptionComplex*, SubControl, const QWidget* ) const Q_DECL_OVERRIDE;
//* returns size matching contents
QSize sizeFromContents( ContentsType, const QStyleOption*, const QSize&, const QWidget* ) const;
QSize sizeFromContents( ContentsType, const QStyleOption*, const QSize&, const QWidget* ) const Q_DECL_OVERRIDE;
//* returns which subcontrol given QPoint corresponds to
SubControl hitTestComplexControl( ComplexControl, const QStyleOptionComplex*, const QPoint&, const QWidget* ) const;
SubControl hitTestComplexControl( ComplexControl, const QStyleOptionComplex*, const QPoint&, const QWidget* ) const Q_DECL_OVERRIDE;
//* primitives
void drawPrimitive( PrimitiveElement, const QStyleOption*, QPainter*, const QWidget* ) const;
void drawPrimitive( PrimitiveElement, const QStyleOption*, QPainter*, const QWidget* ) const Q_DECL_OVERRIDE;
//* controls
void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const Q_DECL_OVERRIDE;
//* complex controls
void drawComplexControl( ComplexControl, const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
void drawComplexControl( ComplexControl, const QStyleOptionComplex*, QPainter*, const QWidget* ) const Q_DECL_OVERRIDE;
//* generic text rendering
virtual void drawItemText(
void drawItemText(
QPainter*, const QRect&, int alignment, const QPalette&, bool enabled,
const QString&, QPalette::ColorRole = QPalette::NoRole) const;
const QString&, QPalette::ColorRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
//*@name event filters
//@{
virtual bool eventFilter(QObject *, QEvent *);
bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
bool eventFilterScrollArea( QWidget*, QEvent* );
bool eventFilterComboBoxContainer( QWidget*, QEvent* );
bool eventFilterDockWidget( QDockWidget*, QEvent* );
......@@ -169,7 +169,7 @@ namespace Breeze
protected:
//* standard icons
virtual QIcon standardIcon( StandardPixmap pixmap, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const
QIcon standardIcon( StandardPixmap pixmap, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const Q_DECL_OVERRIDE
{ return standardIconImplementation( pixmap, option, widget ); }
//* load configuration
......
......@@ -48,7 +48,7 @@ namespace Breeze
QStringList keys() const;
//* create style
QStyle* create( const QString& );
QStyle* create( const QString& ) Q_DECL_OVERRIDE;
};
......
......@@ -123,7 +123,7 @@ namespace Breeze
{}
//* event filter
virtual bool eventFilter( QObject* object, QEvent* event )
bool eventFilter( QObject* object, QEvent* event ) Q_DECL_OVERRIDE
{
if( event->type() == QEvent::MouseButtonRelease )
......
......@@ -79,13 +79,13 @@ namespace Breeze
void unregisterWidget( QWidget* );
//* event filter [reimplemented]
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
protected:
//* timer event,
/** used to start drag if button is pressed for a long enough time */
void timerEvent( QTimerEvent* );
void timerEvent( QTimerEvent* ) Q_DECL_OVERRIDE;
//* mouse press event
bool mousePressEvent( QObject*, QEvent* );
......
......@@ -51,7 +51,7 @@ namespace Breeze
{ _drawWidgetRects = value; }
//* event filter
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment