Commit 65b607ee authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more nullptr

GIT_SILENT
parent 6b8a820e
......@@ -98,7 +98,7 @@ namespace Oxygen
// use a dialog, so that all user input is blocked
// use WX11BypassWM and moving away so that it's not actually visible
// grab only mouse, so that keyboard can be used e.g. for switching windows
m_grabber = new QDialog( 0, Qt::X11BypassWindowManagerHint );
m_grabber = new QDialog( nullptr, Qt::X11BypassWindowManagerHint );
m_grabber->move( -1000, -1000 );
m_grabber->setModal( true );
m_grabber->show();
......@@ -122,7 +122,7 @@ namespace Oxygen
// delete old m_grabber
delete m_grabber;
m_grabber = 0;
m_grabber = nullptr;
// check button
if( static_cast< QMouseEvent* >( e )->button() != Qt::LeftButton ) return true;
......
......@@ -165,7 +165,7 @@ namespace Oxygen
}
delete m_detectDialog;
m_detectDialog = 0;
m_detectDialog = nullptr;
}
......
......@@ -211,7 +211,7 @@ namespace Oxygen
*/
QPoint rootPosition( position );
xcb_get_geometry_cookie_t cookie( xcb_get_geometry( connection, winId() ) );
ScopedPointer<xcb_get_geometry_reply_t> reply( xcb_get_geometry_reply( connection, cookie, 0x0 ) );
ScopedPointer<xcb_get_geometry_reply_t> reply( xcb_get_geometry_reply( connection, cookie, nullptr ) );
if( reply )
{
......@@ -221,7 +221,7 @@ namespace Oxygen
-reply.data()->border_width,
-reply.data()->border_width ) );
ScopedPointer< xcb_translate_coordinates_reply_t> coordReply( xcb_translate_coordinates_reply( connection, coordCookie, 0x0 ) );
ScopedPointer< xcb_translate_coordinates_reply_t> coordReply( xcb_translate_coordinates_reply( connection, coordCookie, nullptr ) );
if( coordReply )
{
......@@ -238,7 +238,7 @@ namespace Oxygen
// create atom if not found
const QString atomName( "_NET_WM_MOVERESIZE" );
xcb_intern_atom_cookie_t cookie( xcb_intern_atom( connection, false, atomName.size(), qPrintable( atomName ) ) );
ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, 0x0 ) );
ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, nullptr ) );
m_moveResizeAtom = reply ? reply->atom:0;
}
......
......@@ -35,7 +35,7 @@ namespace Oxygen
BaseDataMap( void ):
QMap<Key, Value>(),
_enabled( true ),
_lastKey( NULL )
_lastKey( nullptr )
{}
//* destructor
......@@ -75,7 +75,7 @@ namespace Oxygen
{
if( _lastValue ) _lastValue.clear();
_lastKey = NULL;
_lastKey = nullptr;
}
......
......@@ -20,7 +20,7 @@ namespace Oxygen
AnimationData( parent, target ),
_opacity( 0 ),
_progress( 0 ),
_currentObject( 0 ),
_currentObject( nullptr ),
_entered( false )
{
......
......@@ -116,7 +116,7 @@ namespace Oxygen
//* current object
void clearCurrentObject( void )
{ _currentObject = NULL; }
{ _currentObject = nullptr; }
//@}
......
......@@ -26,7 +26,7 @@ namespace Oxygen
public:
//* constructor
explicit AnimationConfigWidget( QWidget* = 0 );
explicit AnimationConfigWidget( QWidget* = nullptr );
public Q_SLOTS:
......
......@@ -30,7 +30,7 @@ namespace Oxygen
public:
//* constructor
explicit FrameDemoWidget( QWidget* = 0 );
explicit FrameDemoWidget( QWidget* = nullptr );
void addMessages();
......
......@@ -27,7 +27,7 @@ namespace Oxygen
public:
//* constructor
explicit ListDemoWidget( QWidget* = 0 );
explicit ListDemoWidget( QWidget* = nullptr );
public Q_SLOTS:
......
......@@ -50,7 +50,7 @@ namespace Oxygen
//_______________________________________________________________________
void Simulator::wait( int delay )
{ _events.append( Event( Event::Wait, 0, delay ) ); }
{ _events.append( Event( Event::Wait, nullptr, delay ) ); }
//_______________________________________________________________________
void Simulator::click( QWidget* receiver, int delay )
......@@ -470,7 +470,7 @@ namespace Oxygen
{
// retrieve menu
QMenu* menu( 0 );
QMenu* menu( nullptr );
if( const QToolButton* button = qobject_cast<QToolButton*>( receiver ) ) menu = button->menu();
else if( const QPushButton* button = qobject_cast<QPushButton*>( receiver ) ) menu = button->menu();
......
......@@ -17,7 +17,7 @@ class WidgetStyleChooser : public QPushButton
{
Q_OBJECT
public:
explicit WidgetStyleChooser( QWidget *parent = 0 );
explicit WidgetStyleChooser( QWidget *parent = nullptr );
KActionMenu *createStyleSelectionMenu( const QString &text, const QString &selectedStyleName=QString() );
......
......@@ -18,8 +18,8 @@ namespace Oxygen
//______________________________________________________________
TabDemoWidget::TabDemoWidget( QWidget* parent ):
DemoWidget( parent ),
_left( new QToolButton(0) ),
_right( new QToolButton(0) )
_left( new QToolButton(nullptr) ),
_right( new QToolButton(nullptr) )
{
ui.setupUi( this );
connect( ui.tabPositionComboBox, SIGNAL(currentIndexChanged(int)), SLOT(changeTabPosition(int)) );
......@@ -48,8 +48,8 @@ namespace Oxygen
ui.tabWidget->setCornerWidget( _left, Qt::TopLeftCorner );
ui.tabWidget->setCornerWidget( _right, Qt::TopRightCorner );
} else {
ui.tabWidget->setCornerWidget( 0, Qt::TopLeftCorner );
ui.tabWidget->setCornerWidget( 0, Qt::TopRightCorner );
ui.tabWidget->setCornerWidget( nullptr, Qt::TopLeftCorner );
ui.tabWidget->setCornerWidget( nullptr, Qt::TopRightCorner );
}
_left->setVisible( value );
......
......@@ -154,7 +154,7 @@ namespace Oxygen
if( FrameShadowBase* shadow = qobject_cast<FrameShadowBase*>(child) )
{
shadow->hide();
shadow->setParent(0);
shadow->setParent(nullptr);
shadow->deleteLater();
}
}
......@@ -242,7 +242,7 @@ namespace Oxygen
//____________________________________________________________________________________
void FrameShadowFactory::installShadow( QWidget* widget, StyleHelper& helper, ShadowArea area, bool flat ) const
{
FrameShadowBase *shadow(0);
FrameShadowBase *shadow(nullptr);
if( flat ) shadow = new FlatFrameShadow( area, helper );
else shadow = new SunkenFrameShadow( area, helper );
shadow->setParent(widget);
......
......@@ -6850,7 +6850,7 @@ namespace Oxygen
}
// toolbar animation
QWidget* parent( widget ? widget->parentWidget():0 );
QWidget* parent( widget ? widget->parentWidget():nullptr );
const bool toolBarAnimated( isInToolBar && _animations->toolBarEngine().isAnimated( parent ) );
const QRect animatedRect( _animations->toolBarEngine().animatedRect( parent ) );
const QRect currentRect( _animations->toolBarEngine().currentRect( parent ) );
......
......@@ -20,7 +20,7 @@ namespace Oxygen
public:
//* constructor
explicit StylePlugin(QObject *parent = 0):
explicit StylePlugin(QObject *parent = nullptr):
QStylePlugin(parent)
{}
......
......@@ -178,7 +178,7 @@ namespace Oxygen
//@}
//* returns first widget matching given class, or 0L if none
//* returns first widget matching given class, or nullptr if none
template<typename T> T findParent( const QWidget* ) const;
//* enability
......@@ -285,11 +285,11 @@ namespace Oxygen
T WindowManager::findParent( const QWidget* widget ) const
{
if( !widget ) return 0L;
if( !widget ) return nullptr;
for( QWidget* parent = widget->parentWidget(); parent; parent = parent->parentWidget() )
{ if( T cast = qobject_cast<T>(parent) ) return cast; }
return 0L;
return nullptr;
}
}
......
......@@ -192,7 +192,7 @@ namespace Oxygen
if( widget->autoFillBackground() )
{ widgets.append( widget ); }
QWidget *parent(0);
QWidget *parent(nullptr);
// get highest level parent
for( parent = widget->parentWidget(); parent; parent = parent->parentWidget() )
......
......@@ -131,7 +131,7 @@ namespace Oxygen
//@}
//* grap pixmap
QPixmap grab( QWidget* = 0, QRect = QRect() );
QPixmap grab( QWidget* = nullptr, QRect = QRect() );
//* true if animated
bool isAnimated( void ) const
......
......@@ -31,7 +31,7 @@ namespace Oxygen
public:
//* constructor
explicit BaseAnimationConfigWidget( QWidget* = 0 );
explicit BaseAnimationConfigWidget( QWidget* = nullptr );
//* destructor
virtual ~BaseAnimationConfigWidget( void );
......
......@@ -729,9 +729,9 @@ namespace Oxygen
{
if( !w ) return nullptr;
if( w->autoFillBackground() ) return w;
if( w->isWindow() ) return 0;
if( w->isWindow() ) return nullptr;
for( const QWidget* parent = w->parentWidget(); parent!=0; parent = parent->parentWidget() )
for( const QWidget* parent = w->parentWidget(); parent!=nullptr; parent = parent->parentWidget() )
{
if( parent->autoFillBackground() ) return parent;
if( parent == w->window() ) break;
......
Supports Markdown
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