From 53d9fcc84b837fe44d1df8608c4080f36f8b176f Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 3 Oct 2026 17:48:19 -0300
Subject: Replace zero pointer constants with nullptr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 microbe/btreebase.cpp                              |  10 +--
 microbe/btreenode.cpp                              |  10 +--
 microbe/expression.h                               |   2 +-
 microbe/instruction.cpp                            |   2 +-
 microbe/main.cpp                                   |  14 +--
 microbe/microbe.cpp                                |   4 +-
 microbe/optimizer.cpp                              |   2 +-
 microbe/parser.cpp                                 |  18 ++--
 microbe/parser.h                                   |   6 +-
 microbe/pic14.cpp                                  |  52 +++++------
 src/canvasitemparts.cpp                            |   4 +-
 src/canvasitemparts.h                              |   4 +-
 src/canvasmanipulator.cpp                          | 100 ++++++++++-----------
 src/cells.h                                        |   2 +-
 src/circuitdocument.cpp                            |  16 ++--
 src/circuitdocument.h                              |   6 +-
 src/circuitview.cpp                                |   2 +-
 src/circuitview.h                                  |   2 +-
 src/ciwidgetmgr.cpp                                |   4 +-
 src/cnitem.cpp                                     |  12 +--
 src/cnitemgroup.cpp                                |   6 +-
 src/cnitemgroup.h                                  |   2 +-
 src/connector.cpp                                  |   6 +-
 src/connector.h                                    |   6 +-
 src/core/main.cpp                                  |   6 +-
 src/docmanager.cpp                                 |  48 +++++-----
 src/docmanager.h                                   |  18 ++--
 src/document.cpp                                   |   8 +-
 src/document.h                                     |   4 +-
 src/drawparts/dpline.h                             |   4 +-
 src/drawparts/dptext.h                             |   2 +-
 src/drawparts/solidshape.h                         |   4 +-
 src/electronics/component.cpp                      |   8 +-
 src/electronics/components/addac.cpp               |  12 +--
 src/electronics/components/addac.h                 |   6 +-
 src/electronics/components/bidirled.h              |   2 +-
 src/electronics/components/binarycounter.cpp       |   2 +-
 src/electronics/components/binarycounter.h         |   2 +-
 src/electronics/components/bussplitter.h           |   2 +-
 src/electronics/components/demultiplexer.cpp       |   2 +-
 src/electronics/components/demultiplexer.h         |   2 +-
 src/electronics/components/dependentsource.h       |   8 +-
 src/electronics/components/discretelogic.h         |   8 +-
 src/electronics/components/ec555.h                 |   2 +-
 src/electronics/components/ecbcdto7segment.cpp     |   6 +-
 src/electronics/components/ecbcdto7segment.h       |   2 +-
 src/electronics/components/ecbjt.h                 |   2 +-
 src/electronics/components/eccapacitor.h           |   2 +-
 src/electronics/components/ecclockinput.h          |   2 +-
 src/electronics/components/eccurrentsignal.h       |   2 +-
 src/electronics/components/eccurrentsource.h       |   2 +-
 src/electronics/components/ecdiode.h               |   2 +-
 src/electronics/components/ecfixedvoltage.h        |   2 +-
 src/electronics/components/ecground.h              |   2 +-
 src/electronics/components/eckeypad.h              |   2 +-
 src/electronics/components/ecled.h                 |   2 +-
 src/electronics/components/ecopamp.h               |   2 +-
 src/electronics/components/ecpotentiometer.h       |   2 +-
 src/electronics/components/ecresistor.h            |   2 +-
 src/electronics/components/ecsevensegment.cpp      |   6 +-
 src/electronics/components/ecsevensegment.h        |   2 +-
 src/electronics/components/ecsignallamp.h          |   2 +-
 src/electronics/components/ecsubcircuit.h          |   2 +-
 src/electronics/components/ecvoltagesignal.h       |   2 +-
 src/electronics/components/ecvoltagesource.h       |   2 +-
 src/electronics/components/externalconnection.h    |   2 +-
 src/electronics/components/flipflop.h              |   6 +-
 src/electronics/components/fulladder.cpp           |   4 +-
 src/electronics/components/fulladder.h             |   2 +-
 src/electronics/components/inductor.h              |   2 +-
 src/electronics/components/magnitudecomparator.h   |   2 +-
 src/electronics/components/matrixdisplay.cpp       |  10 +--
 src/electronics/components/matrixdisplay.h         |   2 +-
 src/electronics/components/matrixdisplaydriver.cpp |   6 +-
 src/electronics/components/matrixdisplaydriver.h   |   2 +-
 src/electronics/components/meter.h                 |   6 +-
 src/electronics/components/multiinputgate.cpp      |   8 +-
 src/electronics/components/multiinputgate.h        |  12 +--
 src/electronics/components/multiplexer.cpp         |   2 +-
 src/electronics/components/multiplexer.h           |   2 +-
 .../components/parallelportcomponent.cpp           |   4 +-
 src/electronics/components/parallelportcomponent.h |   2 +-
 src/electronics/components/probe.cpp               |   2 +-
 src/electronics/components/probe.h                 |  10 +--
 src/electronics/components/pushswitch.h            |   4 +-
 src/electronics/components/ram.cpp                 |   6 +-
 src/electronics/components/ram.h                   |   2 +-
 src/electronics/components/resistordip.cpp         |   4 +-
 src/electronics/components/resistordip.h           |   2 +-
 src/electronics/components/rotoswitch.h            |   2 +-
 src/electronics/components/serialportcomponent.cpp |   2 +-
 src/electronics/components/serialportcomponent.h   |   2 +-
 src/electronics/components/toggleswitch.h          |   8 +-
 src/electronics/ecnode.cpp                         |   6 +-
 src/electronics/ecnode.h                           |   4 +-
 src/electronics/pin.h                              |   2 +-
 src/electronics/simulation/circuit.cpp             |  22 ++---
 src/electronics/simulation/circuit.h               |   2 +-
 src/electronics/simulation/diode.cpp               |   2 +-
 src/electronics/simulation/element.cpp             |  42 ++++-----
 src/electronics/simulation/elementset.cpp          |   2 +-
 src/electronics/simulation/logic.cpp               |  14 +--
 src/electronics/switch.cpp                         |   4 +-
 src/eventinfo.cpp                                  |   2 +-
 src/flowcodedocument.cpp                           |  12 +--
 src/flowcodedocument.h                             |   4 +-
 src/flowcodeview.cpp                               |   4 +-
 src/flowcodeview.h                                 |   2 +-
 src/flowcontainer.cpp                              |   6 +-
 src/flowparts/callsub.h                            |   2 +-
 src/flowparts/count.h                              |   2 +-
 src/flowparts/delay.h                              |   2 +-
 src/flowparts/embed.h                              |   2 +-
 src/flowparts/end.h                                |   2 +-
 src/flowparts/flowpart.cpp                         |  36 ++++----
 src/flowparts/flowpart.h                           |   2 +-
 src/flowparts/inputbutton.h                        |   2 +-
 src/flowparts/interrupt.h                          |   2 +-
 src/flowparts/keypad.h                             |   2 +-
 src/flowparts/pinmapping.cpp                       |  14 +--
 src/flowparts/pinmapping.h                         |   4 +-
 src/flowparts/pulse.h                              |   2 +-
 src/flowparts/readport.h                           |   2 +-
 src/flowparts/setpin.h                             |   2 +-
 src/flowparts/sevenseg.h                           |   2 +-
 src/flowparts/start.h                              |   2 +-
 src/flowparts/sub.h                                |   2 +-
 src/flowparts/testpin.h                            |   2 +-
 src/flowparts/unary.h                              |   2 +-
 src/flowparts/varassignment.h                      |   2 +-
 src/flowparts/varcomparison.h                      |   2 +-
 src/flowparts/writeport.h                          |   2 +-
 src/fpnode.cpp                                     |   6 +-
 src/fpnode.h                                       |   2 +-
 src/gui/colorcombo.h                               |   2 +-
 src/gui/contexthelp.cpp                            |   2 +-
 src/gui/contexthelp.h                              |   2 +-
 src/gui/doublespinbox.cpp                          |   4 +-
 src/gui/doublespinbox.h                            |   2 +-
 src/gui/itemeditor.cpp                             |   4 +-
 src/gui/itemeditor.h                               |   2 +-
 src/gui/itemselector.cpp                           |  18 ++--
 src/gui/itemselector.h                             |   8 +-
 src/gui/logview.h                                  |   2 +-
 src/gui/microselectwidget.h                        |   2 +-
 src/gui/microsettingsdlg.cpp                       |  20 ++---
 src/gui/microsettingsdlg.h                         |   2 +-
 src/gui/orientationwidget.cpp                      |   2 +-
 src/gui/orientationwidget.h                        |   2 +-
 src/gui/oscilloscope.cpp                           |  12 +--
 src/gui/oscilloscope.h                             |   2 +-
 src/gui/oscilloscopeview.cpp                       |   4 +-
 src/gui/oscilloscopeview.h                         |   2 +-
 src/gui/outputmethoddlg.h                          |   2 +-
 src/gui/pieditor.cpp                               |   2 +-
 src/gui/pieditor.h                                 |  16 ++--
 src/gui/probepositioner.cpp                        |   6 +-
 src/gui/probepositioner.h                          |   2 +-
 src/gui/programmerdlg.h                            |   2 +-
 src/gui/projectdlgs.cpp                            |   2 +-
 src/gui/projectdlgs.h                              |   6 +-
 src/gui/propertieslistview.cpp                     |  10 +--
 src/gui/propertieslistview.h                       |   2 +-
 src/gui/settingsdlg.cpp                            |   6 +-
 src/icndocument.cpp                                |  74 +++++++--------
 src/icndocument.h                                  |  12 +--
 src/icnview.cpp                                    |   2 +-
 src/icnview.h                                      |   2 +-
 src/item.cpp                                       |   8 +-
 src/itemdocument.cpp                               |  26 +++---
 src/itemdocument.h                                 |   8 +-
 src/itemdocumentdata.cpp                           |  30 +++----
 src/itemgroup.cpp                                  |   8 +-
 src/itemgroup.h                                    |   2 +-
 src/iteminterface.cpp                              |  22 ++---
 src/iteminterface.h                                |   2 +-
 src/itemlibrary.cpp                                |   4 +-
 src/itemlibrary.h                                  |   2 +-
 src/itemview.cpp                                   |  14 +--
 src/itemview.h                                     |   2 +-
 src/katemdi.cpp                                    |  14 +--
 src/katemdi.h                                      |   6 +-
 src/ktechlab.cpp                                   |  34 +++----
 src/languages/asmparser.h                          |   2 +-
 src/languages/externallanguage.cpp                 |   4 +-
 src/languages/flowcode.cpp                         |   6 +-
 src/languages/language.cpp                         |   8 +-
 src/languages/languagemanager.cpp                  |   2 +-
 src/languages/languagemanager.h                    |   2 +-
 src/languages/processchain.cpp                     |  38 ++++----
 src/languages/processchain.h                       |   4 +-
 src/mechanics/chassiscircular2.h                   |   2 +-
 src/mechanics/mechanicsdocument.cpp                |  12 +--
 src/mechanics/mechanicsdocument.h                  |   4 +-
 src/mechanics/mechanicsgroup.h                     |   2 +-
 src/mechanics/mechanicssimulation.cpp              |   8 +-
 src/mechanics/mechanicsview.cpp                    |   2 +-
 src/mechanics/mechanicsview.h                      |   2 +-
 src/micro/microinfo.cpp                            |   4 +-
 src/micro/microlibrary.cpp                         |   6 +-
 src/micro/picinfo.cpp                              |   2 +-
 src/micro/picinfo12bit.cpp                         |  72 +++++++--------
 src/micro/picinfo14bit.cpp                         |  80 ++++++++---------
 src/micro/picinfo16bit.cpp                         |  76 ++++++++--------
 src/microsettings.cpp                              |   6 +-
 src/node.cpp                                       |  10 +--
 src/node.h                                         |   6 +-
 src/nodegroup.cpp                                  |  26 +++---
 src/nodegroup.h                                    |   4 +-
 src/oscilloscopedata.h                             |   6 +-
 src/picitem.cpp                                    |   4 +-
 src/projectmanager.cpp                             |  30 +++----
 src/projectmanager.h                               |   2 +-
 src/resizeoverlay.cpp                              |  12 +--
 src/resizeoverlay.h                                |   2 +-
 src/simulator.cpp                                  |  38 ++++----
 src/simulator.h                                    |   2 +-
 src/textdocument.cpp                               |  12 +--
 src/textdocument.h                                 |   8 +-
 src/textview.cpp                                   |   8 +-
 src/textview.h                                     |   2 +-
 src/view.cpp                                       |   4 +-
 src/view.h                                         |   4 +-
 src/viewcontainer.cpp                              |  26 +++---
 src/viewcontainer.h                                |   4 +-
 225 files changed, 909 insertions(+), 909 deletions(-)

diff --git a/microbe/btreebase.cpp b/microbe/btreebase.cpp
index 02d6b6d..35838d2 100644
--- a/microbe/btreebase.cpp
+++ b/microbe/btreebase.cpp
@@ -25,14 +25,14 @@
 
 BTreeBase::BTreeBase()
 {
-	m_root = 0L;
+	m_root = nullptr;
 }
 
 void BTreeBase::deleteTree()
 {
 	if(m_root) m_root->deleteChildren();
 	delete m_root;
-	m_root = 0L;
+	m_root = nullptr;
 }
 
 BTreeBase::~BTreeBase()
@@ -75,8 +75,8 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/)
 
 	BTreeNode *l = t.current()->left();
 	BTreeNode *r = t.current()->right();
-	BTreeNode *n = 0;
-	BTreeNode *z = 0;
+	BTreeNode *n = nullptr;
+	BTreeNode *z = nullptr;
 	
 
 	// Deal with situations where there are two constants so we want
@@ -240,7 +240,7 @@ void BTreeBase::replaceNode(BTreeNode *node, BTreeNode *replacement)
 	if( !node->parent() )
 	{
 		setRoot(replacement);
-		replacement->setParent(0L);
+		replacement->setParent(nullptr);
 		return;
 	}
 	if( node->parent()->left() == node ) node->parent()->setLeft(replacement);
diff --git a/microbe/btreenode.cpp b/microbe/btreenode.cpp
index 27d49cc..6dc610e 100644
--- a/microbe/btreenode.cpp
+++ b/microbe/btreenode.cpp
@@ -23,9 +23,9 @@
 
 BTreeNode::BTreeNode()
 {
-	m_parent = 0L;
-	m_left = 0L;
-	m_right = 0L;
+	m_parent = nullptr;
+	m_left = nullptr;
+	m_right = nullptr;
 	m_type = unset;
 }
 
@@ -54,8 +54,8 @@ void BTreeNode::deleteChildren()
 		delete m_right;
 	}
 	
-	m_left = 0L;
-	m_right = 0L;
+	m_left = nullptr;
+	m_right = nullptr;
 	
 	return;
 }
diff --git a/microbe/expression.h b/microbe/expression.h
index 1e34bb8..8057887 100644
--- a/microbe/expression.h
+++ b/microbe/expression.h
@@ -99,7 +99,7 @@ class Expression
 	
 		TQString stripBrackets( TQString expression );
 	
-		void mistake( Microbe::MistakeType type, const TQString & context = 0 );
+		void mistake( Microbe::MistakeType type, const TQString & context = nullptr );
 	
 		SourceLine m_sourceLine;
 	
diff --git a/microbe/instruction.cpp b/microbe/instruction.cpp
index 2a77b98..3237fe9 100644
--- a/microbe/instruction.cpp
+++ b/microbe/instruction.cpp
@@ -909,7 +909,7 @@ Instruction * Code::instruction( const TQString & label ) const
 				return *it;
 		}
 	}
-	return 0l;
+	return nullptr;
 }
 
 
diff --git a/microbe/main.cpp b/microbe/main.cpp
index affa666..d503c59 100644
--- a/microbe/main.cpp
+++ b/microbe/main.cpp
@@ -38,19 +38,19 @@ static const char version[] = "0.3";
 
 static TDECmdLineOptions options[] =
 {
-	{ "show-source", I18N_NOOP( "Show source code lines in assembly output"),0},
-	{ "nooptimize", I18N_NOOP( "Do not attempt optimization of generated instructions."),0},
-	{ "+[Input URL]", I18N_NOOP( "Input filename" ),0},
-	{ "+[Output URL]", I18N_NOOP( "Output filename" ),0},
+	{ "show-source", I18N_NOOP( "Show source code lines in assembly output"),nullptr},
+	{ "nooptimize", I18N_NOOP( "Do not attempt optimization of generated instructions."),nullptr},
+	{ "+[Input URL]", I18N_NOOP( "Input filename" ),nullptr},
+	{ "+[Output URL]", I18N_NOOP( "Output filename" ),nullptr},
 	TDECmdLineLastOption
 };
 
 int main(int argc, char **argv)
 {
 	TDEAboutData about("microbe", I18N_NOOP("Microbe"), version, description,
-					 TDEAboutData::License_GPL, "(C) 2004-2005, The KTechlab developers", 0, "http://ktechlab.org", "ktechlab-devel@lists.sourceforge.net" );
-	about.addAuthor( "Daniel Clarke", 0, "daniel.jc@gmail.com" );
-	about.addAuthor( "David Saxton", 0, "david@bluehaze.org" );
+					 TDEAboutData::License_GPL, "(C) 2004-2005, The KTechlab developers", nullptr, "http://ktechlab.org", "ktechlab-devel@lists.sourceforge.net" );
+	about.addAuthor( "Daniel Clarke", nullptr, "daniel.jc@gmail.com" );
+	about.addAuthor( "David Saxton", nullptr, "david@bluehaze.org" );
     TDECmdLineArgs::init(argc, argv, &about);
     TDECmdLineArgs::addCmdLineOptions( options );
 	
diff --git a/microbe/microbe.cpp b/microbe/microbe.cpp
index 0f1be5c..d9f0cb0 100644
--- a/microbe/microbe.cpp
+++ b/microbe/microbe.cpp
@@ -85,7 +85,7 @@ TQString Microbe::compile( const TQString & url, bool showSource, bool optimize
 	else
 	{
 		m_errorReport += i18n("Could not open file '%1'\n").arg(url);
-		return 0;
+		return nullptr;
 	}
 	
 	Parser parser(this);
@@ -99,7 +99,7 @@ TQString Microbe::compile( const TQString & url, bool showSource, bool optimize
 	
 	PIC14 * pic = makePic();
 	if ( !pic )
-		return 0;
+		return nullptr;
 	
 	Code * code = parser.parse( m_program );
 	pic->setCode( code );
diff --git a/microbe/optimizer.cpp b/microbe/optimizer.cpp
index 1c8ce13..132b6e3 100644
--- a/microbe/optimizer.cpp
+++ b/microbe/optimizer.cpp
@@ -29,7 +29,7 @@ TQString binary( uchar val )
 
 Optimizer::Optimizer()
 {
-	m_pCode = 0l;
+	m_pCode = nullptr;
 }
 
 
diff --git a/microbe/parser.cpp b/microbe/parser.cpp
index 1324298..5b8ee7f 100644
--- a/microbe/parser.cpp
+++ b/microbe/parser.cpp
@@ -39,8 +39,8 @@ using namespace std;
 //BEGIN class Parser
 Parser::Parser( Microbe * _mb )
 {
-	m_code = 0;
-	m_pPic = 0;
+	m_code = nullptr;
+	m_pPic = nullptr;
 	mb = _mb;
 	// Set up statement definitions.
 	StatementDefinition definition;
@@ -79,18 +79,18 @@ Parser::Parser( Microbe * _mb )
 	definition.clear();
 	
 	definition.append( Field(Field::Expression, "expression") );
-	definition.append( Field(Field::FixedString, 0, "then", true) );
+	definition.append( Field(Field::FixedString, nullptr, "then", true) );
 	definition.append( Field(Field::Code, "ifCode") );
 	definition.append( Field(Field::Newline) );
-	definition.append( Field(Field::FixedString, 0, "else", false) );
+	definition.append( Field(Field::FixedString, nullptr, "else", false) );
 	definition.append( Field(Field::Code, "elseCode") );
 	m_definitionMap["if"] = definition;
 	definition.clear();
 	
 	definition.append( Field(Field::Expression, "initExpression") );
-	definition.append( Field(Field::FixedString, 0, "to", true) );
+	definition.append( Field(Field::FixedString, nullptr, "to", true) );
 	definition.append( Field(Field::Expression, "toExpression") );
-	definition.append( Field(Field::FixedString, 0, "step", false) );
+	definition.append( Field(Field::FixedString, nullptr, "step", false) );
 	definition.append( Field(Field::Expression, "stepExpression") );
 	definition.append( Field(Field::Code, "code") );
 	m_definitionMap["for"] = definition;
@@ -122,7 +122,7 @@ Parser::Parser( Microbe * _mb )
 	
 	definition.append( Field(Field::Code, "code") );
 	definition.append( Field(Field::Newline) );
-	definition.append( Field(Field::FixedString, 0, "until", true) );
+	definition.append( Field(Field::FixedString, nullptr, "until", true) );
 	definition.append( Field(Field::Expression, "expression") );
 	m_definitionMap["repeat"] = definition;
 	definition.clear();
@@ -428,7 +428,7 @@ Code * Parser::parse( const SourceLineList & lines )
 			if ( saveSingleLine )
 			{
 				SourceLineList list;
-				list << SourceLine( token, 0, -1 );
+				list << SourceLine( token, nullptr, -1 );
 				fieldMap[field.key()] = OutputField( list );
 			}
 			
@@ -688,7 +688,7 @@ void Parser::processStatement( const TQString & name, const OutputFieldMap & fie
 		}
 		
 		SourceLineList tempList;
-		tempList << SourceLine( fieldMap["initExpression"].string(), 0, -1 );
+		tempList << SourceLine( fieldMap["initExpression"].string(), nullptr, -1 );
 		
 		m_pPic->Sfor( parseWithChild( fieldMap["code"].bracedCode() ), parseWithChild( tempList ), endExpr, variable, step, stepPositive );
 	}
diff --git a/microbe/parser.h b/microbe/parser.h
index 7a51e41..e8c2667 100644
--- a/microbe/parser.h
+++ b/microbe/parser.h
@@ -114,7 +114,7 @@ class Field
 		/**
 		 * Create a Field.
 		 */
-		Field( Type type, const TQString & key = 0 );
+		Field( Type type, const TQString & key = nullptr );
 		/**
 		 * Create a Field (this constructor should only be used with
 		 * FixedStrings.
@@ -203,7 +203,7 @@ class Parser
 		 * message, only applicable to some errors (such as a use of a reserved
 		 * keyword).
 		 */
-		void mistake( Microbe::MistakeType type, const TQString & context = 0 );
+		void mistake( Microbe::MistakeType type, const TQString & context = nullptr );
 		/**
 		 * Creates a new instance of the parser class with all state information
 		 * (class members) copied from this instance of the class. Don't forget to
@@ -255,7 +255,7 @@ class Parser
 		 * false. Else, *ok is set to true and the literal value is returned.
 		 * @see isLiteral
 		 */
-		static int literalToInt( const TQString & literal, bool * ok = 0l );
+		static int literalToInt( const TQString & literal, bool * ok = nullptr );
 		/**
 		 * Does the specified operation on the given numbers and returns the result.
 		 */
diff --git a/microbe/pic14.cpp b/microbe/pic14.cpp
index 1ac4c27..8f03925 100644
--- a/microbe/pic14.cpp
+++ b/microbe/pic14.cpp
@@ -52,7 +52,7 @@ bool LEDSegTable[][7] = {
 PIC14::PIC14( Microbe * master, Type type )
 {
 	mb = master;
-	m_pCode = 0l;
+	m_pCode = nullptr;
 	m_type = type;
 	
 }
@@ -161,7 +161,7 @@ TQString PIC14::minimalTypeString() const
 	}
 	
 	kdError() << k_funcinfo << "Unknown PIC type = " << m_type << endl;
-	return 0;;
+	return nullptr;;
 }
 
 
@@ -363,14 +363,14 @@ void PIC14::add( TQString val1, TQString val2, LocationType val1Type, LocationTy
 
 	switch(val1Type)
 	{
-		case num:  m_pCode->append(new Instr_movlw( val1.toInt( 0, 0 ) )); break;
+		case num:  m_pCode->append(new Instr_movlw( val1.toInt( nullptr, 0 ) )); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val1,0)); break;
 	}
 	
 	switch(val2Type)
 	{
-		case num: m_pCode->append(new Instr_addlw(val2.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_addlw(val2.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_addwf(val2,0)); break;
 	}
@@ -380,13 +380,13 @@ void PIC14::subtract( const TQString & val1, const TQString & val2, LocationType
 {
 	switch(val2Type)
 	{
-		case num:  m_pCode->append(new Instr_movlw( val2.toInt( 0, 0 ) )); break;
+		case num:  m_pCode->append(new Instr_movlw( val2.toInt( nullptr, 0 ) )); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val2,0)); break;
 	}
 	switch(val1Type)
 	{
-		case num: m_pCode->append(new Instr_sublw(val1.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_sublw(val1.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_subwf(val1,0)); break;
 	}
@@ -394,7 +394,7 @@ void PIC14::subtract( const TQString & val1, const TQString & val2, LocationType
 
 void PIC14::assignNum(const TQString & val)
 {
-	m_pCode->append(new Instr_movlw(val.toInt( 0, 0 )));
+	m_pCode->append(new Instr_movlw(val.toInt( nullptr, 0 )));
 }
 
 void PIC14::assignVar(const TQString &val)
@@ -421,7 +421,7 @@ void PIC14::mul(TQString val1, TQString val2, LocationType val1Type, LocationTyp
 	// First, set _i argument
 	switch(val1Type)
 	{
-		case num: m_pCode->append(new Instr_movlw(val1.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_movlw(val1.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val1,0)); break;
 	}
@@ -431,7 +431,7 @@ void PIC14::mul(TQString val1, TQString val2, LocationType val1Type, LocationTyp
 	// Then set _j argument
 	switch(val2Type)
 	{
-		case num: m_pCode->append(new Instr_movlw(val2.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_movlw(val2.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val2,0)); break;
 	}
@@ -475,7 +475,7 @@ void PIC14::div( const TQString & val1, const TQString & val2, LocationType val1
 	// First, set _i argument
 	switch(val1Type)
 	{
-		case num: m_pCode->append(new Instr_movlw(val1.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_movlw(val1.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val1,0)); break;
 	}
@@ -485,7 +485,7 @@ void PIC14::div( const TQString & val1, const TQString & val2, LocationType val1
 	// Then set _j argument
 	switch(val2Type)
 	{
-		case num: m_pCode->append(new Instr_movlw(val2.toInt( 0, 0 ))); break;
+		case num: m_pCode->append(new Instr_movlw(val2.toInt( nullptr, 0 ))); break;
 		case work: break;
 		case var: m_pCode->append(new Instr_movf(val2,0)); break;
 	}
@@ -557,7 +557,7 @@ void PIC14::ifInitCode( const TQString &val1, const TQString &val2, LocationType
 	switch(val1Type)
 	{
 		case num:
-			m_pCode->append(new Instr_movlw(val1.toInt( 0, 0 )));
+			m_pCode->append(new Instr_movlw(val1.toInt( nullptr, 0 )));
 			break;
 			
 		case work:
@@ -571,7 +571,7 @@ void PIC14::ifInitCode( const TQString &val1, const TQString &val2, LocationType
 	switch(val2Type)
 	{
 		case num:
-			m_pCode->append(new Instr_sublw(val2.toInt( 0, 0 )));
+			m_pCode->append(new Instr_sublw(val2.toInt( nullptr, 0 )));
 			break;
 			
 		case work:
@@ -706,7 +706,7 @@ void PIC14::Swhile( Code * whileCode, const TQString &expression)
 	m_pCode->queueLabel( ul, Code::Middle );
 	
 	// If the condition is not true, just fall through
-	m_parser->compileConditionalExpression( expression, whileCode, 0 );
+	m_parser->compileConditionalExpression( expression, whileCode, nullptr );
 }
 
 
@@ -722,7 +722,7 @@ void PIC14::Srepeat( Code * repeatCode, const TQString &expression)
 	m_pCode->merge( repeatCode );
 	
 	// If the condition is true, just fall through
-	m_parser->compileConditionalExpression( expression, 0, elseCode );
+	m_parser->compileConditionalExpression( expression, nullptr, elseCode );
 }
 
 void PIC14::Sif( Code * ifCode, Code * elseCode, const TQString &expression)
@@ -744,7 +744,7 @@ void PIC14::Sfor( Code * forCode, Code * initCode, const TQString &expression, c
 	}
 	else
 	{
-		forCode->append(new Instr_movlw(step.toInt( 0, 0 )));
+		forCode->append(new Instr_movlw(step.toInt( nullptr, 0 )));
 		if (stepPositive)
 			forCode->append(new Instr_addwf(variable,1));
 		else
@@ -756,7 +756,7 @@ void PIC14::Sfor( Code * forCode, Code * initCode, const TQString &expression, c
 	
 	m_pCode->queueLabel( ul );
 
-	m_parser->compileConditionalExpression( expression, forCode, 0 );
+	m_parser->compileConditionalExpression( expression, forCode, nullptr );
 }
 
 
@@ -1038,7 +1038,7 @@ void PIC14::Skeypad( const Variable & pinMap )
 	
 	// Test if any key was pressed; if not, then start again
 // 	std::cout << "mb->alias(\"Keypad_None\")="<<mb->alias("Keypad_None") << std::endl;
-	m_pCode->append( new Instr_sublw( mb->alias("Keypad_None").toInt( 0, 0 ) ), Code::Subroutine );
+	m_pCode->append( new Instr_sublw( mb->alias("Keypad_None").toInt( nullptr, 0 ) ), Code::Subroutine );
 	m_pCode->append( new Instr_btfsc( "STATUS","Z" ), Code::Subroutine );
 	m_pCode->append( new Instr_goto( subName ), Code::Subroutine );
 	m_pCode->append( new Instr_goto( waitName ), Code::Subroutine );
@@ -1052,7 +1052,7 @@ void PIC14::Skeypad( const Variable & pinMap )
 	
 	// Key was pressed; now we wait until the key is released again
 	m_pCode->append( new Instr_call( readName ), Code::Subroutine );
-	m_pCode->append( new Instr_sublw( mb->alias("Keypad_None").toInt( 0, 0 ) ), Code::Subroutine );
+	m_pCode->append( new Instr_sublw( mb->alias("Keypad_None").toInt( nullptr, 0 ) ), Code::Subroutine );
 	m_pCode->append( new Instr_btfss( "STATUS","Z" ), Code::Subroutine );
 	m_pCode->append( new Instr_goto( waitName ), Code::Subroutine );
 	m_pCode->append( new Instr_movf( "__m", 0 ), Code::Subroutine );
@@ -1084,7 +1084,7 @@ void PIC14::Skeypad( const Variable & pinMap )
 		{
 			PortPin colPin = pinMap.portPinList()[4+col];
 			m_pCode->append( new Instr_btfsc( colPin.port(), TQString::number( colPin.pin() ) ), Code::Subroutine );
-			m_pCode->append( new Instr_retlw( mb->alias( TQString("Keypad_%1_%2").arg(row+1).arg(col+1) ).toInt( 0, 0 ) ), Code::Subroutine );
+			m_pCode->append( new Instr_retlw( mb->alias( TQString("Keypad_%1_%2").arg(row+1).arg(col+1) ).toInt( nullptr, 0 ) ), Code::Subroutine );
 		}
 		
 		// Make the low again
@@ -1092,7 +1092,7 @@ void PIC14::Skeypad( const Variable & pinMap )
 	}
 	
 	// No key was pressed
-	m_pCode->append( new Instr_retlw( mb->alias("Keypad_None").toInt( 0, 0 ) ), Code::Subroutine );
+	m_pCode->append( new Instr_retlw( mb->alias("Keypad_None").toInt( nullptr, 0 ) ), Code::Subroutine );
 	//END Read current value of keypad subroutine
 }
 
@@ -1103,7 +1103,7 @@ void PIC14::bitwise( Expression::Operation op, const TQString &r_val1, const TQS
 	// There is no instruction for notting a literal,
 	// so instead I am going to XOR with 0xFF
 	if( op == Expression::bwnot ) val1 = "0xFF";
-	if( val1IsNum ) m_pCode->append(new Instr_movlw(val1.toInt( 0, 0 )));// result += instruction("movlw\t"+val1);
+	if( val1IsNum ) m_pCode->append(new Instr_movlw(val1.toInt( nullptr, 0 )));// result += instruction("movlw\t"+val1);
 	else m_pCode->append(new Instr_movf(val1,0));//result += instruction("movf\t"+val1+",0");
 	
 	TQString opString;
@@ -1111,10 +1111,10 @@ void PIC14::bitwise( Expression::Operation op, const TQString &r_val1, const TQS
 	{
 		switch(op)
 		{
-			case Expression::bwand: m_pCode->append(new Instr_andlw(val2.toInt( 0, 0 ))); break;
-			case Expression::bwor: m_pCode->append(new Instr_iorlw(val2.toInt( 0, 0 ))); break;
-			case Expression::bwxor: m_pCode->append(new Instr_xorlw(val2.toInt( 0, 0 ))); break;
-			case Expression::bwnot: m_pCode->append(new Instr_xorlw(val2.toInt( 0, 0 ))); break;
+			case Expression::bwand: m_pCode->append(new Instr_andlw(val2.toInt( nullptr, 0 ))); break;
+			case Expression::bwor: m_pCode->append(new Instr_iorlw(val2.toInt( nullptr, 0 ))); break;
+			case Expression::bwxor: m_pCode->append(new Instr_xorlw(val2.toInt( nullptr, 0 ))); break;
+			case Expression::bwnot: m_pCode->append(new Instr_xorlw(val2.toInt( nullptr, 0 ))); break;
 			default: break;
 		}
 	}
diff --git a/src/canvasitemparts.cpp b/src/canvasitemparts.cpp
index c8eca6b..c150062 100644
--- a/src/canvasitemparts.cpp
+++ b/src/canvasitemparts.cpp
@@ -280,7 +280,7 @@ Button::Button( const TQString & id, CNItem * parent, bool isToggle, const TQRec
 	: Widget( id, parent, r, canvas )
 {
 	b_isToggle = isToggle;
-	m_button = new ToolButton(0l);
+	m_button = new ToolButton(nullptr);
 	m_button->setUsesTextLabel(false);
 	m_button->setToggleButton(b_isToggle);
 	connect( m_button, TQ_SIGNAL(pressed()), this, TQ_SLOT(slotStateChanged()) );
@@ -438,7 +438,7 @@ Slider::Slider( const TQString & id, CNItem * parent, const TQRect & r, TQCanvas
 	: Widget( id, parent, r, canvas )
 {
 	m_orientation = TQt::Vertical;
-	m_slider = new SliderWidget(0l);
+	m_slider = new SliderWidget(nullptr);
 	m_slider->setPaletteBackgroundColor(TQt::white);
 	m_slider->setPaletteForegroundColor(TQt::white);
 	m_slider->setEraseColor(TQt::white);
diff --git a/src/canvasitemparts.h b/src/canvasitemparts.h
index d34f07c..55c4c81 100644
--- a/src/canvasitemparts.h
+++ b/src/canvasitemparts.h
@@ -186,8 +186,8 @@ class ToolButton : public TQToolButton
 		virtual void mouseDoubleClickEvent ( TQMouseEvent *e ) { TQToolButton::mouseDoubleClickEvent(e); }
 		virtual void mouseMoveEvent( TQMouseEvent *e ) { TQToolButton::mouseMoveEvent(e); }
 		virtual void wheelEvent( TQWheelEvent *e ) { TQToolButton::wheelEvent(e); }
-		virtual void enterEvent() { TQToolButton::enterEvent(0l); }
-		virtual void leaveEvent() { TQToolButton::leaveEvent(0l); }
+		virtual void enterEvent() { TQToolButton::enterEvent(nullptr); }
+		virtual void leaveEvent() { TQToolButton::leaveEvent(nullptr); }
 		
 		void setAngleDegrees( int angleDegrees ) { m_angleDegrees = angleDegrees; }
 		
diff --git a/src/canvasmanipulator.cpp b/src/canvasmanipulator.cpp
index b501301..34dda97 100644
--- a/src/canvasmanipulator.cpp
+++ b/src/canvasmanipulator.cpp
@@ -38,12 +38,12 @@ CMManager::CMManager( ItemDocument *itemDocument )
 	: TQObject()
 {
 	b_allowItemScroll = true;
-	p_lastMouseOverResizeHandle = 0l;
-	m_canvasManipulator = 0l;
+	p_lastMouseOverResizeHandle = nullptr;
+	m_canvasManipulator = nullptr;
 	p_itemDocument = itemDocument;
 	m_cmState = 0;
-	p_lastMouseOverItem = 0l;
-	p_lastItemClicked = 0l;
+	p_lastMouseOverItem = nullptr;
+	p_lastItemClicked = nullptr;
 	m_drawAction = -1;
 	m_allowItemScrollTmr = new TQTimer(this);
 	connect( m_allowItemScrollTmr, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotAllowItemScroll()) );
@@ -56,9 +56,9 @@ CMManager::CMManager( ItemDocument *itemDocument )
 CMManager::~CMManager()
 {
 	delete m_allowItemScrollTmr;
-	m_allowItemScrollTmr = 0l;
+	m_allowItemScrollTmr = nullptr;
 	delete m_canvasManipulator;
-	m_canvasManipulator = 0l;
+	m_canvasManipulator = nullptr;
 	
 	const ManipulatorInfoList::iterator end = m_manipulatorInfoList.end();
 	for ( ManipulatorInfoList::iterator it = m_manipulatorInfoList.begin(); it != end; ++it )
@@ -80,7 +80,7 @@ void CMManager::addManipulatorInfo( ManipulatorInfo *eventInfo )
 void CMManager::cancelCurrentManipulation()
 {
 	delete m_canvasManipulator;
-	m_canvasManipulator = 0l;
+	m_canvasManipulator = nullptr;
 	setRepeatedAddId();
 }
 
@@ -92,7 +92,7 @@ void CMManager::mousePressEvent( EventInfo eventInfo )
 		if (m_canvasManipulator->mousePressedRepeat(eventInfo))
 		{
 			delete m_canvasManipulator;
-			m_canvasManipulator = 0l;
+			m_canvasManipulator = nullptr;
 		}
 		return;
 	}
@@ -180,7 +180,7 @@ void CMManager::mousePressEvent( EventInfo eventInfo )
 		if (m_canvasManipulator->mousePressedInitial(eventInfo))
 		{
 			delete m_canvasManipulator;
-			m_canvasManipulator = 0l;
+			m_canvasManipulator = nullptr;
 		}
 	}
 }
@@ -212,7 +212,7 @@ void CMManager::mouseMoveEvent( const EventInfo &eventInfo )
 			kdDebug() << k_funcinfo << "About to delete" << endl;
 			delete m_canvasManipulator;
 			kdDebug() << k_funcinfo << "Deleted" << endl;
-			m_canvasManipulator = 0l;
+			m_canvasManipulator = nullptr;
 			kdDebug() << k_funcinfo << "Nullified" << endl;
 		}
 		ItemView *itemView = dynamic_cast<ItemView*>(p_itemDocument->activeView());
@@ -277,13 +277,13 @@ void CMManager::mouseReleaseEvent( const EventInfo &eventInfo )
 	if ( m_canvasManipulator && m_canvasManipulator->mouseReleased(eventInfo) )
 	{
 		delete m_canvasManipulator;
-		m_canvasManipulator = 0l;
+		m_canvasManipulator = nullptr;
 	}
 	
 	if (p_lastItemClicked)
 	{
 		p_lastItemClicked->mouseReleaseEvent(eventInfo);
-		p_lastItemClicked=0l;
+		p_lastItemClicked=nullptr;
 	}
 	
 	updateCurrentResizeHandle( dynamic_cast<ResizeHandle*>( p_itemDocument->itemAtTop(eventInfo.pos) ) );
@@ -371,7 +371,7 @@ CanvasManipulator::CanvasManipulator( ItemDocument *itemDocument, CMManager *cmM
 	p_selectList = p_itemDocument->selectList();
 	p_cnItemSelectList = dynamic_cast<CNItemGroup*>(p_selectList);
 	p_mechItemSelectList = dynamic_cast<MechanicsGroup*>(p_selectList);
-	p_cnItemClickedOn = 0l;
+	p_cnItemClickedOn = nullptr;
 	p_cmManager = cmManager;
 }
 
@@ -489,10 +489,10 @@ bool CMRightClick::mouseReleased( const EventInfo &/*eventInfo*/ )
 ConnectorDraw::ConnectorDraw( ItemDocument *itemDocument, CMManager *cmManager )
 	: CanvasManipulator( itemDocument, cmManager )
 {
-	p_startNode = 0l;
-	p_startConnector = 0l;
-	p_endNode = 0l;
-	p_endConnector = 0l;
+	p_startNode = nullptr;
+	p_startConnector = nullptr;
+	p_endNode = nullptr;
+	p_endConnector = nullptr;
 }
 
 
@@ -542,7 +542,7 @@ TQPoint ConnectorDraw::toValidPos( const TQPoint & clickPos, Connector * clicked
 Connector * ConnectorDraw::toConnector( Node * node )
 {
 	if ( !node || node->numCon( true, false ) < 3 )
-		return 0l;
+		return nullptr;
 	
 	const ConnectorList inList = node->inputConnectorList();
 	if ( !inList.isEmpty() )
@@ -552,7 +552,7 @@ Connector * ConnectorDraw::toConnector( Node * node )
 	if ( !outList.isEmpty() )
 		return *outList.begin();
 	
-	return 0l;
+	return nullptr;
 }
 
 
@@ -570,12 +570,12 @@ void ConnectorDraw::grabEndStuff( TQCanvasItem * endItem, const TQPoint & pos, b
 	if ( p_endNode && p_endNode->numCon( true, false ) > 2 )
 	{
 		p_endConnector = toConnector(p_endNode);
-		p_endNode = 0l;
+		p_endNode = nullptr;
 	}
 	
 	// If the endItem is a node, we have to finish exactly on the end when posIsExact is true
 	if ( posIsExact && p_endNode && (p_endNode->x() != pos.x() || p_endNode->y() != pos.y()) )
-		p_endNode = 0l;
+		p_endNode = nullptr;
 	
 	if (!p_endConnector)
 		p_endConnector = dynamic_cast<Connector*>(endItem);
@@ -588,14 +588,14 @@ void ConnectorDraw::grabEndStuff( TQCanvasItem * endItem, const TQPoint & pos, b
 CMAutoConnector::CMAutoConnector( ItemDocument *itemDocument, CMManager *cmManager )
 	: ConnectorDraw( itemDocument, cmManager )
 {
-	m_connectorLine = 0l;
-	p_startNode = 0l;
-	p_startConnector = 0l;
+	m_connectorLine = nullptr;
+	p_startNode = nullptr;
+	p_startConnector = nullptr;
 }
 CMAutoConnector::~CMAutoConnector()
 {
 	delete m_connectorLine;
-	m_connectorLine = 0l;
+	m_connectorLine = nullptr;
 }
 CanvasManipulator* CMAutoConnector::construct( ItemDocument *itemDocument, CMManager *cmManager )
 {
@@ -625,7 +625,7 @@ bool CMAutoConnector::mousePressedInitial( const EventInfo &eventInfo )
 		if (p_startNode->numCon( true, false ) > 2)
 		{
 			p_startConnector = toConnector(p_startNode);
-			p_startNode = 0l;
+			p_startNode = nullptr;
 		}
 	}
 	else if (p_startConnector = dynamic_cast<Connector*>(eventInfo.qcanvasItemClickedOn) )
@@ -673,7 +673,7 @@ bool CMAutoConnector::mouseMoved( const EventInfo &eventInfo )
 		
 	if (movedFlag)
 	{
-		TQCanvasItem *startItem = 0l;
+		TQCanvasItem *startItem = nullptr;
 		if (p_startNode)
 			startItem = p_startNode;
 		else if (p_startConnector)
@@ -696,7 +696,7 @@ bool CMAutoConnector::mouseReleased( const EventInfo &eventInfo )
 	
 	TQPoint end = m_connectorLine->endPoint();
 	delete m_connectorLine;
-	m_connectorLine = 0l;
+	m_connectorLine = nullptr;
 	
 	TQCanvasItem *qcanvasItem = p_icnDocument->itemAtTop(end);
 	if ( !qcanvasItem )
@@ -748,12 +748,12 @@ bool CMAutoConnector::mouseReleased( const EventInfo &eventInfo )
 CMManualConnector::CMManualConnector( ItemDocument *itemDocument, CMManager *cmManager )
 	: ConnectorDraw( itemDocument, cmManager )
 {
-	m_manualConnectorDraw = 0l;
+	m_manualConnectorDraw = nullptr;
 }
 CMManualConnector::~CMManualConnector()
 {
 	delete m_manualConnectorDraw;
-	m_manualConnectorDraw = 0l;
+	m_manualConnectorDraw = nullptr;
 }
 CanvasManipulator* CMManualConnector::construct( ItemDocument *itemDocument, CMManager *cmManager )
 {
@@ -792,7 +792,7 @@ bool CMManualConnector::mousePressedInitial( const EventInfo &eventInfo )
 		if ( p_startNode->numCon( true, false ) > 2 )
 		{
 			p_startConnector = toConnector(p_startNode);
-			p_startNode = 0l;
+			p_startNode = nullptr;
 		}
 	}
 	else
@@ -846,7 +846,7 @@ bool CMManualConnector::mouseMoved( const EventInfo &eventInfo )
 	
 	if ( movedFlag )
 	{
-		TQCanvasItem *startItem = 0l;
+		TQCanvasItem *startItem = nullptr;
 		if (p_startNode)
 			startItem = p_startNode;
 		else if (p_startConnector)
@@ -858,7 +858,7 @@ bool CMManualConnector::mouseMoved( const EventInfo &eventInfo )
 		if ( Node * node = dynamic_cast<Node*>(endItem) )
 		{
 			if ( node->x() != newX || node->y() != newY )
-				endItem = 0l;
+				endItem = nullptr;
 		}
 		
 		bool validLine = p_icnDocument->canConnect( startItem, endItem );
@@ -887,7 +887,7 @@ bool CMManualConnector::mouseReleased( const EventInfo &eventInfo )
 	// Create the points that define the manual route
 	TQPointList list = m_manualConnectorDraw->pointList();
 	delete m_manualConnectorDraw;
-	m_manualConnectorDraw = 0l;
+	m_manualConnectorDraw = nullptr;
 	
 	if (p_startConnector)
 	{
@@ -929,7 +929,7 @@ bool CMManualConnector::mouseReleased( const EventInfo &eventInfo )
 CMItemMove::CMItemMove( ItemDocument *itemDocument, CMManager *cmManager )
 	: CanvasManipulator( itemDocument, cmManager )
 {
-	p_flowContainerCandidate = 0l;
+	p_flowContainerCandidate = nullptr;
 }
 CMItemMove::~CMItemMove()
 {
@@ -975,7 +975,7 @@ bool CMItemMove::mousePressedInitial( const EventInfo &eventInfo )
 		return true;
 	
 	// We want to allow dragging into FlowContainers if this is a FlowView
-	p_flowContainerCandidate = 0l;
+	p_flowContainerCandidate = nullptr;
 	{
 		const ItemList &itemList = p_icnDocument->itemList();
 		const ItemList::const_iterator ciEnd = itemList.end();
@@ -1063,7 +1063,7 @@ bool CMItemMove::mouseMoved( const EventInfo &eventInfo )
 		if ( p_flowContainerCandidate )
 		{
 			p_flowContainerCandidate->setSelected(false);
-			p_flowContainerCandidate = 0l;
+			p_flowContainerCandidate = nullptr;
 		}
 	}
 	if (fc)
@@ -1107,12 +1107,12 @@ bool CMItemMove::mouseReleased( const EventInfo &eventInfo )
 			p_flowContainerCandidate->addChild(*it);
 		
 		p_flowContainerCandidate->setSelected(false);
-		p_flowContainerCandidate = 0l;
+		p_flowContainerCandidate = nullptr;
 	}
 	else
 	{
 		for ( ItemList::const_iterator it = itemList.begin(); it != ilEnd; ++it )
-			(*it)->setParentItem(0l);
+			(*it)->setParentItem(nullptr);
 	}
 	
 	// And disable the FlowContainers again...
@@ -1252,7 +1252,7 @@ bool CMMechItemMove::mousePressedInitial( const EventInfo &eventInfo )
 		if (mechItem)
 		{
 			mechItem->setSelectionMode(MechanicsItem::sm_move);
-			mechItem->setParentItem(0l);
+			mechItem->setParentItem(nullptr);
 		}
 	}
 	else if ( !p_selectList->contains(mechItem) )
@@ -1409,12 +1409,12 @@ TQCanvasItemList SelectRectangle::collisions()
 CMSelect::CMSelect( ItemDocument *itemDocument, CMManager *cmManager )
 	: CanvasManipulator( itemDocument, cmManager )
 {
-	m_selectRectangle = 0l;
+	m_selectRectangle = nullptr;
 }
 CMSelect::~CMSelect()
 {
 	delete m_selectRectangle;
-	m_selectRectangle = 0l;
+	m_selectRectangle = nullptr;
 }
 CanvasManipulator* CMSelect::construct( ItemDocument *itemDocument, CMManager *cmManager )
 {
@@ -1469,7 +1469,7 @@ bool CMSelect::mouseMoved( const EventInfo &eventInfo )
 bool CMSelect::mouseReleased( const EventInfo &/*eventInfo*/ )
 {
 	delete m_selectRectangle;
-	m_selectRectangle = 0l;
+	m_selectRectangle = nullptr;
 	
 	return true;
 }
@@ -1562,9 +1562,9 @@ void CanvasEllipseDraw::drawShape( TQPainter & p )
 CMDraw::CMDraw( ItemDocument *itemDocument, CMManager *cmManager )
 	: CanvasManipulator( itemDocument, cmManager )
 {
-	m_pDrawLine = 0l;
-	m_pDrawRectangle = 0l;
-	m_pDrawEllipse = 0l;
+	m_pDrawLine = nullptr;
+	m_pDrawRectangle = nullptr;
+	m_pDrawEllipse = nullptr;
 }
 CMDraw::~CMDraw()
 {
@@ -1692,8 +1692,8 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo )
 	
 		delete m_pDrawRectangle;
 		delete m_pDrawEllipse;
-		m_pDrawRectangle = 0l;
-		m_pDrawEllipse = 0l;
+		m_pDrawRectangle = nullptr;
+		m_pDrawEllipse = nullptr;
 	}
 	else if (m_pDrawLine)
 	{
@@ -1705,7 +1705,7 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo )
 		sizeRect = TQRect( ex, ey, sx-ex, sy-ey );
 		
 		delete m_pDrawLine;
-		m_pDrawLine = 0l;
+		m_pDrawLine = nullptr;
 	}
 	else
 		return true;
@@ -1854,7 +1854,7 @@ TQCanvasItem* ManualConnectorDraw::mouseClicked( const TQPoint &pos )
 	updateConnectorEnds();
 	m_currentCon->show();
 	
-	return 0L;
+	return nullptr;
 }
 
 
diff --git a/src/cells.h b/src/cells.h
index c8c739c..42a77cd 100644
--- a/src/cells.h
+++ b/src/cells.h
@@ -68,7 +68,7 @@ public:
 	inline Cell* operator[] ( const uint x ) const
 	{
 		if ( x<m_w ) return m_cells[x];
-		return 0l;
+		return nullptr;
 	}
 	
 	const uint width() const { return m_w; }
diff --git a/src/circuitdocument.cpp b/src/circuitdocument.cpp
index 6f51d2a..66b5c11 100644
--- a/src/circuitdocument.cpp
+++ b/src/circuitdocument.cpp
@@ -64,10 +64,10 @@ CircuitDocument::~CircuitDocument()
 	deleteCircuits();
 	
 	delete m_updateCircuitsTmr;
-	m_updateCircuitsTmr = 0l;
+	m_updateCircuitsTmr = nullptr;
 	
 	delete m_pDocumentIface;
-	m_pDocumentIface = 0l;
+	m_pDocumentIface = nullptr;
 }
 
 
@@ -466,7 +466,7 @@ void CircuitDocument::assignCircuits()
 		splitIntoCircuits(&*it);
 	
 	// Stage 3: Initialize the circuits
-	m_circuitList.remove(0l);
+	m_circuitList.remove(nullptr);
 	CircuitList::iterator circuitListEnd = m_circuitList.end();
 	for ( CircuitList::iterator it = m_circuitList.begin(); it != circuitListEnd; ++it )
 		(*it)->init();
@@ -666,7 +666,7 @@ bool CircuitDocument::tryAsLogicCircuit( Circuitoid *circuitoid )
 	}
 	
 	LogicInList logicInList;
-	LogicOut *out = 0l;
+	LogicOut *out = nullptr;
 	
 	uint logicInCount = 0;
 	uint logicOutCount = 0;
@@ -703,8 +703,8 @@ bool CircuitDocument::tryAsLogicCircuit( Circuitoid *circuitoid )
 		for ( ElementList::const_iterator it = circuitoid->elementList.begin(); it != end; ++it )
 		{
 			LogicIn * logicIn = static_cast<LogicIn*>(*it);
-			logicIn->setNextLogic(0l);
-			logicIn->setElementSet(0l);
+			logicIn->setNextLogic(nullptr);
+			logicIn->setElementSet(nullptr);
 			if ( logicIn->isHigh() )
 			{
 				logicIn->setLastState(false);
@@ -720,7 +720,7 @@ bool CircuitDocument::tryAsLogicCircuit( Circuitoid *circuitoid )
 Circuit *CircuitDocument::createCircuit( Circuitoid *circuitoid )
 {
 	if (!circuitoid) {
-		return 0l;
+		return nullptr;
 	}
 	
 	Circuit *circuit = new Circuit();
@@ -745,7 +745,7 @@ void CircuitDocument::createSubcircuit()
 	for ( ItemList::iterator it = itemList.begin(); it != itemListEnd; ++it )
 	{
 		if ( !dynamic_cast<Component*>((Item*)*it) )
-			*it = 0l;
+			*it = nullptr;
 	}
 	itemList.remove((Item*)0l);
 	
diff --git a/src/circuitdocument.h b/src/circuitdocument.h
index dceb1d7..7bcded1 100644
--- a/src/circuitdocument.h
+++ b/src/circuitdocument.h
@@ -64,10 +64,10 @@ class CircuitDocument : public ICNDocument
 	TQ_OBJECT
   
 	public:
-		CircuitDocument( const TQString &caption, KTechlab *ktechlab, const char *name = 0L );
+		CircuitDocument( const TQString &caption, KTechlab *ktechlab, const char *name = nullptr );
 		~CircuitDocument();
 	
-		virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+		virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 	
 		void calculateConnectorCurrents();
 		/**
@@ -95,7 +95,7 @@ class CircuitDocument : public ICNDocument
 		 * selected or not.
 		 * @param plugContextMenu If true, then will insert actions into contextmenu
 		 */
-		virtual void slotInitItemActions( Item *item = 0L );
+		virtual void slotInitItemActions( Item *item = nullptr );
 		void requestAssignCircuits();
 		void componentAdded( Item * item );
 		void componentRemoved( Item * item );
diff --git a/src/circuitview.cpp b/src/circuitview.cpp
index f87e8d1..ca078b5 100644
--- a/src/circuitview.cpp
+++ b/src/circuitview.cpp
@@ -73,7 +73,7 @@ CircuitView::CircuitView( CircuitDocument * circuitDocument, ViewContainer *view
 CircuitView::~CircuitView()
 {
 	delete m_pViewIface;
-	m_pViewIface = 0l;
+	m_pViewIface = nullptr;
 }
 
 
diff --git a/src/circuitview.h b/src/circuitview.h
index 9d6b51e..55ec68d 100644
--- a/src/circuitview.h
+++ b/src/circuitview.h
@@ -23,7 +23,7 @@ class CircuitView : public ICNView
 TQ_OBJECT
   
 public:
-	CircuitView( CircuitDocument *circuitDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+	CircuitView( CircuitDocument *circuitDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 	~CircuitView();
 
 public slots:
diff --git a/src/ciwidgetmgr.cpp b/src/ciwidgetmgr.cpp
index 293c5d4..39e9abb 100644
--- a/src/ciwidgetmgr.cpp
+++ b/src/ciwidgetmgr.cpp
@@ -55,7 +55,7 @@ Widget *CIWidgetMgr::widgetWithID( const TQString &id ) const
 {
 	WidgetMap::const_iterator it = m_widgetMap.find(id);
 	if ( it == m_widgetMap.end() )
-		return 0l;
+		return nullptr;
 	else return it.data();
 }
 
@@ -176,7 +176,7 @@ Slider* CIWidgetMgr::addSlider( const TQString &id, int minValue, int maxValue,
 	{
 		kdWarning() << "CIWidgetMgr::addSlider: Attempting to re-add slider with same id as previous"<<endl;
 		delete slider;
-		return 0l;
+		return nullptr;
 	}
 	
 	p_cnItem->updateAttachedPositioning();
diff --git a/src/cnitem.cpp b/src/cnitem.cpp
index b6d75c9..a3a9256 100644
--- a/src/cnitem.cpp
+++ b/src/cnitem.cpp
@@ -48,7 +48,7 @@ CNItem::~CNItem()
 	for ( TextMap::iterator it = m_textMap.begin(); it != textMapEnd; ++it )
 	{
 		if (it.data())
-			it.data()->setCanvas(0l);
+			it.data()->setCanvas(nullptr);
 		delete (Text*)it.data();
 	}
 	m_textMap.clear();
@@ -184,7 +184,7 @@ void CNItem::removeItem()
 	
 	const TextMap::iterator textMapEnd = m_textMap.end();
 	for ( TextMap::iterator it = m_textMap.begin(); it != textMapEnd; ++it )
-		it.data()->setCanvas(0l);
+		it.data()->setCanvas(nullptr);
 	
 	Item::removeItem();
 	updateConnectorPoints(false);
@@ -252,7 +252,7 @@ Node* CNItem::createNode( double _x, double _y, int orientation, const TQString
 	else
 	{
 		kdError() << k_funcinfo << "Unknown orientation: " << orientation << endl;
-		return 0l;
+		return nullptr;
 	}
 	
 	Node *node;
@@ -300,7 +300,7 @@ bool CNItem::removeNode( const TQString &name )
 Node *CNItem::getClosestNode( const TQPoint &pos )
 {
 	// Work through the nodes, finding the one closest to the (x, y) position
-	Node *shortestNode = 0L;
+	Node *shortestNode = nullptr;
 	double shortestDistance = 1e10; // Nice large distance :-)
 	
 	const NodeMap::iterator end = m_nodeMap.end();
@@ -573,7 +573,7 @@ void CNItem::updateConnectorPoints( bool add )
 
 Text* CNItem::addDisplayText( const TQString &id, const TQRect & pos, const TQString &display, bool internal, int flags )
 {
-	Text *text = 0l;
+	Text *text = nullptr;
 	TextMap::iterator it = m_textMap.find(id);
 	if ( it != m_textMap.end() )
 	{
@@ -637,7 +637,7 @@ Node *CNItem::childNode( const TQString &childId )
 
 NodeInfo::NodeInfo()
 {
-	node = 0l;
+	node = nullptr;
 	x = 0.;
 	y = 0.;
 	orientation = 0;
diff --git a/src/cnitemgroup.cpp b/src/cnitemgroup.cpp
index 7a8c746..0507776 100644
--- a/src/cnitemgroup.cpp
+++ b/src/cnitemgroup.cpp
@@ -248,7 +248,7 @@ NodeList CNItemGroup::nodes( bool excludeParented ) const
 		return nodeList;
 	
 	NodeGroupList translatableNodeGroups;
-	p_icnDocument->getTranslatable( items(false), 0l, 0l, &translatableNodeGroups );
+	p_icnDocument->getTranslatable( items(false), nullptr, nullptr, &translatableNodeGroups );
 	
 	NodeGroupList::iterator end = translatableNodeGroups.end();
 	for ( NodeGroupList::iterator it = translatableNodeGroups.begin(); it != end; ++it )
@@ -274,7 +274,7 @@ ConnectorList CNItemGroup::connectors( bool excludeParented ) const
 	
 	ConnectorList translatableConnectors;
 	NodeGroupList translatableNodeGroups;
-	p_icnDocument->getTranslatable( items(false), 0l, &translatableConnectors, &translatableNodeGroups );
+	p_icnDocument->getTranslatable( items(false), nullptr, &translatableConnectors, &translatableNodeGroups );
 	
 	ConnectorList::iterator tcEnd = translatableConnectors.end();
 	for ( ConnectorList::iterator it = translatableConnectors.begin(); it != tcEnd; ++it )
@@ -568,7 +568,7 @@ void CNItemGroup::updateInfo()
 void CNItemGroup::getActiveItem()
 {
 	if ( m_itemList.isEmpty() )
-		setActiveItem(0l);
+		setActiveItem(nullptr);
 	else
 		setActiveItem( *m_itemList.begin() );
 }
diff --git a/src/cnitemgroup.h b/src/cnitemgroup.h
index 7406a9a..6054c60 100644
--- a/src/cnitemgroup.h
+++ b/src/cnitemgroup.h
@@ -39,7 +39,7 @@ class CNItemGroup : public ItemGroup
 TQ_OBJECT
   
 public:
-	CNItemGroup( ICNDocument *icnDocument, const char *name = 0 );
+	CNItemGroup( ICNDocument *icnDocument, const char *name = nullptr );
 	~CNItemGroup();
 	
 	/**
diff --git a/src/connector.cpp b/src/connector.cpp
index 4be6b95..cac63ce 100644
--- a/src/connector.cpp
+++ b/src/connector.cpp
@@ -57,10 +57,10 @@ Connector::Connector( Node * startNode, Node * endNode, ICNDocument *icnDocument
 {
 	p_icnDocument = icnDocument;
 	m_conRouter = new ConRouter(p_icnDocument);
-	p_parentContainer = 0l;
+	p_parentContainer = nullptr;
 	m_startNode = startNode;
 	m_endNode = endNode;
-	p_nodeGroup = 0l;
+	p_nodeGroup = nullptr;
 	b_semiHidden = false;
 	b_deleted = false;
 	b_pointsAdded = false;
@@ -99,7 +99,7 @@ Connector::~Connector()
 	p_icnDocument->unregisterUID( id() );
 	
 	delete m_conRouter;
-	m_conRouter = 0l;
+	m_conRouter = nullptr;
 	
 	for ( unsigned i = 0; i < m_wires.size(); i++ )
 		delete m_wires[i];
diff --git a/src/connector.h b/src/connector.h
index 92426b7..ddf3dba 100644
--- a/src/connector.h
+++ b/src/connector.h
@@ -39,7 +39,7 @@ class Connector : public TQObject, public TQCanvasPolygon
 TQ_OBJECT
   
 public:
-	Connector( Node * startNode, Node * endNode, ICNDocument *_ICNDocument, TQString *id = 0L );
+	Connector( Node * startNode, Node * endNode, ICNDocument *_ICNDocument, TQString *id = nullptr );
 	~Connector();
 	
 	virtual int rtti() const;
@@ -148,7 +148,7 @@ public:
 	virtual void setVisible( bool yes );
 	WireVector wires() const { return m_wires; }
 	unsigned numWires() const { return m_wires.size(); }
-	Wire * wire( unsigned num = 0 ) const { return (num < m_wires.size()) ? m_wires[num] : 0l; }
+	Wire * wire( unsigned num = 0 ) const { return (num < m_wires.size()) ? m_wires[num] : nullptr; }
 	
 signals:
 	void removed( Connector *connector );
@@ -156,7 +156,7 @@ signals:
 	void numWiresChanged( unsigned newNum );
 	
 public slots:
-	void removeConnector( Node* = 0L );
+	void removeConnector( Node* = nullptr );
 	/**
 	 * Takes the minimum pin count of the start and end nodes, and creates a
 	 * connector for each pin up to that minimum.
diff --git a/src/core/main.cpp b/src/core/main.cpp
index aa14b90..22a9255 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -28,7 +28,7 @@ static const char version[] = "0.3";
 
 static TDECmdLineOptions options[] =
 {
-    { "+[URL]", I18N_NOOP( "Document to open." ), 0 },
+    { "+[URL]", I18N_NOOP( "Document to open." ), nullptr },
     TDECmdLineLastOption
 };
 
@@ -37,8 +37,8 @@ int main(int argc, char **argv)
 {
     TDEAboutData about("ktechlab", I18N_NOOP("KTechlab"), version, description,
 					 TDEAboutData::License_GPL, "(C) 2003-2005, The KTechlab developers", "", "http://ktechlab.org", "ktechlab-devel@lists.sourceforge.net" );
-    about.addAuthor( "David Saxton", 0, "david@bluehaze.org" );
-	about.addAuthor( "Daniel Clarke", 0, "daniel.jc@gmail.com" );
+    about.addAuthor( "David Saxton", nullptr, "david@bluehaze.org" );
+	about.addAuthor( "Daniel Clarke", nullptr, "daniel.jc@gmail.com" );
 	about.addCredit( "Couriousous", "JK flip-flop, asyncronous preset/reset in the D flip-flop." );
 	about.addCredit( "John Myers", "Rotary Switch" );
 	about.addCredit( "Ali Akcaagac", "Glib friendliness." );
diff --git a/src/docmanager.cpp b/src/docmanager.cpp
index f6f101d..264ee50 100644
--- a/src/docmanager.cpp
+++ b/src/docmanager.cpp
@@ -28,7 +28,7 @@
 
 #include <assert.h>
 
-DocManager * DocManager::m_pSelf = 0l;
+DocManager * DocManager::m_pSelf = nullptr;
 
 DocManager * DocManager::self( KTechlab * ktechlab )
 {
@@ -45,12 +45,12 @@ DocManager::DocManager( KTechlab * ktechlab )
 	: TQObject( ktechlab ),
 	p_ktechlab(ktechlab)
 {
-	p_focusedView = 0l;
+	p_focusedView = nullptr;
 	m_countCircuit = 0;
 	m_countFlowCode = 0;
 	m_countMechanics = 0;
 	m_countOther = 0;
-	p_connectedDocument = 0l;
+	p_connectedDocument = nullptr;
 	m_nextDocumentID = 1;
 	m_pIface = new DocManagerIface(this);
 }
@@ -92,15 +92,15 @@ void DocManager::gotoTextLine( const KURL &url, int line )
 Document* DocManager::openURL( const KURL &url, ViewArea *viewArea )
 {
 	if ( url.isEmpty() )
-		return 0l;
+		return nullptr;
 	
 	if ( url.isLocalFile() )
 	{
 		TQFile file(url.path());
 		if ( file.open(IO_ReadOnly) == false )
 		{
-			KMessageBox::sorry( 0l, i18n("Could not open '%1'").arg( url.prettyURL() ) );
-			return 0l;
+			KMessageBox::sorry( nullptr, i18n("Could not open '%1'").arg( url.prettyURL() ) );
+			return nullptr;
 		}
 		file.close();
 	}
@@ -137,8 +137,8 @@ Document* DocManager::openURL( const KURL &url, ViewArea *viewArea )
 
 Document *DocManager::getFocusedDocument() const
 {
-	Document * doc = p_focusedView ? p_focusedView->document() : 0l;
-	return (doc && !doc->isDeleted()) ? doc : 0l;
+	Document * doc = p_focusedView ? p_focusedView->document() : nullptr;
+	return (doc && !doc->isDeleted()) ? doc : nullptr;
 }
 
 
@@ -218,7 +218,7 @@ Document *DocManager::findDocument( const KURL &url ) const
 			return *it;
 	}
 	
-	return 0l;
+	return nullptr;
 }
 
 
@@ -274,9 +274,9 @@ void DocManager::handleNewDocument( Document *document, ViewArea *viewArea )
 View *DocManager::createNewView( Document *document, ViewArea *viewArea )
 {
 	if (!document)
-		return 0l;
+		return nullptr;
 	
-	View *view = 0l;
+	View *view = nullptr;
 	
 	if (viewArea)
 		view = document->createView( viewArea->viewContainer(), viewArea->id() );
@@ -306,7 +306,7 @@ void DocManager::slotViewFocused( View *view )
 {
 	ViewContainer * vc = static_cast<ViewContainer*>(p_ktechlab->tabWidget()->currentPage());
 	if (!vc)
-		view = 0l;
+		view = nullptr;
 	
 	if (!view)
 		return;
@@ -360,11 +360,11 @@ void DocManager::slotViewUnfocused()
 	if (p_connectedDocument)
 	{
 		disconnect( p_connectedDocument, TQ_SIGNAL(undoRedoStateChanged()), p_ktechlab, TQ_SLOT(slotDocUndoRedoChanged()) );
-		p_connectedDocument = 0l;
+		p_connectedDocument = nullptr;
 	}
 	
-	ItemInterface::self()->slotItemDocumentChanged(0l);
-	p_focusedView = 0l;
+	ItemInterface::self()->slotItemDocumentChanged(nullptr);
+	p_focusedView = nullptr;
 	
 // 	p_ktechlab->setCaption( 0 );
 	p_ktechlab->requestUpdateCaptions();
@@ -431,9 +431,9 @@ CircuitDocument *DocManager::openCircuitFile( const KURL &url, ViewArea *viewAre
 	
 	if ( !document->openURL(url) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open Circuit file \"%1\"").arg(url.prettyURL()) );
+		KMessageBox::sorry( nullptr, i18n("Could not open Circuit file \"%1\"").arg(url.prettyURL()) );
 		document->deleteLater();
-		return 0l;
+		return nullptr;
 	}
 	
 	handleNewDocument( document, viewArea );
@@ -448,9 +448,9 @@ FlowCodeDocument *DocManager::openFlowCodeFile( const KURL &url, ViewArea *viewA
 	
 	if ( !document->openURL(url) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open FlowCode file \"%1\"").arg(url.prettyURL()) );
+		KMessageBox::sorry( nullptr, i18n("Could not open FlowCode file \"%1\"").arg(url.prettyURL()) );
 		document->deleteLater();
-		return 0l;
+		return nullptr;
 	}
 	
 	handleNewDocument( document, viewArea );
@@ -465,9 +465,9 @@ MechanicsDocument *DocManager::openMechanicsFile( const KURL &url, ViewArea *vie
 	
 	if ( !document->openURL(url) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open Mechanics file \"%1\"").arg(url.prettyURL()) );
+		KMessageBox::sorry( nullptr, i18n("Could not open Mechanics file \"%1\"").arg(url.prettyURL()) );
 		document->deleteLater();
-		return 0l;
+		return nullptr;
 	}
 	
 	handleNewDocument( document, viewArea );
@@ -482,13 +482,13 @@ TextDocument *DocManager::openTextFile( const KURL &url, ViewArea *viewArea )
 	TextDocument *document = TextDocument::constructTextDocument( url.fileName().remove(url.directory()), p_ktechlab );
 	
 	if (!document)
-		return 0l;
+		return nullptr;
 	
 	if ( !document->openURL(url) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open text file \"%1\"").arg(url.prettyURL()) );
+		KMessageBox::sorry( nullptr, i18n("Could not open text file \"%1\"").arg(url.prettyURL()) );
 		document->deleteLater();
-		return 0l;
+		return nullptr;
 	}
 	
 	handleNewDocument( document, viewArea );
diff --git a/src/docmanager.h b/src/docmanager.h
index 1df3678..2b78929 100644
--- a/src/docmanager.h
+++ b/src/docmanager.h
@@ -39,7 +39,7 @@ class DocManager : public TQObject
 TQ_OBJECT
   
 public:
-	static DocManager * self( KTechlab * ktechlab = 0l );
+	static DocManager * self( KTechlab * ktechlab = nullptr );
 	~DocManager();
 	
 	/**
@@ -54,7 +54,7 @@ public:
 	 * Attempts to open the document at the given url.
 	 * @param ViewArea if non-null, will open the new view into the ViewArea
 	 */
-	Document* openURL( const KURL &url, ViewArea *viewArea = 0l );
+	Document* openURL( const KURL &url, ViewArea *viewArea = nullptr );
 	/**
 	 * Returns the focused View
 	 */
@@ -86,7 +86,7 @@ public:
 	 * Gives the given document focus. If it has no open views, one will be
 	 * created for it if viewAreaForNew is non-null
 	 */
-	void giveDocumentFocus( Document * toFocus, ViewArea * viewAreaForNew = 0l );
+	void giveDocumentFocus( Document * toFocus, ViewArea * viewAreaForNew = nullptr );
 	void removeDocumentAssociations( Document *document );
 	void disableContextActions();
 	
@@ -133,16 +133,16 @@ protected:
 	 * This function should be called after creating a new document to add it
 	 * to the appropriate lists and connect it up as appropriate
 	 */
-	void handleNewDocument( Document *document, ViewArea *viewArea = 0l );
+	void handleNewDocument( Document *document, ViewArea *viewArea = nullptr );
 	/**
 	 * Takes the document, creates a new view and shoves it in a new
 	 * ViewContainer
 	 */
-	View *createNewView( Document *document, ViewArea *viewArea = 0l );
-	CircuitDocument *openCircuitFile( const KURL &url, ViewArea *viewArea = 0l );
-	FlowCodeDocument *openFlowCodeFile( const KURL &url, ViewArea *viewArea = 0l );
-	MechanicsDocument *openMechanicsFile( const KURL &url, ViewArea *viewArea = 0l );
-	TextDocument *openTextFile( const KURL &url, ViewArea *viewArea = 0l );
+	View *createNewView( Document *document, ViewArea *viewArea = nullptr );
+	CircuitDocument *openCircuitFile( const KURL &url, ViewArea *viewArea = nullptr );
+	FlowCodeDocument *openFlowCodeFile( const KURL &url, ViewArea *viewArea = nullptr );
+	MechanicsDocument *openMechanicsFile( const KURL &url, ViewArea *viewArea = nullptr );
+	TextDocument *openTextFile( const KURL &url, ViewArea *viewArea = nullptr );
 	
 	DocumentList m_documentList;
 	URLDocumentMap m_associatedDocuments;
diff --git a/src/document.cpp b/src/document.cpp
index cad15f5..cc67cbb 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -24,10 +24,10 @@ Document::Document( const TQString &caption, KTechlab *ktechlab, const char *nam
 	: TQObject( ktechlab, name ),
 	b_modified(false),
 	p_ktechlab(ktechlab),
-	p_activeView(0l),
+	p_activeView(nullptr),
 	m_caption(caption),
 	m_bAddToProjectOnSave(false),
-	m_pDocumentIface(0l),
+	m_pDocumentIface(nullptr),
 	m_dcopID(0),
 	m_nextViewID(0),
 	m_bDeleted(false)
@@ -72,7 +72,7 @@ void Document::slotViewDestroyed( TQObject *obj )
 	
 	if ( p_activeView == (TQGuardedPtr<View>)view )
 	{
-		p_activeView = 0l;
+		p_activeView = nullptr;
 		emit viewUnfocused();
 	}
 	
@@ -131,7 +131,7 @@ bool Document::fileClose()
 		// If the filename is empty then it must  be an untitled file.
 		TQString name = m_url.fileName().isEmpty() ? caption() : m_url.fileName();
 		
-		if ( ViewContainer * viewContainer = (activeView() ? activeView()->viewContainer() : 0l) )
+		if ( ViewContainer * viewContainer = (activeView() ? activeView()->viewContainer() : nullptr) )
 			p_ktechlab->tabWidget()->setCurrentPage( p_ktechlab->tabWidget()->indexOf(viewContainer) );
 		
 		int choice = KMessageBox::warningYesNoCancel( p_ktechlab,
diff --git a/src/document.h b/src/document.h
index 2e1219e..01b62ca 100644
--- a/src/document.h
+++ b/src/document.h
@@ -40,7 +40,7 @@ public:
 		dt_text,
 		dt_pinMapEditor
 	};
-	Document( const TQString &caption, KTechlab *ktechlab, const char *name = 0 );
+	Document( const TQString &caption, KTechlab *ktechlab, const char *name = nullptr );
 	virtual ~Document();
 	/**
 	 * If the user has created a new document from the new file dialog, and
@@ -91,7 +91,7 @@ public:
 	 * functions, you must call handleNewView after creating the view, so that
 	 * the appropriate slots, pointers, etc can all be initialised.
 	 */
-	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l ) = 0;
+	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr ) = 0;
 	/**
 	 * Returns the url of the file that the Document refers to
 	 */
diff --git a/src/drawparts/dpline.h b/src/drawparts/dpline.h
index 20e3f9e..a54f226 100644
--- a/src/drawparts/dpline.h
+++ b/src/drawparts/dpline.h
@@ -21,7 +21,7 @@ class LineOverlay;
 class DPLine : public DrawPart
 {
 	public:
-		DPLine( ItemDocument *itemDocument, bool newItem, const char *id = 0L );
+		DPLine( ItemDocument *itemDocument, bool newItem, const char *id = nullptr );
 		~DPLine();
 
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -43,7 +43,7 @@ class DPLine : public DrawPart
 class DPArrow : public DPLine
 {
 	public:
-		DPArrow( ItemDocument *itemDocument, bool newItem, const char *id = 0L );
+		DPArrow( ItemDocument *itemDocument, bool newItem, const char *id = nullptr );
 		~DPArrow();
 
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/drawparts/dptext.h b/src/drawparts/dptext.h
index dc712c0..f0cae26 100644
--- a/src/drawparts/dptext.h
+++ b/src/drawparts/dptext.h
@@ -20,7 +20,7 @@
 class DPText : public DrawPart
 {
 public:
-	DPText( ItemDocument *itemDocument, bool newItem, const char *id = 0L );
+	DPText( ItemDocument *itemDocument, bool newItem, const char *id = nullptr );
 	~DPText();
 
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/drawparts/solidshape.h b/src/drawparts/solidshape.h
index aa8a5fe..caa3687 100644
--- a/src/drawparts/solidshape.h
+++ b/src/drawparts/solidshape.h
@@ -22,7 +22,7 @@ class RectangularOverlay;
 class DPRectangle : public DrawPart
 {
 	public:
-		DPRectangle( ItemDocument *itemDocument, bool newItem, const char *id = 0L );
+		DPRectangle( ItemDocument *itemDocument, bool newItem, const char *id = nullptr );
 		~DPRectangle();
 
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -52,7 +52,7 @@ class DPRectangle : public DrawPart
 class DPEllipse : public DPRectangle
 {
 	public:
-		DPEllipse( ItemDocument *itemDocument, bool newItem, const char *id = 0L );
+		DPEllipse( ItemDocument *itemDocument, bool newItem, const char *id = nullptr );
 		~DPEllipse();
 
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/component.cpp b/src/electronics/component.cpp
index 4c8b797..6a3e89d 100644
--- a/src/electronics/component.cpp
+++ b/src/electronics/component.cpp
@@ -58,8 +58,8 @@ Component::Component( ICNDocument *icnDocument, bool newItem, const TQString &id
 	
 	for ( int i=0; i<4; ++i )
 	{
-		m_pPNode[i] = 0l;
-		m_pNNode[i] = 0l;
+		m_pPNode[i] = nullptr;
+		m_pNNode[i] = nullptr;
 	}
 	
 	// Get configuration options
@@ -1005,9 +1005,9 @@ ECNode * Component::createPin( double x, double y, int orientation, const TQStri
 //BEGIN class ElementMap
 ElementMap::ElementMap()
 {
-	e = 0;
+	e = nullptr;
 	for ( int i = 0; i < 4; ++i )
-		n[i] = 0;
+		n[i] = nullptr;
 }
 //END class ElementMap
 
diff --git a/src/electronics/components/addac.cpp b/src/electronics/components/addac.cpp
index afed135..a3259cd 100644
--- a/src/electronics/components/addac.cpp
+++ b/src/electronics/components/addac.cpp
@@ -103,9 +103,9 @@ ADC::ADC( ICNDocument *icnDocument, bool newItem, const char *id )
 	m_desc = i18n("Converts an analog signal into a digital output.");
 	
 	for ( int i=0; i<max_ADDAC_bits; ++i )
-		m_logic[i] = 0l;
+		m_logic[i] = nullptr;
 	
-	m_realNode = 0l;
+	m_realNode = nullptr;
 }
 
 ADC::~ADC()
@@ -180,7 +180,7 @@ void ADC::initPins()
 			removeDisplayText(id);
 			removeElement( m_logic[i], false );
 			removeNode(id);
-			m_logic[i] = 0l;
+			m_logic[i] = nullptr;
 		}
 	}
 	
@@ -199,9 +199,9 @@ DAC::DAC( ICNDocument *icnDocument, bool newItem, const char *id )
 	m_desc = i18n("Converts a digital input to an analog output signal.");
 	
 	for ( int i=0; i<max_ADDAC_bits; ++i )
-		m_logic[i] = 0l;
+		m_logic[i] = nullptr;
 	
-	m_voltagePoint = 0l;
+	m_voltagePoint = nullptr;
 }
 
 
@@ -271,7 +271,7 @@ void DAC::initPins()
 			removeDisplayText(id);
 			removeElement( m_logic[i], false );
 			removeNode(id);
-			m_logic[i] = 0l;
+			m_logic[i] = nullptr;
 		}
 	}
 	
diff --git a/src/electronics/components/addac.h b/src/electronics/components/addac.h
index 3d69e88..642cddd 100644
--- a/src/electronics/components/addac.h
+++ b/src/electronics/components/addac.h
@@ -22,7 +22,7 @@ class ADDAC : public Component
 {
 public:
 	public:
-		ADDAC( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ADDAC( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ADDAC();
 		virtual bool canFlip() const { return true; }
 		
@@ -44,7 +44,7 @@ public:
 class ADC : public ADDAC
 {
 	public:
-		ADC( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ADC( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ADC();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -70,7 +70,7 @@ class ADC : public ADDAC
 class DAC : public ADDAC
 {
 	public:
-		DAC( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		DAC( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~DAC();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/bidirled.h b/src/electronics/components/bidirled.h
index 9165063..d2f88f6 100644
--- a/src/electronics/components/bidirled.h
+++ b/src/electronics/components/bidirled.h
@@ -19,7 +19,7 @@
 class BiDirLED : public Component
 {
 	public:
-		BiDirLED( ICNDocument * icnDocument, bool newItem, const char *id = 0L );
+		BiDirLED( ICNDocument * icnDocument, bool newItem, const char *id = nullptr );
 		~BiDirLED();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/binarycounter.cpp b/src/electronics/components/binarycounter.cpp
index 04088e6..631fb3e 100644
--- a/src/electronics/components/binarycounter.cpp
+++ b/src/electronics/components/binarycounter.cpp
@@ -42,7 +42,7 @@ BinaryCounter::BinaryCounter( ICNDocument *icnDocument, bool newItem, const char
 	m_desc = i18n("Holds an internal count, which changes when the clock input <i>&gt;</i> pin is pulsed.<br><br>"
 				  "Normal operation: <i>en</i> (Enable) and <i>u/d</i> (Up/Down) are held high, <i>r</i> (Reset) is low.");
 
-	enLogic = inLogic = rLogic = udLogic = 0L;
+	enLogic = inLogic = rLogic = udLogic = nullptr;
 	
 	b_reset = false;
 	b_triggerHigh = true;
diff --git a/src/electronics/components/binarycounter.h b/src/electronics/components/binarycounter.h
index b15762d..af1ea85 100644
--- a/src/electronics/components/binarycounter.h
+++ b/src/electronics/components/binarycounter.h
@@ -30,7 +30,7 @@ The inputs are:
 class BinaryCounter : public CallbackClass, public Component
 {
 public:
-	BinaryCounter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	BinaryCounter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~BinaryCounter();
 	
 	virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/bussplitter.h b/src/electronics/components/bussplitter.h
index 22b3054..134fd05 100644
--- a/src/electronics/components/bussplitter.h
+++ b/src/electronics/components/bussplitter.h
@@ -24,7 +24,7 @@ class Wire;
 class BusSplitter : public Component
 {
 	public:
-		BusSplitter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		BusSplitter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~BusSplitter();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/demultiplexer.cpp b/src/electronics/components/demultiplexer.cpp
index f757f3d..510455b 100644
--- a/src/electronics/components/demultiplexer.cpp
+++ b/src/electronics/components/demultiplexer.cpp
@@ -41,7 +41,7 @@ Demultiplexer::Demultiplexer( ICNDocument *icnDocument, bool newItem, const char
 	m_name = i18n("Demultiplexer");
 	m_desc = i18n("Seperates the input data stream into components. The value of the input is passed to the \"X\" output selected by the binary number given by the \"A\" inputs.");
 	
-	m_input = 0l;
+	m_input = nullptr;
 	
 	createProperty( "addressSize", Variant::Type::Int );
 	property("addressSize")->setCaption( i18n("Address Size") );
diff --git a/src/electronics/components/demultiplexer.h b/src/electronics/components/demultiplexer.h
index eabcc2c..cf53018 100644
--- a/src/electronics/components/demultiplexer.h
+++ b/src/electronics/components/demultiplexer.h
@@ -22,7 +22,7 @@
 class Demultiplexer : public CallbackClass,  public Component
 {
 public:
-	Demultiplexer( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Demultiplexer( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Demultiplexer();
 	
 	virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/dependentsource.h b/src/electronics/components/dependentsource.h
index 8b9e264..a6f5651 100644
--- a/src/electronics/components/dependentsource.h
+++ b/src/electronics/components/dependentsource.h
@@ -36,7 +36,7 @@ class DependentSource : public Component
 class ECCCCS : public DependentSource
 {
 	public:
-		ECCCCS( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECCCCS( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECCCCS();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -56,7 +56,7 @@ class ECCCCS : public DependentSource
 class ECCCVS : public DependentSource
 {
 	public:
-		ECCCVS( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECCCVS( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECCCVS();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -76,7 +76,7 @@ class ECCCVS : public DependentSource
 class ECVCCS : public DependentSource
 {
 	public:
-		ECVCCS( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECVCCS( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECVCCS();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -96,7 +96,7 @@ class ECVCCS : public DependentSource
 class ECVCVS : public DependentSource
 {
 	public:
-		ECVCVS( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECVCVS( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECVCVS();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/discretelogic.h b/src/electronics/components/discretelogic.h
index c8a5778..1dfea35 100644
--- a/src/electronics/components/discretelogic.h
+++ b/src/electronics/components/discretelogic.h
@@ -23,7 +23,7 @@ class Simulator;
 class Inverter : public CallbackClass, public Component
 {
 	public:
-		Inverter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		Inverter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~Inverter();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -44,7 +44,7 @@ class Inverter : public CallbackClass, public Component
 class Buffer : public CallbackClass, public Component
 {
 public:
-	Buffer( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Buffer( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Buffer();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -65,7 +65,7 @@ private:
 class ECLogicInput : public Component
 {
 public:
-	ECLogicInput( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECLogicInput( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECLogicInput();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -87,7 +87,7 @@ private:
 class ECLogicOutput : public CallbackClass, public Component
 {
 	public:
-		ECLogicOutput( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECLogicOutput( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECLogicOutput();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ec555.h b/src/electronics/components/ec555.h
index 79b121f..e757ae9 100644
--- a/src/electronics/components/ec555.h
+++ b/src/electronics/components/ec555.h
@@ -22,7 +22,7 @@
 class EC555 : public Component
 {
 public:
-	EC555( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	EC555( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~EC555();
 	
 	virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/ecbcdto7segment.cpp b/src/electronics/components/ecbcdto7segment.cpp
index f68d1f7..3b59b90 100644
--- a/src/electronics/components/ecbcdto7segment.cpp
+++ b/src/electronics/components/ecbcdto7segment.cpp
@@ -59,12 +59,12 @@ ECBCDTo7Segment::ECBCDTo7Segment( ICNDocument *icnDocument, bool newItem, const
 	m_desc = i18n("Converts a binary-coded-input to a form displayable by a seven segment display.<br><br>"
 				"Normal operation: <i>lt</i> (Lamp Test) and the <i>rb</i> (Ripple Blanking) are held high, <i>en</i> (Enable) is held low.");
 				
-	ALogic = BLogic = CLogic = DLogic = 0L;
-	ltLogic = rbLogic = enLogic = 0L;
+	ALogic = BLogic = CLogic = DLogic = nullptr;
+	ltLogic = rbLogic = enLogic = nullptr;
 	
 	for ( int i=0; i<7; i++ )
 	{
-		outLogic[i] = 0L;
+		outLogic[i] = nullptr;
 		oldOut[i] = false;
 	}
 
diff --git a/src/electronics/components/ecbcdto7segment.h b/src/electronics/components/ecbcdto7segment.h
index 03d4c2b..1d1483d 100644
--- a/src/electronics/components/ecbcdto7segment.h
+++ b/src/electronics/components/ecbcdto7segment.h
@@ -21,7 +21,7 @@
 class ECBCDTo7Segment : public CallbackClass, public Component
 {
 public:
-	ECBCDTo7Segment( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECBCDTo7Segment( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECBCDTo7Segment();
 	
 	virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/ecbjt.h b/src/electronics/components/ecbjt.h
index 9a6d6dd..8f39a7b 100644
--- a/src/electronics/components/ecbjt.h
+++ b/src/electronics/components/ecbjt.h
@@ -22,7 +22,7 @@ class BJT;
 class ECBJT : public Component
 {
 	public:
-		ECBJT( bool isNPN, ICNDocument *icnDocument, bool newItem, const char * id = 0L );
+		ECBJT( bool isNPN, ICNDocument *icnDocument, bool newItem, const char * id = nullptr );
 		~ECBJT();
 		virtual bool canFlip() const { return true; }
 	
diff --git a/src/electronics/components/eccapacitor.h b/src/electronics/components/eccapacitor.h
index 891ec14..f3a30d6 100644
--- a/src/electronics/components/eccapacitor.h
+++ b/src/electronics/components/eccapacitor.h
@@ -24,7 +24,7 @@ Simple capacitor
 class ECCapacitor : public Component
 {
 public:
-	ECCapacitor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECCapacitor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECCapacitor();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecclockinput.h b/src/electronics/components/ecclockinput.h
index db5f7bc..e219f7d 100644
--- a/src/electronics/components/ecclockinput.h
+++ b/src/electronics/components/ecclockinput.h
@@ -26,7 +26,7 @@ class LinkedList;
 class ECClockInput : public Component
 {
 public:
-	ECClockInput( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECClockInput( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECClockInput();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/eccurrentsignal.h b/src/electronics/components/eccurrentsignal.h
index 802221d..a9850b2 100644
--- a/src/electronics/components/eccurrentsignal.h
+++ b/src/electronics/components/eccurrentsignal.h
@@ -20,7 +20,7 @@
 class ECCurrentSignal : public Component
 {
 public:
-	ECCurrentSignal( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECCurrentSignal( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECCurrentSignal();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/eccurrentsource.h b/src/electronics/components/eccurrentsource.h
index 36a98b5..ebd9034 100644
--- a/src/electronics/components/eccurrentsource.h
+++ b/src/electronics/components/eccurrentsource.h
@@ -20,7 +20,7 @@
 class ECCurrentSource : public Component
 {
 public:
-	ECCurrentSource( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECCurrentSource( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECCurrentSource();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecdiode.h b/src/electronics/components/ecdiode.h
index a44a950..47bdb78 100644
--- a/src/electronics/components/ecdiode.h
+++ b/src/electronics/components/ecdiode.h
@@ -20,7 +20,7 @@
 class ECDiode : public Component
 {
 public:
-	ECDiode( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECDiode( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECDiode();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecfixedvoltage.h b/src/electronics/components/ecfixedvoltage.h
index c2a632d..d5ef152 100644
--- a/src/electronics/components/ecfixedvoltage.h
+++ b/src/electronics/components/ecfixedvoltage.h
@@ -20,7 +20,7 @@
 class ECFixedVoltage : public Component
 {
 public:
-	ECFixedVoltage( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECFixedVoltage( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECFixedVoltage();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecground.h b/src/electronics/components/ecground.h
index 9740fd9..4212eff 100644
--- a/src/electronics/components/ecground.h
+++ b/src/electronics/components/ecground.h
@@ -20,7 +20,7 @@
 class ECGround : public Component
 {
 public:
-	ECGround( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECGround( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECGround();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/eckeypad.h b/src/electronics/components/eckeypad.h
index c2794e5..0616b6f 100644
--- a/src/electronics/components/eckeypad.h
+++ b/src/electronics/components/eckeypad.h
@@ -20,7 +20,7 @@
 class ECKeyPad : public Component
 {
 	public:
-		ECKeyPad( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECKeyPad( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECKeyPad();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecled.h b/src/electronics/components/ecled.h
index 0d0d3c5..0d602e7 100644
--- a/src/electronics/components/ecled.h
+++ b/src/electronics/components/ecled.h
@@ -21,7 +21,7 @@
 class ECLed : public ECDiode
 {
 public:
-	ECLed( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECLed( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECLed();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecopamp.h b/src/electronics/components/ecopamp.h
index ceb5010..956d4ad 100644
--- a/src/electronics/components/ecopamp.h
+++ b/src/electronics/components/ecopamp.h
@@ -20,7 +20,7 @@
 class ECOpAmp : public Component
 {
 	public:
-		ECOpAmp( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECOpAmp( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECOpAmp();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/ecpotentiometer.h b/src/electronics/components/ecpotentiometer.h
index 0ecf362..0d3a3c3 100644
--- a/src/electronics/components/ecpotentiometer.h
+++ b/src/electronics/components/ecpotentiometer.h
@@ -22,7 +22,7 @@ class TQSlider;
 class ECPotentiometer : public Component
 {
 public:
-	ECPotentiometer( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECPotentiometer( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECPotentiometer();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecresistor.h b/src/electronics/components/ecresistor.h
index d9e756d..87b2535 100644
--- a/src/electronics/components/ecresistor.h
+++ b/src/electronics/components/ecresistor.h
@@ -20,7 +20,7 @@
 class ECResistor : public Component
 {
 	public:
-		ECResistor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ECResistor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ECResistor();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecsevensegment.cpp b/src/electronics/components/ecsevensegment.cpp
index 8037517..dcc6efe 100644
--- a/src/electronics/components/ecsevensegment.cpp
+++ b/src/electronics/components/ecsevensegment.cpp
@@ -56,12 +56,12 @@ ECSevenSegment::ECSevenSegment( ICNDocument *icnDocument, bool newItem, const ch
 	
 	for ( int i=0; i<8; i++ )
 	{
-		m_diodes[i] = 0L;
-		m_nodes[i] = 0L;
+		m_diodes[i] = nullptr;
+		m_nodes[i] = nullptr;
 		avg_brightness[i] = 0.;
 		last_brightness[i] = 255;
 	}
-	m_nNode = 0L;
+	m_nNode = nullptr;
 	
 	lastUpdatePeriod = 0.;
 	
diff --git a/src/electronics/components/ecsevensegment.h b/src/electronics/components/ecsevensegment.h
index 0ec9923..57850d7 100644
--- a/src/electronics/components/ecsevensegment.h
+++ b/src/electronics/components/ecsevensegment.h
@@ -23,7 +23,7 @@ class ECNode;
 class ECSevenSegment : public Component
 {
 public:
-	ECSevenSegment( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSevenSegment( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSevenSegment();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecsignallamp.h b/src/electronics/components/ecsignallamp.h
index fdc67c1..b77011b 100644
--- a/src/electronics/components/ecsignallamp.h
+++ b/src/electronics/components/ecsignallamp.h
@@ -22,7 +22,7 @@ class Resistance;
 class ECSignalLamp : public Component
 {
 public:
-	ECSignalLamp( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSignalLamp( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSignalLamp();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecsubcircuit.h b/src/electronics/components/ecsubcircuit.h
index 4c19e63..204a22f 100644
--- a/src/electronics/components/ecsubcircuit.h
+++ b/src/electronics/components/ecsubcircuit.h
@@ -24,7 +24,7 @@ class ECSubcircuit : public Component
 TQ_OBJECT
   
 public:
-	ECSubcircuit( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSubcircuit( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSubcircuit();
 	virtual bool canFlip() const { return true; }
 	
diff --git a/src/electronics/components/ecvoltagesignal.h b/src/electronics/components/ecvoltagesignal.h
index de23be9..2d39b4c 100644
--- a/src/electronics/components/ecvoltagesignal.h
+++ b/src/electronics/components/ecvoltagesignal.h
@@ -20,7 +20,7 @@
 class ECVoltageSignal : public Component
 {
 public:
-	ECVoltageSignal( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECVoltageSignal( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECVoltageSignal();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ecvoltagesource.h b/src/electronics/components/ecvoltagesource.h
index 9b252e1..ef2f338 100644
--- a/src/electronics/components/ecvoltagesource.h
+++ b/src/electronics/components/ecvoltagesource.h
@@ -21,7 +21,7 @@ Simple electrical cell that simulates a PD and internal resistance
 class ECCell : public Component
 {
 public:
-	ECCell( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECCell( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECCell();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/externalconnection.h b/src/electronics/components/externalconnection.h
index 914c774..b835aea 100644
--- a/src/electronics/components/externalconnection.h
+++ b/src/electronics/components/externalconnection.h
@@ -21,7 +21,7 @@ of a circuit part
 class ExternalConnection : public Component
 {
 public:
-	ExternalConnection( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ExternalConnection( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ExternalConnection();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/flipflop.h b/src/electronics/components/flipflop.h
index 744be38..ae3d55e 100644
--- a/src/electronics/components/flipflop.h
+++ b/src/electronics/components/flipflop.h
@@ -23,7 +23,7 @@ class Simulator;
 class ECDFlipFlop : public CallbackClass, public Component
 {
 public:
-	ECDFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECDFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECDFlipFlop();
 	virtual bool canFlip() const { return true; }
 	
@@ -58,7 +58,7 @@ private:
 class ECJKFlipFlop : public CallbackClass, public Component
 {
 public:
-	ECJKFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECJKFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECJKFlipFlop();
 	virtual bool canFlip() const { return true; }
 	
@@ -87,7 +87,7 @@ private:
 class ECSRFlipFlop : public CallbackClass, public Component
 {
 public:
-	ECSRFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSRFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSRFlipFlop();
 	virtual bool canFlip() const { return true; }
 	
diff --git a/src/electronics/components/fulladder.cpp b/src/electronics/components/fulladder.cpp
index 0cf55d6..842e357 100644
--- a/src/electronics/components/fulladder.cpp
+++ b/src/electronics/components/fulladder.cpp
@@ -40,8 +40,8 @@ FullAdder::FullAdder( ICNDocument *icnDocument, bool newItem, const char *id )
 	m_name = i18n("Adder");
 // 	m_desc = i18n("Insert missing adder help here.");
 
-	ALogic = BLogic = inLogic = 0l;
-	outLogic = SLogic = 0l;
+	ALogic = BLogic = inLogic = nullptr;
+	outLogic = SLogic = nullptr;
 
 	TQStringList pins = TQStringList::split( ',', "A,B,>,,S,C", true );
 	initDIPSymbol( pins, 48 );
diff --git a/src/electronics/components/fulladder.h b/src/electronics/components/fulladder.h
index d4277e5..b311bbe 100644
--- a/src/electronics/components/fulladder.h
+++ b/src/electronics/components/fulladder.h
@@ -20,7 +20,7 @@
 class FullAdder : public CallbackClass, public Component
 {
 public:
-	FullAdder( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	FullAdder( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~FullAdder();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/inductor.h b/src/electronics/components/inductor.h
index 285c54c..ab08cd9 100644
--- a/src/electronics/components/inductor.h
+++ b/src/electronics/components/inductor.h
@@ -19,7 +19,7 @@
 class Inductor : public Component
 {
 	public:
-		Inductor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		Inductor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~Inductor();
 	
 		static Item * construct( ItemDocument * itemDocument, bool newItem, const char * id );
diff --git a/src/electronics/components/magnitudecomparator.h b/src/electronics/components/magnitudecomparator.h
index ef8cf12..e5a482a 100644
--- a/src/electronics/components/magnitudecomparator.h
+++ b/src/electronics/components/magnitudecomparator.h
@@ -22,7 +22,7 @@
 class MagnitudeComparator : public CallbackClass, public Component
 {
 	public:
-		MagnitudeComparator( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		MagnitudeComparator( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~MagnitudeComparator();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/matrixdisplay.cpp b/src/electronics/components/matrixdisplay.cpp
index 3eb9fdd..8872b50 100644
--- a/src/electronics/components/matrixdisplay.cpp
+++ b/src/electronics/components/matrixdisplay.cpp
@@ -48,9 +48,9 @@ MatrixDisplay::MatrixDisplay( ICNDocument *icnDocument, bool newItem, const char
 	
 	//BEGIN Reset members
 	for ( unsigned i = 0; i < max_md_height; i++ )
-		m_pRowNodes[i] = 0l;
+		m_pRowNodes[i] = nullptr;
 	for ( unsigned i = 0; i < max_md_width; i++ )
-		m_pColNodes[i] = 0l;
+		m_pColNodes[i] = nullptr;
 	
 	m_lastUpdatePeriod = 0.0;
 	m_r = m_g = m_b = 0.0;
@@ -161,7 +161,7 @@ void MatrixDisplay::initPins( unsigned numRows, unsigned numCols )
 		{
 			m_avgBrightness[i][j] = 0.0;
 			m_lastBrightness[i][j] = 255;
-			m_pDiodes[i][j] = 0l;
+			m_pDiodes[i][j] = nullptr;
 		}
 			
 	}
@@ -179,7 +179,7 @@ void MatrixDisplay::initPins( unsigned numRows, unsigned numCols )
 		for ( unsigned i = numCols; i < m_numCols; i++ )
 		{
 			removeNode( colPinID(i) );
-			m_pColNodes[i] = 0l;
+			m_pColNodes[i] = nullptr;
 		}
 	}
 	m_numCols = numCols;
@@ -194,7 +194,7 @@ void MatrixDisplay::initPins( unsigned numRows, unsigned numCols )
 		for ( unsigned i = numRows; i < m_numRows; i++ )
 		{
 			removeNode( rowPinID(i) );
-			m_pRowNodes[i] = 0l;
+			m_pRowNodes[i] = nullptr;
 		}
 	}
 	m_numRows = numRows;
diff --git a/src/electronics/components/matrixdisplay.h b/src/electronics/components/matrixdisplay.h
index e36564a..54e25d2 100644
--- a/src/electronics/components/matrixdisplay.h
+++ b/src/electronics/components/matrixdisplay.h
@@ -23,7 +23,7 @@ const unsigned max_md_height = 20;
 class MatrixDisplay : public Component
 {
 	public:
-		MatrixDisplay( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		MatrixDisplay( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~MatrixDisplay();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/matrixdisplaydriver.cpp b/src/electronics/components/matrixdisplaydriver.cpp
index 578445f..72fe25d 100644
--- a/src/electronics/components/matrixdisplaydriver.cpp
+++ b/src/electronics/components/matrixdisplaydriver.cpp
@@ -327,11 +327,11 @@ MatrixDisplayDriver::MatrixDisplayDriver( ICNDocument *icnDocument, bool newItem
 	initDIPSymbol( pins, 64 );
 	initDIP(pins);
 	
-	m_pValueLogic.resize( 8, 0l );
+	m_pValueLogic.resize( 8, nullptr );
 	for ( unsigned i = 0; i < 8; ++i )
 		m_pValueLogic[i] = createLogicIn( ecNodeWithID("D"+TQString::number(i)) );
 	
-	m_pRowLogic.resize( 7, 0l );
+	m_pRowLogic.resize( 7, nullptr );
 	for ( unsigned i = 0; i < 7; ++i )
 	{
 		m_pRowLogic[i] = createLogicOut( ecNodeWithID("R"+TQString::number(i)), false );
@@ -339,7 +339,7 @@ MatrixDisplayDriver::MatrixDisplayDriver( ICNDocument *icnDocument, bool newItem
 		m_pRowLogic[i]->setOutputHighVoltage(5.0);
 	}
 	
-	m_pColLogic.resize( 5, 0l );
+	m_pColLogic.resize( 5, nullptr );
 	for ( unsigned i = 0; i < 5; ++i )
 	{
 		m_pColLogic[i] = createLogicOut( ecNodeWithID("C"+TQString::number(i)), false );
diff --git a/src/electronics/components/matrixdisplaydriver.h b/src/electronics/components/matrixdisplaydriver.h
index f6b3f91..27597b9 100644
--- a/src/electronics/components/matrixdisplaydriver.h
+++ b/src/electronics/components/matrixdisplaydriver.h
@@ -19,7 +19,7 @@
 class MatrixDisplayDriver : public Component
 {
 	public:
-		MatrixDisplayDriver( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		MatrixDisplayDriver( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~MatrixDisplayDriver();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/meter.h b/src/electronics/components/meter.h
index 8a70cdc..ece4d4d 100644
--- a/src/electronics/components/meter.h
+++ b/src/electronics/components/meter.h
@@ -52,7 +52,7 @@ protected:
 class FrequencyMeter : public Meter
 {
 public:
-	FrequencyMeter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	FrequencyMeter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~FrequencyMeter();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -70,7 +70,7 @@ protected:
 class ECAmmeter : public Meter
 {
 public:
-	ECAmmeter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECAmmeter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECAmmeter();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -90,7 +90,7 @@ private:
 class ECVoltMeter : public Meter
 {
 public:
-	ECVoltMeter( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECVoltMeter( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECVoltMeter();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/multiinputgate.cpp b/src/electronics/components/multiinputgate.cpp
index 5359292..32d71b5 100644
--- a/src/electronics/components/multiinputgate.cpp
+++ b/src/electronics/components/multiinputgate.cpp
@@ -31,8 +31,8 @@ MultiInputGate::MultiInputGate( ICNDocument *icnDocument, bool newItem, const ch
 	
 	for ( int i=0; i<maxGateInput; ++i )
 	{
-		inLogic[i] = 0l;
-		inNode[i] = 0l;
+		inLogic[i] = nullptr;
+		inNode[i] = nullptr;
 	}
 	
 	updateInputs(2);
@@ -96,8 +96,8 @@ void MultiInputGate::updateInputs( int newNum )
 		{
 			removeNode("in"+TQString::number(i));
 			removeElement( inLogic[i], false );
-			inNode[i] = 0l;
-			inLogic[i] = 0l;
+			inNode[i] = nullptr;
+			inLogic[i] = nullptr;
 		}
 	}
 	
diff --git a/src/electronics/components/multiinputgate.h b/src/electronics/components/multiinputgate.h
index 4ebc9cc..7bb542e 100644
--- a/src/electronics/components/multiinputgate.h
+++ b/src/electronics/components/multiinputgate.h
@@ -52,7 +52,7 @@ private:
 class ECXnor : public MultiInputGate
 {
 public:
-	ECXnor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECXnor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECXnor();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -71,7 +71,7 @@ private:
 class ECXor : public MultiInputGate
 {
 public:
-	ECXor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECXor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECXor();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -90,7 +90,7 @@ protected:
 class ECOr : public MultiInputGate
 {
 public:
-	ECOr( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECOr( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECOr();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -108,7 +108,7 @@ protected:
 class ECNor : public MultiInputGate
 {
 public:
-	ECNor( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECNor( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECNor();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -126,7 +126,7 @@ private:
 class ECNand : public MultiInputGate
 {
 public:
-	ECNand( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECNand( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECNand();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -144,7 +144,7 @@ private:
 class ECAnd : public MultiInputGate
 {
 public:
-	ECAnd( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECAnd( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECAnd();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/multiplexer.cpp b/src/electronics/components/multiplexer.cpp
index e48d33d..149c047 100644
--- a/src/electronics/components/multiplexer.cpp
+++ b/src/electronics/components/multiplexer.cpp
@@ -41,7 +41,7 @@ Multiplexer::Multiplexer( ICNDocument *icnDocument, bool newItem, const char *id
 	m_name = i18n("Multiplexer");
 	m_desc = i18n("Combines the input data stream into one single stream. The value of the input selected by the \"A\" inputs is passed to the output.");
 	
-	m_output = 0l;
+	m_output = nullptr;
 	
 	createProperty( "addressSize", Variant::Type::Int );
 	property("addressSize")->setCaption( i18n("Address Size") );
diff --git a/src/electronics/components/multiplexer.h b/src/electronics/components/multiplexer.h
index 8e86bab..90258d7 100644
--- a/src/electronics/components/multiplexer.h
+++ b/src/electronics/components/multiplexer.h
@@ -22,7 +22,7 @@
 class Multiplexer : public CallbackClass, public Component
 {
 public:
-	Multiplexer( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Multiplexer( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Multiplexer();
 	
 	virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/parallelportcomponent.cpp b/src/electronics/components/parallelportcomponent.cpp
index 74c7c95..3618344 100644
--- a/src/electronics/components/parallelportcomponent.cpp
+++ b/src/electronics/components/parallelportcomponent.cpp
@@ -80,9 +80,9 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
 	m_pParallelPort = new ParallelPort();
 	
 	for ( unsigned i = 0; i < 24; ++i )
-		m_pLogic[i] = 0;
+		m_pLogic[i] = nullptr;
 	
-	ECNode * pin = 0;
+	ECNode * pin = nullptr;
 	
 	//BEGIN Data register
 	for ( int i = 0; i < 8; ++i )
diff --git a/src/electronics/components/parallelportcomponent.h b/src/electronics/components/parallelportcomponent.h
index bffd85d..a3d4878 100644
--- a/src/electronics/components/parallelportcomponent.h
+++ b/src/electronics/components/parallelportcomponent.h
@@ -22,7 +22,7 @@ class ParallelPort;
 class ParallelPortComponent : public CallbackClass, public Component
 {
 	public:
-		ParallelPortComponent( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		ParallelPortComponent( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~ParallelPortComponent();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/probe.cpp b/src/electronics/components/probe.cpp
index dfe29fd..1dbebb2 100644
--- a/src/electronics/components/probe.cpp
+++ b/src/electronics/components/probe.cpp
@@ -25,7 +25,7 @@
 Probe::Probe( ICNDocument *icnDocument, bool newItem, const char *id )
 	: Component( icnDocument, newItem, id )
 {
-	p_probeData = 0l;
+	p_probeData = nullptr;
 	setSize( -16, -8, 32, 16 );
 	
 	createProperty( "color", Variant::Type::Color );
diff --git a/src/electronics/components/probe.h b/src/electronics/components/probe.h
index ab5040f..4af7650 100644
--- a/src/electronics/components/probe.h
+++ b/src/electronics/components/probe.h
@@ -23,7 +23,7 @@ class FloatingProbeData;
 class Probe : public Component
 {
 	public:
-		Probe( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		Probe( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~Probe();
 	
 	protected:
@@ -39,7 +39,7 @@ class Probe : public Component
 class FloatingProbe : public Probe
 {
 	public:
-		FloatingProbe( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		FloatingProbe( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~FloatingProbe();
 	
 		virtual bool doesStepNonLogic() const { return true; }
@@ -57,7 +57,7 @@ class FloatingProbe : public Probe
 class VoltageProbe : public FloatingProbe
 {
 	public:
-		VoltageProbe( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		VoltageProbe( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~VoltageProbe();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -76,7 +76,7 @@ class VoltageProbe : public FloatingProbe
 class CurrentProbe : public FloatingProbe
 {
 	public:
-		CurrentProbe( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		CurrentProbe( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~CurrentProbe();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -94,7 +94,7 @@ class CurrentProbe : public FloatingProbe
 class LogicProbe : public CallbackClass, public Probe
 {
 	public:
-		LogicProbe( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		LogicProbe( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~LogicProbe();
 	
 		static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/pushswitch.h b/src/electronics/components/pushswitch.h
index 1854eb2..207544a 100644
--- a/src/electronics/components/pushswitch.h
+++ b/src/electronics/components/pushswitch.h
@@ -20,7 +20,7 @@
 class ECPTBSwitch : public Component
 {
 public:
-	ECPTBSwitch( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECPTBSwitch( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECPTBSwitch();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -43,7 +43,7 @@ private:
 class ECPTMSwitch : public Component
 {
 public:
-	ECPTMSwitch( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECPTMSwitch( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECPTMSwitch();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/ram.cpp b/src/electronics/components/ram.cpp
index 375bf21..6a9c6a8 100644
--- a/src/electronics/components/ram.cpp
+++ b/src/electronics/components/ram.cpp
@@ -40,9 +40,9 @@ RAM::RAM( ICNDocument *icnDocument, bool newItem, const char *id )
 	m_desc = i18n("This RAM stores data as a collection of words; each of which contains <i>word size</i> bits of data.<br><br>To read data, set the CS (<i>chip select</i>) and the OE (<i>output enable</i>) pins high, and select the word using the address pins <i>A*</i>. The word is outputted on the data-out pins: <i>DO*</i>.<br><br>To write data, set the CS (<i>chip select</i>) and the WE (<i>write enable</i>) pins high, and select the address to write to with the <i>A*</i> pins. Write to the selected word using the data-in pins: <i>DI*</i>.<br><br>The <i>Address Size</i> is the number of bits that determine an address; so the total number of words stored will be 2^<sup><i>Address Size</i></sup>.");
 	
 	m_data = 0l;
-	m_pCS = 0l;
-	m_pOE = 0l;
-	m_pWE = 0l;
+	m_pCS = nullptr;
+	m_pOE = nullptr;
+	m_pWE = nullptr;
 	m_wordSize = 0;
 	m_addressSize = 0;
 	
diff --git a/src/electronics/components/ram.h b/src/electronics/components/ram.h
index b520969..1f69212 100644
--- a/src/electronics/components/ram.h
+++ b/src/electronics/components/ram.h
@@ -23,7 +23,7 @@
 class RAM : public CallbackClass, public Component
 {
 	public:
-		RAM( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		RAM( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~RAM();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/resistordip.cpp b/src/electronics/components/resistordip.cpp
index b5c75c9..8cf91f6 100644
--- a/src/electronics/components/resistordip.cpp
+++ b/src/electronics/components/resistordip.cpp
@@ -42,7 +42,7 @@ ResistorDIP::ResistorDIP( ICNDocument *icnDocument, bool newItem, const char *id
 	
 	m_resistorCount = 0;
 	for ( int i=0; i<maxCount; ++i )
-		m_resistance[i] = 0l;
+		m_resistance[i] = nullptr;
 	
 	createProperty( "resistance", Variant::Type::Double );
 	property("resistance")->setCaption( i18n("Resistance") );
@@ -87,7 +87,7 @@ void ResistorDIP::initPins()
 		for ( int i=count; i<m_resistorCount; ++i )
 		{
 			removeElement( m_resistance[i], false );
-			m_resistance[i] = 0l;
+			m_resistance[i] = nullptr;
 			removeNode( "n"+TQString::number(i) );
 			removeNode( "p"+TQString::number(i) );
 		}
diff --git a/src/electronics/components/resistordip.h b/src/electronics/components/resistordip.h
index e3996a8..28384ae 100644
--- a/src/electronics/components/resistordip.h
+++ b/src/electronics/components/resistordip.h
@@ -21,7 +21,7 @@ const int maxCount = 256;
 class ResistorDIP : public Component
 {
 public:
-	ResistorDIP( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ResistorDIP( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ResistorDIP();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/rotoswitch.h b/src/electronics/components/rotoswitch.h
index 8a4c802..f551349 100644
--- a/src/electronics/components/rotoswitch.h
+++ b/src/electronics/components/rotoswitch.h
@@ -29,7 +29,7 @@ struct SwitchPosition
 class ECRotoSwitch : public Component
 {
 public:
-    ECRotoSwitch( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+    ECRotoSwitch( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
     ~ECRotoSwitch();
     
     static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/components/serialportcomponent.cpp b/src/electronics/components/serialportcomponent.cpp
index e59b80c..50da7a9 100644
--- a/src/electronics/components/serialportcomponent.cpp
+++ b/src/electronics/components/serialportcomponent.cpp
@@ -68,7 +68,7 @@ SerialPortComponent::SerialPortComponent( ICNDocument *icnDocument, bool newItem
 	
 	m_pSerialPort = new SerialPort();
 	
-	ECNode * pin = 0;
+	ECNode * pin = nullptr;
 	
 	// Works
 	pin = createPin( -40,  32,   0, "CD" );
diff --git a/src/electronics/components/serialportcomponent.h b/src/electronics/components/serialportcomponent.h
index 21f2387..218ae57 100644
--- a/src/electronics/components/serialportcomponent.h
+++ b/src/electronics/components/serialportcomponent.h
@@ -22,7 +22,7 @@ class SerialPort;
 class SerialPortComponent : public CallbackClass, public Component
 {
 	public:
-		SerialPortComponent( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+		SerialPortComponent( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 		~SerialPortComponent();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/electronics/components/toggleswitch.h b/src/electronics/components/toggleswitch.h
index f6947b0..c00a97b 100644
--- a/src/electronics/components/toggleswitch.h
+++ b/src/electronics/components/toggleswitch.h
@@ -20,7 +20,7 @@
 class ECDPDT : public Component
 {
 public:
-	ECDPDT( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECDPDT( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECDPDT();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -47,7 +47,7 @@ private:
 class ECDPST : public Component
 {
 public:
-	ECDPST( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECDPST( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECDPST();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -72,7 +72,7 @@ private:
 class ECSPDT : public Component
 {
 public:
-	ECSPDT( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSPDT( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSPDT();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
@@ -97,7 +97,7 @@ private:
 class ECSPST : public Component
 {
 public:
-	ECSPST( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ECSPST( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ECSPST();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/electronics/ecnode.cpp b/src/electronics/ecnode.cpp
index 28af164..345ea59 100644
--- a/src/electronics/ecnode.cpp
+++ b/src/electronics/ecnode.cpp
@@ -57,7 +57,7 @@ ECNode::ECNode( ICNDocument *icnDocument, Node::node_type _type, node_dir dir, c
 {
 	m_prevV = 0;
 	m_prevI = 0;
-	m_pinPoint = 0l;
+	m_pinPoint = nullptr;
 	m_bShowVoltageBars = KTLConfig::showVoltageBars();
 	
 	icnDocument->registerItem(this);
@@ -77,9 +77,9 @@ ECNode::ECNode( ICNDocument *icnDocument, Node::node_type _type, node_dir dir, c
 ECNode::~ECNode()
 {
 	if (m_pinPoint)
-		m_pinPoint->setCanvas(0l);
+		m_pinPoint->setCanvas(nullptr);
 	delete m_pinPoint;
-	m_pinPoint = 0l;
+	m_pinPoint = nullptr;
 	
 	for ( unsigned i = 0; i < m_pins.size(); i++ )
 		delete m_pins[i];
diff --git a/src/electronics/ecnode.h b/src/electronics/ecnode.h
index 04665f5..6ac7b23 100644
--- a/src/electronics/ecnode.h
+++ b/src/electronics/ecnode.h
@@ -34,7 +34,7 @@ class ECNode : public Node
 	TQ_OBJECT
   
 	public:
-		ECNode( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = 0L );
+		ECNode( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = nullptr );
 		~ECNode();
 	
 		virtual void setParentItem( CNItem *parentItem );
@@ -49,7 +49,7 @@ class ECNode : public Node
 		 */
 		unsigned numPins() const { return m_pins.size(); }
 		PinVector pins() const { return m_pins; }
-		Pin * pin( unsigned num = 0 ) const { return (num < m_pins.size()) ? m_pins[num] : 0l; }
+		Pin * pin( unsigned num = 0 ) const { return (num < m_pins.size()) ? m_pins[num] : nullptr; }
 		bool showVoltageBars() const { return m_bShowVoltageBars; }
 		void setShowVoltageBars( bool show ) { m_bShowVoltageBars = show; }
 		void setNodeChanged();
diff --git a/src/electronics/pin.h b/src/electronics/pin.h
index 502d986..b907efc 100644
--- a/src/electronics/pin.h
+++ b/src/electronics/pin.h
@@ -101,7 +101,7 @@ class Pin : public TQObject
 		 * Tell thie Pin that none of the currents from the switches have yet
 		 * been merged.
 		 */
-		void setSwitchCurrentsUnknown() { m_switchList.remove( 0l ); m_unknownSwitchCurrents = m_switchList; }
+		void setSwitchCurrentsUnknown() { m_switchList.remove( nullptr ); m_unknownSwitchCurrents = m_switchList; }
 		/**
 		 * This returns the value given by setCurrentKnown AND'd with whether
 		 * we know the current from each switch attached to this pin.
diff --git a/src/electronics/simulation/circuit.cpp b/src/electronics/simulation/circuit.cpp
index c152756..8a17468 100644
--- a/src/electronics/simulation/circuit.cpp
+++ b/src/electronics/simulation/circuit.cpp
@@ -30,10 +30,10 @@ typedef std::multimap<int, PinList> PinListMap;
 Circuit::Circuit()
 {
 	m_bCanAddChanged = true;
-	m_pNextChanged[0] = m_pNextChanged[1] = 0l;
+	m_pNextChanged[0] = m_pNextChanged[1] = nullptr;
 	m_logicOutCount = 0;
 	m_bCanCache = false;
-	m_pLogicOut = 0l;
+	m_pLogicOut = nullptr;
 	m_elementSet = new ElementSet( this, 0, 0 );
 	m_cnodeCount = m_branchCount = -1;
 	m_prepNLCount = 0;
@@ -197,7 +197,7 @@ void Circuit::init()
 	m_cnodeCount = eqs.size() - groundCount;
 	
 	delete m_pLogicCacheBase;
-	m_pLogicCacheBase = 0l;
+	m_pLogicCacheBase = nullptr;
 	
 	delete m_elementSet;
 	m_elementSet = new ElementSet( this, m_cnodeCount, m_branchCount );
@@ -307,10 +307,10 @@ void Circuit::initCache()
 	m_logicOutCount = 0;
 	
 	delete[] m_pLogicOut;
-	m_pLogicOut = 0l;
+	m_pLogicOut = nullptr;
 	
 	delete m_pLogicCacheBase;
-	m_pLogicCacheBase = 0l;
+	m_pLogicCacheBase = nullptr;
 	
 	const ElementList::iterator end = m_elementList.end();
 	for ( ElementList::iterator it = m_elementList.begin(); it != end && m_bCanCache; ++it )
@@ -370,13 +370,13 @@ void Circuit::setCacheInvalidated()
 	if (m_pLogicCacheBase)
 	{
 		delete m_pLogicCacheBase->high;
-		m_pLogicCacheBase->high = 0l;
+		m_pLogicCacheBase->high = nullptr;
 	
 		delete m_pLogicCacheBase->low;
-		m_pLogicCacheBase->low = 0l;
+		m_pLogicCacheBase->low = nullptr;
 	
 		delete m_pLogicCacheBase->data;
-		m_pLogicCacheBase->data = 0l;
+		m_pLogicCacheBase->data = nullptr;
 	}
 }
 
@@ -533,9 +533,9 @@ void Circuit::displayEquations()
 //BEGIN class LogicCacheNode
 LogicCacheNode::LogicCacheNode()
 {
-	low = 0l;
-	high = 0l;
-	data = 0l;
+	low = nullptr;
+	high = nullptr;
+	data = nullptr;
 }
 
 
diff --git a/src/electronics/simulation/circuit.h b/src/electronics/simulation/circuit.h
index 8c275a5..3fd76f3 100644
--- a/src/electronics/simulation/circuit.h
+++ b/src/electronics/simulation/circuit.h
@@ -94,7 +94,7 @@ class Circuit
 		 * @returns the number of ground nodes. If all nodes are at or below the
 		 * 			gt_never threshold, then this will be zero.
 		 */
-		static int identifyGround( PinList nodeList, int *highest = 0l );
+		static int identifyGround( PinList nodeList, int *highest = nullptr );
 		
 		void setNextChanged( Circuit * circuit, unsigned char chain ) { m_pNextChanged[chain] = circuit; }
 		Circuit * nextChanged( unsigned char chain ) const { return m_pNextChanged[chain]; }
diff --git a/src/electronics/simulation/diode.cpp b/src/electronics/simulation/diode.cpp
index e13d478..279f68b 100644
--- a/src/electronics/simulation/diode.cpp
+++ b/src/electronics/simulation/diode.cpp
@@ -83,7 +83,7 @@ double Diode::current() const
 		return 0.0;
 	
 	double I;
-	calcIg( p_cnode[0]->v - p_cnode[1]->v, & I, 0 );
+	calcIg( p_cnode[0]->v - p_cnode[1]->v, & I, nullptr );
 	
 	return I;
 }
diff --git a/src/electronics/simulation/element.cpp b/src/electronics/simulation/element.cpp
index 2411897..f8818dc 100644
--- a/src/electronics/simulation/element.cpp
+++ b/src/electronics/simulation/element.cpp
@@ -18,19 +18,19 @@
 Element::Element()
 {
 	b_status = false;
-	p_A = 0l;
-	p_eSet = 0l;
-	p_b = 0l;
+	p_A = nullptr;
+	p_eSet = nullptr;
+	p_b = nullptr;
 	b_componentDeleted = false;
 	b_eSetDeleted = true;
 	
 	for ( int i=0; i<8; i++ )
-		p_cnode[i] = 0l;
+		p_cnode[i] = nullptr;
 	
 	resetCurrents();
 	
 	for ( int i=0; i<4; i++ )
-		p_cbranch[i] = 0l;
+		p_cbranch[i] = nullptr;
 	
 	m_numCBranches = 0;
 	m_numCNodes = 0;
@@ -70,9 +70,9 @@ void Element::componentDeleted()
 	b_status = false;
 // 	kdDebug() << "Element::componentDeleted(): Setting b_status to false, this="<<this<<endl;
 	
-	p_eSet = 0l;
-	p_A = 0l;
-	p_b = 0l;
+	p_eSet = nullptr;
+	p_A = nullptr;
+	p_b = nullptr;
 	setCNodes();
 	setCBranches();
 }
@@ -89,9 +89,9 @@ void Element::elementSetDeleted()
 	b_status = false;
 // 	kdDebug() << "Element::elementSetDeleted(): Setting b_status to false, this="<<this<<endl;
 	
-	p_eSet = 0l;
-	p_A = 0l;
-	p_b = 0l;
+	p_eSet = nullptr;
+	p_A = nullptr;
+	p_b = nullptr;
 	setCNodes();
 	setCBranches();
 }
@@ -103,16 +103,16 @@ void Element::setCNodes( const int n0, const int n1, const int n2, const int n3
 	{
 // 		cerr << "Element::setCNodes: can't set nodes without circuit!"<<endl;
 		for ( int i=0; i<8; i++ )
-			p_cnode[i] = 0l;
+			p_cnode[i] = nullptr;
 		return;
 	}
 	
 	// MAX_CNODES-1 should match the last array index below.
 	assert( MAX_CNODES == 4 );
-	p_cnode[0] = (n0>-1)?p_eSet->cnodes()[n0]:(n0==-1?p_eSet->ground():0l);
-	p_cnode[1] = (n1>-1)?p_eSet->cnodes()[n1]:(n1==-1?p_eSet->ground():0l);
-	p_cnode[2] = (n2>-1)?p_eSet->cnodes()[n2]:(n2==-1?p_eSet->ground():0l);
-	p_cnode[3] = (n3>-1)?p_eSet->cnodes()[n3]:(n3==-1?p_eSet->ground():0l);
+	p_cnode[0] = (n0>-1)?p_eSet->cnodes()[n0]:(n0==-1?p_eSet->ground():nullptr);
+	p_cnode[1] = (n1>-1)?p_eSet->cnodes()[n1]:(n1==-1?p_eSet->ground():nullptr);
+	p_cnode[2] = (n2>-1)?p_eSet->cnodes()[n2]:(n2==-1?p_eSet->ground():nullptr);
+	p_cnode[3] = (n3>-1)?p_eSet->cnodes()[n3]:(n3==-1?p_eSet->ground():nullptr);
 	updateStatus();
 }
 
@@ -121,13 +121,13 @@ void Element::setCBranches( const int b0, const int b1, const int b2, const int
 	if ( !p_eSet )
 	{
 // 		cerr << "Element::setCBranches: can't set branches without circuit!"<<endl;
-		for ( int i=0; i<4; i++ ) p_cbranch[i] = 0l;
+		for ( int i=0; i<4; i++ ) p_cbranch[i] = nullptr;
 		return;
 	}
-	p_cbranch[0] = (b0>-1)?p_eSet->cbranches()[b0]:0l;
-	p_cbranch[1] = (b1>-1)?p_eSet->cbranches()[b1]:0l;
-	p_cbranch[2] = (b2>-1)?p_eSet->cbranches()[b2]:0l;
-	p_cbranch[3] = (b3>-1)?p_eSet->cbranches()[b3]:0l;
+	p_cbranch[0] = (b0>-1)?p_eSet->cbranches()[b0]:nullptr;
+	p_cbranch[1] = (b1>-1)?p_eSet->cbranches()[b1]:nullptr;
+	p_cbranch[2] = (b2>-1)?p_eSet->cbranches()[b2]:nullptr;
+	p_cbranch[3] = (b3>-1)?p_eSet->cbranches()[b3]:nullptr;
 	updateStatus();
 }
 
diff --git a/src/electronics/simulation/elementset.cpp b/src/electronics/simulation/elementset.cpp
index 25057c2..1648389 100644
--- a/src/electronics/simulation/elementset.cpp
+++ b/src/electronics/simulation/elementset.cpp
@@ -28,7 +28,7 @@ ElementSet::ElementSet( Circuit * circuit, const int n, const int m )
 	m_pCircuit = circuit;
 	m_cn = n;
 	m_cb = m;
-	p_logicIn = 0l;
+	p_logicIn = nullptr;
 	p_A = new Matrix( m_cn, m_cb );
 	p_b = new Vector(m_cn+m_cb);
 	p_x = new Vector(m_cn+m_cb);
diff --git a/src/electronics/simulation/logic.cpp b/src/electronics/simulation/logic.cpp
index 031dd2e..4c2a720 100644
--- a/src/electronics/simulation/logic.cpp
+++ b/src/electronics/simulation/logic.cpp
@@ -20,10 +20,10 @@ LogicIn::LogicIn( LogicConfig config )
 	: Element::Element()
 {
 	m_config = config;
-	m_pCallbackFunction = 0l;
+	m_pCallbackFunction = nullptr;
 	m_numCNodes = 1;
 	m_bLastState = false;
-	m_pNextLogic = 0l;
+	m_pNextLogic = nullptr;
 	setLogic(getConfig());
 }
 
@@ -76,7 +76,7 @@ void LogicIn::setLogic( LogicConfig config )
 void LogicIn::setElementSet( ElementSet *c )
 {
 	if (c)
-		m_pNextLogic = 0l;
+		m_pNextLogic = nullptr;
 	else
 		m_cnodeI[0] = 0.;
 	
@@ -113,8 +113,8 @@ LogicOut::LogicOut( LogicConfig config, bool _high )
 	m_bOutputHighConductanceConst = false;
 	m_bOutputLowConductanceConst = false;
 	m_bOutputHighVoltageConst = false;
-	m_pNextChanged[0] = m_pNextChanged[1] = 0l;
-	m_pSimulator = 0l;
+	m_pNextChanged[0] = m_pNextChanged[1] = nullptr;
+	m_pSimulator = nullptr;
 	m_bUseLogicChain = false;
 	b_state = false;
 	m_numCNodes = 1;
@@ -149,7 +149,7 @@ void LogicOut::setUseLogicChain( bool use )
 	
 	m_bUseLogicChain = use;
 	if (use)
-		setElementSet(0l);
+		setElementSet(nullptr);
 }
 
 
@@ -161,7 +161,7 @@ void LogicOut::setElementSet( ElementSet *c )
 	if (c)
 	{
 		m_bUseLogicChain = false;
-		m_pNextChanged[0] = m_pNextChanged[1] = 0l;
+		m_pNextChanged[0] = m_pNextChanged[1] = nullptr;
 	}
 	
 	// NOTE Make sure that the next two lines are the same as those in setHigh and setLogic
diff --git a/src/electronics/switch.cpp b/src/electronics/switch.cpp
index 57830af..1b91b60 100644
--- a/src/electronics/switch.cpp
+++ b/src/electronics/switch.cpp
@@ -28,7 +28,7 @@ Switch::Switch( Component * parent, Pin * p1, Pin * p2, State state )
 	m_bouncePeriod_ms = 5;
 	m_bBounce = false;
 	m_bounceStart = 0;
-	m_pBounceResistance = 0l;
+	m_pBounceResistance = nullptr;
 	m_pP1 = p1;
 	m_pP2 = p2;
 	m_pComponent = parent;
@@ -125,7 +125,7 @@ void Switch::stopBouncing()
 {
 	Simulator::self()->detachSwitch( this );
 	m_pComponent->removeElement( m_pBounceResistance, true );
-	m_pBounceResistance = 0l;
+	m_pBounceResistance = nullptr;
 	
 	bool connected = (m_state == Closed);
 	
diff --git a/src/eventinfo.cpp b/src/eventinfo.cpp
index 39bf877..d4714c0 100644
--- a/src/eventinfo.cpp
+++ b/src/eventinfo.cpp
@@ -66,7 +66,7 @@ void EventInfo::reset()
 	ctrlPressed = false;
 	shiftPressed = false;
 	altPressed = false;
-	qcanvasItemClickedOn = 0l;
+	qcanvasItemClickedOn = nullptr;
 	itemRtti = ItemDocument::RTTI::None;
 	scrollDelta = 0;
 	scrollOrientation = TQt::Vertical;
diff --git a/src/flowcodedocument.cpp b/src/flowcodedocument.cpp
index 5d01cba..3cf64d6 100644
--- a/src/flowcodedocument.cpp
+++ b/src/flowcodedocument.cpp
@@ -32,10 +32,10 @@ FlowCodeDocument::FlowCodeDocument( const TQString &caption, KTechlab *ktechlab,
 {
 	m_pDocumentIface = new FlowCodeDocumentIface(this);
 	m_type = Document::dt_flowcode;
-	m_microInfo = 0L;
-	m_microSettings = 0L;
-	m_picItem = 0L;
-	m_pLastTextOutputTarget = 0l;
+	m_microInfo = nullptr;
+	m_microSettings = nullptr;
+	m_picItem = nullptr;
+	m_pLastTextOutputTarget = nullptr;
 	
 	m_cmManager->addManipulatorInfo( CMSelect::manipulatorInfo() );
 	m_cmManager->addManipulatorInfo( CMDraw::manipulatorInfo() );
@@ -56,10 +56,10 @@ FlowCodeDocument::~FlowCodeDocument()
 		m_picItem->removeItem();
 	
 	delete m_microSettings;
-	m_microSettings = 0l;
+	m_microSettings = nullptr;
 	
 	delete m_pDocumentIface;
-	m_pDocumentIface = 0l;
+	m_pDocumentIface = nullptr;
 }
 
 
diff --git a/src/flowcodedocument.h b/src/flowcodedocument.h
index b29850c..10b70f6 100644
--- a/src/flowcodedocument.h
+++ b/src/flowcodedocument.h
@@ -36,10 +36,10 @@ class FlowCodeDocument : public ICNDocument
 	TQ_OBJECT
   
 	public:
-		FlowCodeDocument( const TQString &caption, KTechlab *ktechlab, const char *name = 0L);
+		FlowCodeDocument( const TQString &caption, KTechlab *ktechlab, const char *name = nullptr);
 		~FlowCodeDocument();
 	
-		virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+		virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 
 		/**
 		 * Returns a pointer used for the MicroSettings in this FlowCode document
diff --git a/src/flowcodeview.cpp b/src/flowcodeview.cpp
index 0e330e2..29e7556 100644
--- a/src/flowcodeview.cpp
+++ b/src/flowcodeview.cpp
@@ -24,7 +24,7 @@ FlowCodeView::FlowCodeView( FlowCodeDocument * flowCodeDocument, ViewContainer *
 	TDEActionCollection * ac = actionCollection();
 	
 	//BEGIN Convert To * Actions
-	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Convert to ..."), "fork", 0, 0, 0, ac, "program_convert" );
+	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Convert to ..."), "fork", 0, nullptr, nullptr, ac, "program_convert" );
 	pa->setDelayed(false);
 	
 	TDEPopupMenu * m = pa->popupMenu();
@@ -65,7 +65,7 @@ FlowCodeView::FlowCodeView( FlowCodeDocument * flowCodeDocument, ViewContainer *
 FlowCodeView::~FlowCodeView()
 {
 	delete m_pViewIface;
-	m_pViewIface = 0l;
+	m_pViewIface = nullptr;
 }
 
 
diff --git a/src/flowcodeview.h b/src/flowcodeview.h
index 913d7dc..e05099a 100644
--- a/src/flowcodeview.h
+++ b/src/flowcodeview.h
@@ -23,7 +23,7 @@ class FlowCodeView : public ICNView
 	TQ_OBJECT
   
 	public:
-		FlowCodeView( FlowCodeDocument *flowCodeDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+		FlowCodeView( FlowCodeDocument *flowCodeDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 		~FlowCodeView();
 	
 	protected:
diff --git a/src/flowcontainer.cpp b/src/flowcontainer.cpp
index f264286..1b72c6e 100644
--- a/src/flowcontainer.cpp
+++ b/src/flowcontainer.cpp
@@ -27,7 +27,7 @@ const int botStrip = 16;
 FlowContainer::FlowContainer( ICNDocument *_icnDocument, bool newItem, const TQString &id )
 	: FlowPart( _icnDocument, newItem, id )
 {
-	m_ext_in = m_int_in = m_int_out = m_ext_out = 0l;
+	m_ext_in = m_int_in = m_int_out = m_ext_out = nullptr;
 	b_expanded = true;
 	
 	addButton( "expandBtn", TQRect( offsetX(), offsetY()+24 - 11, 22, 22 ), TDEGlobal::iconLoader()->loadIcon( "go-down", TDEIcon::Small ), true );
@@ -307,7 +307,7 @@ void FlowContainer::setExpanded( bool expanded )
 	m_rectangularOverlay->setVisible(expanded);
 	setFullBounds(false);
 	
-	bool nodesMoved = (m_ext_out != 0l);
+	bool nodesMoved = (m_ext_out != nullptr);
 	if (nodesMoved)
 		p_icnDocument->requestRerouteInvalidatedConnectors();	
 	
@@ -384,7 +384,7 @@ void FlowContainer::updateContainedVisibility()
 	m_rectangularOverlay->setVisible( isVisible() && b_expanded );
 	
 	NodeGroupList hidableNodeGroups;
-	p_icnDocument->getTranslatable( children(true) += GuardedItem(this), 0, 0, &hidableNodeGroups );
+	p_icnDocument->getTranslatable( children(true) += GuardedItem(this), nullptr, nullptr, &hidableNodeGroups );
 	
 	NodeGroupList::iterator hngEnd = hidableNodeGroups.end();
 	for ( NodeGroupList::iterator it = hidableNodeGroups.begin(); it != hngEnd; ++it )
diff --git a/src/flowparts/callsub.h b/src/flowparts/callsub.h
index 5cba4f2..c57938d 100644
--- a/src/flowparts/callsub.h
+++ b/src/flowparts/callsub.h
@@ -20,7 +20,7 @@
 class CallSub : public FlowPart
 {
 public:
-	CallSub( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	CallSub( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~CallSub();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/count.h b/src/flowparts/count.h
index 516889d..f3743ce 100644
--- a/src/flowparts/count.h
+++ b/src/flowparts/count.h
@@ -20,7 +20,7 @@
 class Count : public FlowPart
 {
 public:
-	Count( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Count( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Count();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/delay.h b/src/flowparts/delay.h
index fbe6326..c09b8b8 100644
--- a/src/flowparts/delay.h
+++ b/src/flowparts/delay.h
@@ -20,7 +20,7 @@
 class Delay : public FlowPart
 {
 public:
-	Delay( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Delay( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Delay();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/embed.h b/src/flowparts/embed.h
index d891c39..03864ff 100644
--- a/src/flowparts/embed.h
+++ b/src/flowparts/embed.h
@@ -20,7 +20,7 @@
 class Embed : public FlowPart
 {
 public:
-	Embed( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Embed( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Embed();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/end.h b/src/flowparts/end.h
index a2c2a1e..b98ef93 100644
--- a/src/flowparts/end.h
+++ b/src/flowparts/end.h
@@ -20,7 +20,7 @@
 class End : public FlowPart
 {
 public:
-	End( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	End( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~End();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/flowpart.cpp b/src/flowparts/flowpart.cpp
index e0f5f71..0d78091 100644
--- a/src/flowparts/flowpart.cpp
+++ b/src/flowparts/flowpart.cpp
@@ -70,9 +70,9 @@ FlowPart::FlowPart( ICNDocument *icnDocument, bool newItem, const TQString &id )
 	
 	m_flowSymbol = FlowPart::ps_other;
 	m_orientation = 0;
-	m_stdInput = 0l;
-	m_stdOutput = 0l;
-	m_altOutput = 0l;
+	m_stdInput = nullptr;
+	m_stdOutput = nullptr;
+	m_altOutput = nullptr;
 	
 	connect( m_pFlowCodeDocument, TQ_SIGNAL(picTypeChanged()), this, TQ_SLOT(slotUpdateFlowPartVariables()) );
 	connect( m_pFlowCodeDocument, TQ_SIGNAL(pinMappingsChanged()), this, TQ_SLOT(slotUpdateFlowPartVariables()) );
@@ -335,7 +335,7 @@ FlowPart* FlowPart::outputPart( const TQString& internalNodeId )
 	
 	FPNode *fpnode = dynamic_cast<FPNode*>(node);
 	if ( !fpnode || fpnode->type() == Node::fp_in )
-		return 0l;
+		return nullptr;
 	
 	return fpnode->outputFlowPart();
 }
@@ -404,12 +404,12 @@ FlowPart* FlowPart::endPart( TQStringList ids, FlowPartList *previousParts )
 	if (createdList) {
 		previousParts = new FlowPartList;
 	} else if ( previousParts->contains(this) ) {
-		return 0l;
+		return nullptr;
 	}
 	previousParts->append(this);
 	
 	if ( ids.empty() ) {
-		return 0l;
+		return nullptr;
 	}
 	if ( ids.size() == 1 ) {
 		return outputPart( *(ids.begin()) );
@@ -438,7 +438,7 @@ FlowPart* FlowPart::endPart( TQStringList ids, FlowPartList *previousParts )
 // 				}
 			}
 			else {
-				part = 0l;
+				part = nullptr;
 			}
 		}
 		if ( !validParts.empty() ) {
@@ -449,10 +449,10 @@ FlowPart* FlowPart::endPart( TQStringList ids, FlowPartList *previousParts )
 	if (createdList)
 	{
 		delete previousParts;
-		previousParts = 0l;
+		previousParts = nullptr;
 	}
 	
-	if ( validPartsList.empty() ) return 0l;
+	if ( validPartsList.empty() ) return nullptr;
 	
 	FlowPartList firstList = *(validPartsList.begin());
 	const FlowPartList::iterator flEnd = firstList.end();
@@ -467,7 +467,7 @@ FlowPart* FlowPart::endPart( TQStringList ids, FlowPartList *previousParts )
 		if (ok) return *it;
 	}
 	
-	return 0l;
+	return nullptr;
 }
 
 
@@ -476,7 +476,7 @@ void FlowPart::handleIfElse( FlowCode *code, const TQString &case1Statement, con
 {
 	if (!code) return;
 	
-	FlowPart *stop = 0l;
+	FlowPart *stop = nullptr;
 	FlowPart *part1 = outputPart(case1);
 	FlowPart *part2 = outputPart(case2);
 	
@@ -662,11 +662,11 @@ void FlowPart::updateAttachedPositioning( )
 		TQRect( offsetX()-40,		6,					40, 16 ),
 		TQRect( 0,					offsetY()+height(),	40, 16 ) };
 	
-	NodeInfo * stdOutputInfo = m_stdOutput ? &m_nodeMap["stdoutput"] : 0;
-	NodeInfo * altOutputInfo = m_altOutput ? &m_nodeMap["altoutput"] : 0l;
+	NodeInfo * stdOutputInfo = m_stdOutput ? &m_nodeMap["stdoutput"] : nullptr;
+	NodeInfo * altOutputInfo = m_altOutput ? &m_nodeMap["altoutput"] : nullptr;
 	
-	Text *outputTrueText = m_textMap.contains("output_true") ? m_textMap["output_true"] : 0l;
-	Text *outputFalseText = m_textMap.contains("output_false") ? m_textMap["output_false"] : 0l;
+	Text *outputTrueText = m_textMap.contains("output_true") ? m_textMap["output_true"] : nullptr;
+	Text *outputFalseText = m_textMap.contains("output_false") ? m_textMap["output_false"] : nullptr;
 	
 	if ( stdOutputInfo && outputTrueText )
 		outputTrueText->setOriginalRect( textPos[ nodeDirToPos( (Node::node_dir)stdOutputInfo->orientation ) ] );
@@ -730,9 +730,9 @@ void FlowPart::updateNodePositions()
 		return;
 	}
 	
-	NodeInfo * stdInputInfo = m_stdInput ? &m_nodeMap["stdinput"] : 0l;
-	NodeInfo * stdOutputInfo = m_stdOutput ? &m_nodeMap["stdoutput"] : 0;
-	NodeInfo * altOutputInfo = m_altOutput ? &m_nodeMap["altoutput"] : 0l;
+	NodeInfo * stdInputInfo = m_stdInput ? &m_nodeMap["stdinput"] : nullptr;
+	NodeInfo * stdOutputInfo = m_stdOutput ? &m_nodeMap["stdoutput"] : nullptr;
+	NodeInfo * altOutputInfo = m_altOutput ? &m_nodeMap["altoutput"] : nullptr;
 	
 	if ( m_stdInput && m_stdOutput && m_altOutput )
 	{
diff --git a/src/flowparts/flowpart.h b/src/flowparts/flowpart.h
index 2b3be1d..cbbcd87 100644
--- a/src/flowparts/flowpart.h
+++ b/src/flowparts/flowpart.h
@@ -74,7 +74,7 @@ public:
 	 * @param previousParts A list of parts in the calling tree. This avoids infinite recursion.
 	 * @returns The first FlowPart satisfying these conditions, or NULL if no such part exists
 	 */
-	FlowPart* endPart( TQStringList ids, FlowPartList *previousParts = 0l );
+	FlowPart* endPart( TQStringList ids, FlowPartList *previousParts = nullptr );
 	/**
 	 * Handles the addition of a if-else statement to the given FlowCode. This will
 	 * order the code as necessary, adding the branches in the appropriate places
diff --git a/src/flowparts/inputbutton.h b/src/flowparts/inputbutton.h
index 7467b42..126ebda 100644
--- a/src/flowparts/inputbutton.h
+++ b/src/flowparts/inputbutton.h
@@ -20,7 +20,7 @@
 class InputButton : public FlowPart
 {
 public:
-	InputButton( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	InputButton( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~InputButton();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/interrupt.h b/src/flowparts/interrupt.h
index 807cc30..b227f93 100644
--- a/src/flowparts/interrupt.h
+++ b/src/flowparts/interrupt.h
@@ -20,7 +20,7 @@
 class Interrupt : public FlowContainer
 {
 public:
-	Interrupt( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Interrupt( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Interrupt();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/keypad.h b/src/flowparts/keypad.h
index e2ddba8..1ee3b93 100644
--- a/src/flowparts/keypad.h
+++ b/src/flowparts/keypad.h
@@ -20,7 +20,7 @@
 class Keypad : public FlowPart
 {
 public:
-	Keypad( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Keypad( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Keypad();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/pinmapping.cpp b/src/flowparts/pinmapping.cpp
index cfaf9e2..92b28f8 100644
--- a/src/flowparts/pinmapping.cpp
+++ b/src/flowparts/pinmapping.cpp
@@ -83,7 +83,7 @@ PinMapEditor::PinMapEditor( PinMapping * pinMapping, MicroInfo * picInfo, TQWidg
 	f->setFrameShadow( TQFrame::Plain );
 	TQVBoxLayout * fLayout = new TQVBoxLayout( f, 1, 0, "fLayout" );
 
-	ViewContainer * vc = new ViewContainer( 0, 0, f );
+	ViewContainer * vc = new ViewContainer( nullptr, nullptr, f );
 	fLayout->addWidget( vc );
 	
 	m_pPinMapView = static_cast<PinMapView*>(m_pPinMapDocument->createView( vc, 0 ));
@@ -121,11 +121,11 @@ void PinMapEditor::savePinMapping()
 
 //BEGIN class PinMapDocument
 PinMapDocument::PinMapDocument()
-	: ICNDocument( 0, 0, 0 )
+	: ICNDocument( nullptr, nullptr, nullptr )
 {
-	m_pPicComponent = 0l;
-	m_pKeypad = 0l;
-	m_pSevenSegment = 0l;
+	m_pPicComponent = nullptr;
+	m_pKeypad = nullptr;
+	m_pSevenSegment = nullptr;
 	m_type = dt_pinMapEditor;
 	
 	m_cmManager->addManipulatorInfo( CMSelect::manipulatorInfo() );
@@ -243,7 +243,7 @@ PinMapping PinMapDocument::pinMapping() const
 	
 	TQStringList picPinIDs;
 	TQStringList attachedIDs;
-	Component * attached = 0l;
+	Component * attached = nullptr;
 	
 	switch ( m_pinMappingType )
 	{
@@ -326,7 +326,7 @@ Item* PIC_IC::construct( ItemDocument *itemDocument, bool newItem, const char *i
 
 LibraryItem* PIC_IC::libraryItem()
 {
-	return new LibraryItem(	"PIC_IC", 0, 0, LibraryItem::lit_other, PIC_IC::construct );
+	return new LibraryItem(	"PIC_IC", nullptr, nullptr, LibraryItem::lit_other, PIC_IC::construct );
 }
 
 
diff --git a/src/flowparts/pinmapping.h b/src/flowparts/pinmapping.h
index 3ba3f51..a49951e 100644
--- a/src/flowparts/pinmapping.h
+++ b/src/flowparts/pinmapping.h
@@ -124,7 +124,7 @@ class PinMapView : public ICNView
 	TQ_OBJECT
   
 	public:
-		PinMapView( PinMapDocument * pinMapDocument, ViewContainer * viewContainer, uint viewAreaId, const char * name = 0l );
+		PinMapView( PinMapDocument * pinMapDocument, ViewContainer * viewContainer, uint viewAreaId, const char * name = nullptr );
 		~PinMapView();
 };
 
@@ -132,7 +132,7 @@ class PinMapView : public ICNView
 class PIC_IC : public Component
 {
 	public:
-		PIC_IC( ICNDocument * icnDocument, bool newItem, const char *id = 0L );
+		PIC_IC( ICNDocument * icnDocument, bool newItem, const char *id = nullptr );
 		virtual ~PIC_IC();
 	
 		virtual bool canFlip() const { return true; }
diff --git a/src/flowparts/pulse.h b/src/flowparts/pulse.h
index db40aee..0f2c03c 100644
--- a/src/flowparts/pulse.h
+++ b/src/flowparts/pulse.h
@@ -20,7 +20,7 @@
 class Pulse : public FlowPart
 {
 public:
-	Pulse( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Pulse( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Pulse();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/readport.h b/src/flowparts/readport.h
index a150f64..ed65bbe 100644
--- a/src/flowparts/readport.h
+++ b/src/flowparts/readport.h
@@ -20,7 +20,7 @@
 class ReadPort : public FlowPart
 {
 public:
-	ReadPort( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	ReadPort( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~ReadPort();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/setpin.h b/src/flowparts/setpin.h
index 0e662bc..ec32adb 100644
--- a/src/flowparts/setpin.h
+++ b/src/flowparts/setpin.h
@@ -20,7 +20,7 @@
 class SetPin : public FlowPart
 {
 public:
-	SetPin( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	SetPin( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~SetPin();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/sevenseg.h b/src/flowparts/sevenseg.h
index 47b2979..446a40f 100644
--- a/src/flowparts/sevenseg.h
+++ b/src/flowparts/sevenseg.h
@@ -20,7 +20,7 @@
 class SevenSeg : public FlowPart
 {
 public:
-	SevenSeg( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	SevenSeg( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~SevenSeg();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/start.h b/src/flowparts/start.h
index 8585b4a..643af5a 100644
--- a/src/flowparts/start.h
+++ b/src/flowparts/start.h
@@ -20,7 +20,7 @@
 class Start : public FlowPart
 {
 public:
-	Start( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Start( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Start();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/sub.h b/src/flowparts/sub.h
index aca2005..e39f8db 100644
--- a/src/flowparts/sub.h
+++ b/src/flowparts/sub.h
@@ -20,7 +20,7 @@
 class Sub : public FlowContainer
 {
 public:
-	Sub( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Sub( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Sub();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/testpin.h b/src/flowparts/testpin.h
index 72a1411..2ae00b2 100644
--- a/src/flowparts/testpin.h
+++ b/src/flowparts/testpin.h
@@ -20,7 +20,7 @@
 class TestPin : public FlowPart
 {
 public:
-	TestPin( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	TestPin( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~TestPin();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/unary.h b/src/flowparts/unary.h
index ec830d6..77609f0 100644
--- a/src/flowparts/unary.h
+++ b/src/flowparts/unary.h
@@ -20,7 +20,7 @@
 class Unary : public FlowPart
 {
 public:
-	Unary( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	Unary( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~Unary();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/varassignment.h b/src/flowparts/varassignment.h
index 25cb78c..05a35b7 100644
--- a/src/flowparts/varassignment.h
+++ b/src/flowparts/varassignment.h
@@ -20,7 +20,7 @@
 class VarAssignment : public FlowPart
 {
 public:
-	VarAssignment( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	VarAssignment( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~VarAssignment();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/varcomparison.h b/src/flowparts/varcomparison.h
index 366cb42..65459df 100644
--- a/src/flowparts/varcomparison.h
+++ b/src/flowparts/varcomparison.h
@@ -20,7 +20,7 @@
 class VarComparison : public FlowPart
 {
 public:
-	VarComparison( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	VarComparison( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~VarComparison();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/flowparts/writeport.h b/src/flowparts/writeport.h
index 335db3b..24dbb67 100644
--- a/src/flowparts/writeport.h
+++ b/src/flowparts/writeport.h
@@ -20,7 +20,7 @@
 class WritePort : public FlowPart
 {
 public:
-	WritePort( ICNDocument *icnDocument, bool newItem, const char *id = 0L );
+	WritePort( ICNDocument *icnDocument, bool newItem, const char *id = nullptr );
 	~WritePort();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/fpnode.cpp b/src/fpnode.cpp
index b62f0ae..0e94fdf 100644
--- a/src/fpnode.cpp
+++ b/src/fpnode.cpp
@@ -39,11 +39,11 @@ FlowPart *FPNode::outputFlowPart() const
 		kdError() << "FpNode::outputFlowPart(): outputConnectorList() size is greater than 1"<<endl;
 	
 	else if ( m_outputConnectorList.size() < 1 )
-		return 0l;
+		return nullptr;
 	
 	ConnectorList::const_iterator it = m_outputConnectorList.begin();
 	if ( it == m_outputConnectorList.end() || !*it || !(*it)->endNode()  )
-		return 0L;
+		return nullptr;
 	
 	return (dynamic_cast<FPNode*>((*it)->endNode()))->outputFlowPart();
 }
@@ -64,7 +64,7 @@ FlowPartList FPNode::inputFlowParts() const
 		if (*it)
 		{
 			Node *startNode = (*it)->startNode();
-			FlowPart *flowPart = startNode ? dynamic_cast<FlowPart*>(startNode->parentItem()) : 0l;
+			FlowPart *flowPart = startNode ? dynamic_cast<FlowPart*>(startNode->parentItem()) : nullptr;
 			if (flowPart)
 				list.append(flowPart);
 		}
diff --git a/src/fpnode.h b/src/fpnode.h
index bbf3b9a..87b451e 100644
--- a/src/fpnode.h
+++ b/src/fpnode.h
@@ -28,7 +28,7 @@ class FPNode : public Node
 TQ_OBJECT
   
 public:
-    FPNode( ICNDocument *_icnView, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = 0L );
+    FPNode( ICNDocument *_icnView, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = nullptr );
     ~FPNode();
 	
 	/**
diff --git a/src/gui/colorcombo.h b/src/gui/colorcombo.h
index 037d860..8b248a3 100644
--- a/src/gui/colorcombo.h
+++ b/src/gui/colorcombo.h
@@ -37,7 +37,7 @@ class ColorCombo : public TQComboBox
   	 	/**
 		 * Constructs a color combo box.
 		 */
-		ColorCombo( ColorScheme colorScheme, TQWidget *parent, const char *name = 0L );
+		ColorCombo( ColorScheme colorScheme, TQWidget *parent, const char *name = nullptr );
 		~ColorCombo();
 
 		/**
diff --git a/src/gui/contexthelp.cpp b/src/gui/contexthelp.cpp
index f12ed61..1fcb2ef 100644
--- a/src/gui/contexthelp.cpp
+++ b/src/gui/contexthelp.cpp
@@ -24,7 +24,7 @@
 
 #include <assert.h>
 
-ContextHelp * ContextHelp::m_pSelf = 0l;
+ContextHelp * ContextHelp::m_pSelf = nullptr;
 
 ContextHelp * ContextHelp::self( KateMDI::ToolView * parent )
 {
diff --git a/src/gui/contexthelp.h b/src/gui/contexthelp.h
index 0b31db4..e9eece6 100644
--- a/src/gui/contexthelp.h
+++ b/src/gui/contexthelp.h
@@ -32,7 +32,7 @@ class ContextHelp : public TQWidget
 	TQ_OBJECT
   
 	public:
-		static ContextHelp * self( KateMDI::ToolView * parent = 0l );
+		static ContextHelp * self( KateMDI::ToolView * parent = nullptr );
 		static TQString toolViewIdentifier() { return "ContextHelp"; }
 		
 		~ContextHelp();
diff --git a/src/gui/doublespinbox.cpp b/src/gui/doublespinbox.cpp
index a0e7717..b5512c1 100644
--- a/src/gui/doublespinbox.cpp
+++ b/src/gui/doublespinbox.cpp
@@ -47,7 +47,7 @@ DoubleSpinBox::DoubleSpinBox( double lower, double upper, double minAbs, double
 	TQSpinBox::setMaxValue( +(1<<30) );	
 	setValue( value );
 	
-	setValidator( 0 );
+	setValidator( nullptr );
 }
 
 
@@ -58,7 +58,7 @@ DoubleSpinBox::~DoubleSpinBox()
 
 double DoubleSpinBox::value()
 {
-	return getDisplayedNumber( 0 ) * getMult();
+	return getDisplayedNumber( nullptr ) * getMult();
 }
 
 
diff --git a/src/gui/doublespinbox.h b/src/gui/doublespinbox.h
index 4607ec8..9167c6c 100644
--- a/src/gui/doublespinbox.h
+++ b/src/gui/doublespinbox.h
@@ -25,7 +25,7 @@ class DoubleSpinBox : public TQSpinBox
 	TQ_OBJECT
   
 	public:
-		DoubleSpinBox( double lower, double upper, double minAbs, double value, const TQString & unit, TQWidget * parent = 0 );
+		DoubleSpinBox( double lower, double upper, double minAbs, double value, const TQString & unit, TQWidget * parent = nullptr );
 		virtual ~DoubleSpinBox();
 		
 		/**
diff --git a/src/gui/itemeditor.cpp b/src/gui/itemeditor.cpp
index a6b21a2..f0126f6 100644
--- a/src/gui/itemeditor.cpp
+++ b/src/gui/itemeditor.cpp
@@ -24,7 +24,7 @@
 
 #include <assert.h>
 
-ItemEditor * ItemEditor::m_pSelf = 0l;
+ItemEditor * ItemEditor::m_pSelf = nullptr;
 
 ItemEditor * ItemEditor::self( KateMDI::ToolView * parent )
 {
@@ -98,7 +98,7 @@ void ItemEditor::slotClear()
 	m_orientationWidget->slotClear();
 	m_defaultsBtn->setEnabled(false);
 	m_mergeBtn->setEnabled(false);
-	updateNameLabel(0l);
+	updateNameLabel(nullptr);
 }
 
 
diff --git a/src/gui/itemeditor.h b/src/gui/itemeditor.h
index 47fac35..7235026 100644
--- a/src/gui/itemeditor.h
+++ b/src/gui/itemeditor.h
@@ -38,7 +38,7 @@ class ItemEditor : public TQWidget
 	TQ_OBJECT
   
 	public:
-		static ItemEditor * self( KateMDI::ToolView * parent = 0l );
+		static ItemEditor * self( KateMDI::ToolView * parent = nullptr );
 		~ItemEditor();
 		static TQString toolViewIdentifier() { return "ItemEditor"; }
 	
diff --git a/src/gui/itemselector.cpp b/src/gui/itemselector.cpp
index e400f73..fec2044 100644
--- a/src/gui/itemselector.cpp
+++ b/src/gui/itemselector.cpp
@@ -31,19 +31,19 @@
 #include <assert.h>
 
 ILVItem::ILVItem( TQListView* parent, const TQString &id )
-	: TDEListViewItem( parent, 0 )
+	: TDEListViewItem( parent, nullptr )
 {
 	m_id = id;
 	b_isRemovable = false;
-	m_pProjectItem = 0l;
+	m_pProjectItem = nullptr;
 }
 
 ILVItem::ILVItem( TQListViewItem* parent, const TQString &id )
-	: TDEListViewItem( parent, 0 )
+	: TDEListViewItem( parent, nullptr )
 {
 	m_id = id;
 	b_isRemovable = false;
-	m_pProjectItem = 0l;
+	m_pProjectItem = nullptr;
 }
 
 
@@ -77,7 +77,7 @@ void ItemSelector::clear()
 
 void ItemSelector::addItem( const TQString & caption, const TQString & id, const TQString & _category, const TQPixmap & icon, bool removable )
 {
-	ILVItem *parentItem = 0L;
+	ILVItem *parentItem = nullptr;
 	
 	TQString category = _category;
 	if ( !category.startsWith("/") ) {
@@ -232,7 +232,7 @@ TQDragObject* ItemSelector::dragObject()
 {
 	const TQString id = currentItem()->key(0,0);
 	
-	TQStoredDrag * d = 0l;
+	TQStoredDrag * d = nullptr;
 	
 	if ( id.startsWith("flow/") )
 		d = new TQStoredDrag( "ktechlab/flowpart", this );
@@ -264,7 +264,7 @@ TQDragObject* ItemSelector::dragObject()
 
 
 //BEGIN class ComponentSelector
-ComponentSelector * ComponentSelector::m_pSelf = 0l;
+ComponentSelector * ComponentSelector::m_pSelf = nullptr;
 
 
 ComponentSelector * ComponentSelector::self( KateMDI::ToolView * parent )
@@ -304,7 +304,7 @@ ComponentSelector::ComponentSelector( KateMDI::ToolView * parent )
 
 
 //BEGIN class FlowPartSelector
-FlowPartSelector * FlowPartSelector::m_pSelf = 0l;
+FlowPartSelector * FlowPartSelector::m_pSelf = nullptr;
 
 
 FlowPartSelector * FlowPartSelector::self( KateMDI::ToolView * parent )
@@ -337,7 +337,7 @@ FlowPartSelector::FlowPartSelector( KateMDI::ToolView * parent )
 
 
 //BEGIN class MechanicsSelector
-MechanicsSelector * MechanicsSelector::m_pSelf = 0l;
+MechanicsSelector * MechanicsSelector::m_pSelf = nullptr;
 
 
 MechanicsSelector * MechanicsSelector::self( KateMDI::ToolView * parent )
diff --git a/src/gui/itemselector.h b/src/gui/itemselector.h
index 0d7e61f..a96cdaf 100644
--- a/src/gui/itemselector.h
+++ b/src/gui/itemselector.h
@@ -124,7 +124,7 @@ class ComponentSelector : public ItemSelector
 	TQ_OBJECT
   
 	public:
-		static ComponentSelector * self( KateMDI::ToolView * parent = 0l );
+		static ComponentSelector * self( KateMDI::ToolView * parent = nullptr );
 		static TQString toolViewIdentifier() { return "ComponentSelector"; }
 	
 	private:
@@ -142,7 +142,7 @@ class FlowPartSelector : public ItemSelector
 	TQ_OBJECT
   
 	public:
-		static FlowPartSelector * self( KateMDI::ToolView * parent = 0l );
+		static FlowPartSelector * self( KateMDI::ToolView * parent = nullptr );
 		static TQString toolViewIdentifier() { return "FlowPartSelector"; }
 	
 	private:
@@ -159,11 +159,11 @@ class MechanicsSelector : public ItemSelector
 	TQ_OBJECT
   
 	public:
-		static MechanicsSelector * self( KateMDI::ToolView * parent = 0l );
+		static MechanicsSelector * self( KateMDI::ToolView * parent = nullptr );
 		static TQString toolViewIdentifier() { return "MechanicsSelector"; }
 	
 	private:
-		MechanicsSelector( TQWidget *parent = 0L );
+		MechanicsSelector( TQWidget *parent = nullptr );
 		static MechanicsSelector * m_pSelf;
 };
 
diff --git a/src/gui/logview.h b/src/gui/logview.h
index 52a627b..ec48a34 100644
--- a/src/gui/logview.h
+++ b/src/gui/logview.h
@@ -44,7 +44,7 @@ class LogView : public KTextEdit
 	TQ_OBJECT
   
 	public:
-		LogView( KateMDI::ToolView * parent, const char *name = 0 );
+		LogView( KateMDI::ToolView * parent, const char *name = nullptr );
 		~LogView();
 	
 		enum OutputType
diff --git a/src/gui/microselectwidget.h b/src/gui/microselectwidget.h
index 1fa49e9..31b4de2 100644
--- a/src/gui/microselectwidget.h
+++ b/src/gui/microselectwidget.h
@@ -30,7 +30,7 @@ class MicroSelectWidget : public TQGroupBox
   
 
 	public:
-		MicroSelectWidget( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+		MicroSelectWidget( TQWidget* parent = nullptr, const char* name = nullptr, WFlags fl = 0 );
 		~MicroSelectWidget();
 
 		void setMicro( const TQString & id );
diff --git a/src/gui/microsettingsdlg.cpp b/src/gui/microsettingsdlg.cpp
index 8478d66..46d5e56 100644
--- a/src/gui/microsettingsdlg.cpp
+++ b/src/gui/microsettingsdlg.cpp
@@ -35,8 +35,8 @@ MicroSettingsDlg::MicroSettingsDlg( MicroSettings * microSettings, TQWidget *par
 	: KDialogBase( parent, name, true, i18n("PIC Settings"), KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Ok, true )
 {
 	m_pMicroSettings = microSettings;
-	m_pNewPinMappingWidget = 0l;
-	m_pNewPinMappingDlg = 0l;
+	m_pNewPinMappingWidget = nullptr;
+	m_pNewPinMappingDlg = nullptr;
 	m_pWidget = new MicroSettingsWidget(this);
 	
 	TQWhatsThis::add( this, i18n("This dialog allows editing of the initial properties of the PIC") );
@@ -47,8 +47,8 @@ MicroSettingsDlg::MicroSettingsDlg( MicroSettings * microSettings, TQWidget *par
 	//BEGIN Initialize initial port settings
 	m_portNames = microSettings->microInfo()->package()->portNames();
 	
-	m_portTypeEdit.resize( m_portNames.size(), 0 );
-	m_portStateEdit.resize( m_portNames.size(), 0 );
+	m_portTypeEdit.resize( m_portNames.size(), nullptr );
+	m_portStateEdit.resize( m_portNames.size(), nullptr );
 	
 	uint row = 0;
 	TQStringList::iterator end = m_portNames.end();
@@ -204,8 +204,8 @@ class PinMappingNameValidator : public TQValidator
 		 * Create a validator. If oldName is not empty, then the input is
 		 * allowed to be oldName.
 		 */
-		PinMappingNameValidator( MicroSettingsDlg * dlg, const TQString & oldName = 0 )
-			: TQValidator(0)
+		PinMappingNameValidator( MicroSettingsDlg * dlg, const TQString & oldName = nullptr )
+			: TQValidator(nullptr)
 		{
 			m_pDlg = dlg;
 			m_oldName = oldName;
@@ -249,7 +249,7 @@ void MicroSettingsDlg::slotCreatePinMap()
 	m_pNewPinMappingWidget->nameEdit->setValidator( validator );
 	
 	connect( m_pNewPinMappingWidget->nameEdit, TQ_SIGNAL(textChanged(const TQString &)), this, TQ_SLOT(slotCheckNewPinMappingName(const TQString &)) );
-	slotCheckNewPinMappingName( 0 );
+	slotCheckNewPinMappingName( nullptr );
 	
 	int accepted = m_pNewPinMappingDlg->exec();
 	unsigned selectedType = m_pNewPinMappingWidget->typeCombo->currentItem();
@@ -257,8 +257,8 @@ void MicroSettingsDlg::slotCreatePinMap()
 	
 	delete m_pNewPinMappingDlg;
 	delete validator;
-	m_pNewPinMappingDlg = 0l;
-	m_pNewPinMappingWidget = 0l;
+	m_pNewPinMappingDlg = nullptr;
+	m_pNewPinMappingWidget = nullptr;
 	if ( accepted != TQDialog::Accepted )
 		return;
 	
@@ -303,7 +303,7 @@ void MicroSettingsDlg::slotRenamePinMap()
 	PinMappingNameValidator * validator = new PinMappingNameValidator( this, oldName );
 	
 	bool ok = false;
-	TQString newName = KInputDialog::getText( i18n("New Pin Map Name"), i18n("Name"), oldName, & ok, this, 0, validator );
+	TQString newName = KInputDialog::getText( i18n("New Pin Map Name"), i18n("Name"), oldName, & ok, this, nullptr, validator );
 	
 	delete validator;
 	
diff --git a/src/gui/microsettingsdlg.h b/src/gui/microsettingsdlg.h
index e226f9a..92e06e9 100644
--- a/src/gui/microsettingsdlg.h
+++ b/src/gui/microsettingsdlg.h
@@ -33,7 +33,7 @@ class MicroSettingsDlg : public KDialogBase
 	TQ_OBJECT
   
 	public:
-		MicroSettingsDlg( MicroSettings *_microSettings, TQWidget *parent = 0L, const char *name = 0L );
+		MicroSettingsDlg( MicroSettings *_microSettings, TQWidget *parent = nullptr, const char *name = nullptr );
 		~MicroSettingsDlg();
 
 		void reject();
diff --git a/src/gui/orientationwidget.cpp b/src/gui/orientationwidget.cpp
index 71cfbbf..1a2e3cf 100644
--- a/src/gui/orientationwidget.cpp
+++ b/src/gui/orientationwidget.cpp
@@ -31,7 +31,7 @@ OrientationWidget::OrientationWidget(TQWidget *parent, const char *name)
 	: TQWidget(parent, name)
 {
 	TQGridLayout *layout = new TQGridLayout( this, 2, 4, 0, 4 );
-	p_activeFlowPart = 0l;
+	p_activeFlowPart = nullptr;
 	
 	for ( int row=0; row<2; ++row )
 	{
diff --git a/src/gui/orientationwidget.h b/src/gui/orientationwidget.h
index b119ffc..d5d941a 100644
--- a/src/gui/orientationwidget.h
+++ b/src/gui/orientationwidget.h
@@ -27,7 +27,7 @@ class OrientationWidget : public TQWidget
 TQ_OBJECT
   
 public:
-	OrientationWidget( TQWidget *parent = 0l, const char *name = 0l );
+	OrientationWidget( TQWidget *parent = nullptr, const char *name = nullptr );
 	~OrientationWidget();
 
 public slots:
diff --git a/src/gui/oscilloscope.cpp b/src/gui/oscilloscope.cpp
index 45042f6..ac4c67c 100644
--- a/src/gui/oscilloscope.cpp
+++ b/src/gui/oscilloscope.cpp
@@ -45,7 +45,7 @@ TQColor probeColors[9] = {
 	TQColor( 0x55, 0x12, 0x7B ),
 	TQColor( 0x7B, 0x0C, 0x82 ) };
 
-Oscilloscope * Oscilloscope::m_pSelf = 0l;
+Oscilloscope * Oscilloscope::m_pSelf = nullptr;
 
 Oscilloscope * Oscilloscope::self( KateMDI::ToolView * parent )
 {
@@ -64,7 +64,7 @@ Oscilloscope::Oscilloscope( KateMDI::ToolView * parent )
 	m_nextColor = 0;
 	m_nextId = 1;
 	m_oldestId = -1;
-	m_oldestProbe = 0l;
+	m_oldestProbe = nullptr;
 // 	b_isPaused = false;
 	m_zoomLevel = 0.5;
 	m_pSimulator = Simulator::self();
@@ -152,11 +152,11 @@ void Oscilloscope::slotZoomSliderChanged( int value )
 ProbeData * Oscilloscope::registerProbe( Probe * probe )
 {
 	if (!probe)
-		return 0l;
+		return nullptr;
 	
 	const uint id = m_nextId++;
 	
-	ProbeData * probeData = 0l;
+	ProbeData * probeData = nullptr;
 	
 	if ( dynamic_cast<LogicProbe*>(probe) )
 	{
@@ -215,7 +215,7 @@ ProbeData * Oscilloscope::probeData( int id ) const
 	if ( bit != m_probeDataMap.end() )
 		return bit.data();
 	
-	return 0l;
+	return nullptr;
 }
 
 
@@ -243,7 +243,7 @@ void Oscilloscope::getOldestProbe()
 {
 	if ( m_probeDataMap.isEmpty() )
 	{
-		m_oldestProbe = 0l;
+		m_oldestProbe = nullptr;
 		m_oldestId = -1;
 		return;
 	}
diff --git a/src/gui/oscilloscope.h b/src/gui/oscilloscope.h
index 588c776..989b1cc 100644
--- a/src/gui/oscilloscope.h
+++ b/src/gui/oscilloscope.h
@@ -78,7 +78,7 @@ class Oscilloscope : public OscilloscopeWidget
 	TQ_OBJECT
   
 	public:
-		static Oscilloscope * self( KateMDI::ToolView * parent = 0l );
+		static Oscilloscope * self( KateMDI::ToolView * parent = nullptr );
 		static TQString toolViewIdentifier() { return "Oscilloscope"; }
 		virtual ~Oscilloscope();
 		
diff --git a/src/gui/oscilloscopeview.cpp b/src/gui/oscilloscopeview.cpp
index 2852c16..5a2e10f 100644
--- a/src/gui/oscilloscopeview.cpp
+++ b/src/gui/oscilloscopeview.cpp
@@ -40,7 +40,7 @@ inline ullong min( ullong a, ullong b )
 OscilloscopeView::OscilloscopeView( TQWidget *parent, const char *name )
 	: TQFrame( parent, name, WNoAutoErase ),
 	b_needRedraw(true),
-	m_pixmap(0l),
+	m_pixmap(nullptr),
 	m_fps(10),
 	m_sliderValueAtClick(-1),
 	m_clickOffsetPos(-1),
@@ -61,7 +61,7 @@ OscilloscopeView::OscilloscopeView( TQWidget *parent, const char *name )
 OscilloscopeView::~OscilloscopeView()
 {
 	delete m_pixmap;
-	m_pixmap = 0l;
+	m_pixmap = nullptr;
 }
 
 
diff --git a/src/gui/oscilloscopeview.h b/src/gui/oscilloscopeview.h
index cf9adfe..9b82341 100644
--- a/src/gui/oscilloscopeview.h
+++ b/src/gui/oscilloscopeview.h
@@ -28,7 +28,7 @@ class OscilloscopeView : public TQFrame
 	TQ_OBJECT
   
 	public:
-		OscilloscopeView( TQWidget *parent, const char *name = 0 );
+		OscilloscopeView( TQWidget *parent, const char *name = nullptr );
 		virtual ~OscilloscopeView();
 		
 	public slots:
diff --git a/src/gui/outputmethoddlg.h b/src/gui/outputmethoddlg.h
index 1e14ffb..871407b 100644
--- a/src/gui/outputmethoddlg.h
+++ b/src/gui/outputmethoddlg.h
@@ -69,7 +69,7 @@ class OutputMethodDlg : public KDialogBase
 		 * @param inputURL Used for saving/restoring previous options the user has selected for this file; set this to null if temporary file
 		 * @param showPICSelect Whether to show the combo boxes for selecting a PIC
 		 */
-		OutputMethodDlg( const TQString & caption, const KURL & inputURL, bool showPICSelect = false, TQWidget *parent = 0, const char *name = 0);
+		OutputMethodDlg( const TQString & caption, const KURL & inputURL, bool showPICSelect = false, TQWidget *parent = nullptr, const char *name = nullptr);
 		~OutputMethodDlg();
 	
 		void setOutputExtension( const TQString & outputExtension );
diff --git a/src/gui/pieditor.cpp b/src/gui/pieditor.cpp
index ee27a14..78d576d 100644
--- a/src/gui/pieditor.cpp
+++ b/src/gui/pieditor.cpp
@@ -148,7 +148,7 @@ PIFilename::PIFilename(TQString id, Variant *data, TQWidget *parent, const char
 	TQHBoxLayout *layout = new TQHBoxLayout(this);
 	layout->setAutoAdd(true);
 	
-	m_combo = 0L;
+	m_combo = nullptr;
 	if( m_data->allowed().count() == 0 )
 	{
 		m_combo = new KComboBox(this);
diff --git a/src/gui/pieditor.h b/src/gui/pieditor.h
index f8102c3..0d1dba1 100644
--- a/src/gui/pieditor.h
+++ b/src/gui/pieditor.h
@@ -32,7 +32,7 @@ class PIEditor : public TQWidget
 	TQ_OBJECT
   
 	public:
-		PIEditor(TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PIEditor(TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PIEditor();
 		
 	public slots:
@@ -55,7 +55,7 @@ class PIBool : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIBool( TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0 );
+		PIBool( TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr );
 		~PIBool();
 		
 		void popup();
@@ -76,7 +76,7 @@ class PIColor : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIColor(TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PIColor(TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PIColor();
 		void popup();
 		
@@ -98,7 +98,7 @@ class PIDouble : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIDouble(TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PIDouble(TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PIDouble();
 		
 	protected slots:
@@ -118,7 +118,7 @@ class PIFilename : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIFilename(TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PIFilename(TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PIFilename();
 		
 	protected slots:
@@ -140,7 +140,7 @@ class PIInt : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIInt( const TQString &id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PIInt( const TQString &id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PIInt();
 	
 	protected slots:
@@ -160,7 +160,7 @@ class PILineEdit : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PILineEdit(TQString id, Variant *data, TQWidget *parent = 0, const char *name = 0);
+		PILineEdit(TQString id, Variant *data, TQWidget *parent = nullptr, const char *name = nullptr);
 		~PILineEdit();
 		
 	protected slots:
@@ -180,7 +180,7 @@ class PIStringCombo : public PIEditor
 	TQ_OBJECT
   
 	public:
-		PIStringCombo(TQString id, Variant *data, TQWidget *parent, const char *name = 0);
+		PIStringCombo(TQString id, Variant *data, TQWidget *parent, const char *name = nullptr);
 		~PIStringCombo();
 		void popup();
 		
diff --git a/src/gui/probepositioner.cpp b/src/gui/probepositioner.cpp
index 51cd6e6..a212633 100644
--- a/src/gui/probepositioner.cpp
+++ b/src/gui/probepositioner.cpp
@@ -24,11 +24,11 @@ ProbePositioner::ProbePositioner(TQWidget *parent, const char *name)
 	: TQWidget( parent, name, WNoAutoErase )
 {
 	m_probePosOffset = 0;
-	p_draggedProbe = 0l;
+	p_draggedProbe = nullptr;
 	setFixedWidth( int(probeArrowWidth) );
 	setBackgroundMode(NoBackground);
 	b_needRedraw = true;
-	m_pixmap = 0l;
+	m_pixmap = nullptr;
 }
 
 
@@ -105,7 +105,7 @@ ProbeData* ProbePositioner::probeAtPosition( const TQPoint &pos )
 			return probeData;
 	}
 	m_probePosOffset = 0;
-	return 0l;
+	return nullptr;
 }
 
 
diff --git a/src/gui/probepositioner.h b/src/gui/probepositioner.h
index 1be66dd..02fec2c 100644
--- a/src/gui/probepositioner.h
+++ b/src/gui/probepositioner.h
@@ -28,7 +28,7 @@ class ProbePositioner : public TQWidget
 	TQ_OBJECT
   
 	public:
-		ProbePositioner(TQWidget *parent = 0, const char *name = 0);
+		ProbePositioner(TQWidget *parent = nullptr, const char *name = nullptr);
 		~ProbePositioner();
 		/**
 		 * Returns the amount of space (height in pixels) that a probe output
diff --git a/src/gui/programmerdlg.h b/src/gui/programmerdlg.h
index 1f0dcb4..212b51f 100644
--- a/src/gui/programmerdlg.h
+++ b/src/gui/programmerdlg.h
@@ -32,7 +32,7 @@ class ProgrammerDlg : public KDialogBase
 		 * options (such as the program to use) will be read in from the
 		 * settings.
 		 */
-		ProgrammerDlg( const TQString & picID, TQWidget * parent = 0, const char * name = 0 );
+		ProgrammerDlg( const TQString & picID, TQWidget * parent = nullptr, const char * name = nullptr );
 		~ProgrammerDlg();
 
 		virtual void reject();
diff --git a/src/gui/projectdlgs.cpp b/src/gui/projectdlgs.cpp
index 6fec019..08c8808 100644
--- a/src/gui/projectdlgs.cpp
+++ b/src/gui/projectdlgs.cpp
@@ -159,7 +159,7 @@ LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, TQWidget *pa
 		item->setOn( linkedInternal.contains(relativeURL) );
 	}
 	
-	m_pExternalLibraryRequester = new KURLRequester( 0l );
+	m_pExternalLibraryRequester = new KURLRequester( nullptr );
 	m_pExternalLibraryRequester->fileDialog()->setURL( "/usr/share/sdcc/lib" );
 	
 	delete m_pWidget->m_pExternalLibraries;
diff --git a/src/gui/projectdlgs.h b/src/gui/projectdlgs.h
index 1d8078e..f6d18a9 100644
--- a/src/gui/projectdlgs.h
+++ b/src/gui/projectdlgs.h
@@ -75,7 +75,7 @@ class CreateSubprojectDlg : public KDialogBase
 	TQ_OBJECT
   
 	public:
-		CreateSubprojectDlg( TQWidget *parent = 0 );
+		CreateSubprojectDlg( TQWidget *parent = nullptr );
 		~CreateSubprojectDlg();
 		
 		// The following values should agree with the positions in the combo box
@@ -115,7 +115,7 @@ class LinkerOptionsDlg : public KDialogBase
 	TQ_OBJECT
   
 	public:
-		LinkerOptionsDlg( LinkerOptions * linkingOptions, TQWidget *parent = 0 );
+		LinkerOptionsDlg( LinkerOptions * linkingOptions, TQWidget *parent = nullptr );
 		virtual ~LinkerOptionsDlg();
 
 	    /**
@@ -141,7 +141,7 @@ class LinkerOptionsDlg : public KDialogBase
 class ProcessingOptionsDlg : public KDialogBase
 {
 	public:
-		ProcessingOptionsDlg( ProjectItem * projectItem, TQWidget *parent = 0 );
+		ProcessingOptionsDlg( ProjectItem * projectItem, TQWidget *parent = nullptr );
 		virtual ~ProcessingOptionsDlg();
 
 	    /**
diff --git a/src/gui/propertieslistview.cpp b/src/gui/propertieslistview.cpp
index 59813ec..d1e8b81 100644
--- a/src/gui/propertieslistview.cpp
+++ b/src/gui/propertieslistview.cpp
@@ -33,11 +33,11 @@ PropertiesListView::PropertiesListView(TQWidget *parent, const char *name)
 	setFullWidth(true);
 	setColumnAlignment(1,TQt::AlignRight);
 	
-	p_lastItem = 0l;
-	m_diffBt = 0L;
+	p_lastItem = nullptr;
+	m_diffBt = nullptr;
 	
 	connect(this,TQ_SIGNAL(selectionChanged(TQListViewItem*)),this,TQ_SLOT(slotSelectionChanged(TQListViewItem*)));
-	m_editor = 0L;
+	m_editor = nullptr;
 	connect(header(),TQ_SIGNAL(sizeChange(int,int,int)),this,TQ_SLOT(headerSizeChanged(int,int,int)));
 }
 
@@ -49,7 +49,7 @@ void PropertiesListView::slotClear()
 {
 	destroyEditor();
 	delete m_diffBt;
-	m_diffBt = 0L;
+	m_diffBt = nullptr;
 	clear();
 	m_plvItemMap.clear();
 }
@@ -262,7 +262,7 @@ void PropertiesListView::destroyEditor()
 	
 	removeChild( m_editor );
 	delete m_editor;
-	m_editor = 0L;
+	m_editor = nullptr;
 }
 
 void PropertiesListView::headerSizeChanged(int section, int /*oldSize*/, int newSize)
diff --git a/src/gui/propertieslistview.h b/src/gui/propertieslistview.h
index e7405aa..07f11b3 100644
--- a/src/gui/propertieslistview.h
+++ b/src/gui/propertieslistview.h
@@ -31,7 +31,7 @@ class PropertiesListView : public TDEListView
 TQ_OBJECT
   
 public:
-	PropertiesListView( TQWidget *parent = 0l, const char *name = 0l );
+	PropertiesListView( TQWidget *parent = nullptr, const char *name = nullptr );
 	~PropertiesListView();
 	
 public slots:
diff --git a/src/gui/settingsdlg.cpp b/src/gui/settingsdlg.cpp
index 66aa9f2..e7128eb 100644
--- a/src/gui/settingsdlg.cpp
+++ b/src/gui/settingsdlg.cpp
@@ -154,7 +154,7 @@ void SettingsDlg::slotUpdatePicProgrammerDescription()
 	edit = m_picProgrammerConfigWidget->name; \
 	edit->setText( config.name ); \
 	edit->setEnabled(customProgrammer); \
-	TQToolTip::add( edit, customProgrammer ? 0 : config.name )
+	TQToolTip::add( edit, customProgrammer ? nullptr : config.name )
 	
 	SETUP_COMMAND( initCommand );
 	SETUP_COMMAND( readCommand );
@@ -207,7 +207,7 @@ class NameValidator : public TQValidator
 {
 	public:
 		NameValidator( TQStringList unallowed )
-			: TQValidator(0) {
+			: TQValidator(nullptr) {
 			m_unallowed = unallowed;
 		}
 		
@@ -232,7 +232,7 @@ void SettingsDlg::slotAddProgrammerConfig()
 	NameValidator * nv = new NameValidator( takenNames );
 	
 	bool ok = false;
-	TQString name = KInputDialog::getText( i18n("Configuration Name"), i18n("Name"), 0, &ok, this, 0, nv );
+	TQString name = KInputDialog::getText( i18n("Configuration Name"), i18n("Name"), nullptr, &ok, this, nullptr, nv );
 	
 	delete nv;
 	
diff --git a/src/icndocument.cpp b/src/icndocument.cpp
index a623abb..f82f143 100644
--- a/src/icndocument.cpp
+++ b/src/icndocument.cpp
@@ -30,7 +30,7 @@
 
 ICNDocument::ICNDocument( const TQString &caption, KTechlab *ktechlab, const char *name )
 	: ItemDocument( caption, ktechlab, name ),
-	m_cells(0l)
+	m_cells(nullptr)
 {
 	m_canvas->retune(48);
 	m_selectList = new CNItemGroup(this);
@@ -51,7 +51,7 @@ ICNDocument::~ICNDocument()
 	TQCanvasItemList all = m_canvas->allItems();
 	const TQCanvasItemList::Iterator end = all.end();
 	for ( TQCanvasItemList::Iterator it= all.begin(); it != end; ++it )
-		(*it)->setCanvas(0l);
+		(*it)->setCanvas(nullptr);
 	
 	// Remove all items from the canvas
 	selectAll();
@@ -74,9 +74,9 @@ ICNDocument::~ICNDocument()
 		delete *it;
 
 	delete m_cells;
-	m_cells = 0l;
+	m_cells = nullptr;
 	delete m_selectList;
-	m_selectList = 0l;
+	m_selectList = nullptr;
 }
 
 
@@ -115,7 +115,7 @@ Node *ICNDocument::nodeWithID( const TQString &id )
 		if ( (*it)->id() == id )
 			return *it;
 	}
-	return 0L;
+	return nullptr;
 }
 
 
@@ -127,14 +127,14 @@ Connector *ICNDocument::connectorWithID( const TQString &id )
 		if ( (*it)->id() == id )
 			return *it;
 	}
-	return 0L;
+	return nullptr;
 }
 
 
 FlowContainer *ICNDocument::flowContainer( const TQPoint &pos )
 {
 	TQCanvasItemList collisions = m_canvas->collisions(pos);
-	FlowContainer *flowContainer = 0l;
+	FlowContainer *flowContainer = nullptr;
 	int currentLevel = -1;
 	const TQCanvasItemList::iterator end = collisions.end();
 	for ( TQCanvasItemList::iterator it = collisions.begin(); it != end; ++it )
@@ -182,8 +182,8 @@ bool ICNDocument::canConnect( TQCanvasItem *qcanvasItem1, TQCanvasItem *qcanvasI
 	
 	
 	//BEGIN Change connectors to nodes
-	Node * startNode1 = 0l;
-	Node * startNode2 = 0l;
+	Node * startNode1 = nullptr;
+	Node * startNode2 = nullptr;
 	if (startConnector)
 	{
 		startNode1 = startConnector->startNode();
@@ -195,8 +195,8 @@ bool ICNDocument::canConnect( TQCanvasItem *qcanvasItem1, TQCanvasItem *qcanvasI
 	else if (!startNode)
 		return false;
 	
-	Node * endNode1 = 0l;
-	Node * endNode2 = 0l;
+	Node * endNode1 = nullptr;
+	Node * endNode2 = nullptr;
 	if (endConnector)
 	{
 		endNode1 = endConnector->startNode();
@@ -279,13 +279,13 @@ bool ICNDocument::canConnect( TQCanvasItem *qcanvasItem1, TQCanvasItem *qcanvasI
 	//BEGIN Advanced level check
 	CNItem * startParentItem[3];
 	for ( unsigned i = 0; i < 3; i++ )
-		startParentItem[i] = start[i] ? start[i]->parentItem() : 0l;
+		startParentItem[i] = start[i] ? start[i]->parentItem() : nullptr;
 	
 	CNItem * endParentItem[3];
 	for ( unsigned i = 0; i < 3; i++ )
-		endParentItem[i] = end[i] ? end[i]->parentItem() : 0l;
+		endParentItem[i] = end[i] ? end[i]->parentItem() : nullptr;
 	
-	Item * container[6] = {0l};
+	Item * container[6] = {nullptr};
 	
 	for ( unsigned i = 0; i < 3; i++ )
 	{
@@ -334,7 +334,7 @@ bool ICNDocument::canConnect( TQCanvasItem *qcanvasItem1, TQCanvasItem *qcanvasI
 Connector * ICNDocument::createConnector( Node *startNode, Node *endNode, TQPointList *pointList )
 {
 	if ( !canConnect( startNode, endNode ) )
-		return 0l;
+		return nullptr;
 	
 	TQPointList autoPoints;
 	if (!pointList)
@@ -346,7 +346,7 @@ Connector * ICNDocument::createConnector( Node *startNode, Node *endNode, TQPoin
 		pointList = &autoPoints;
 	}
 	
-	Connector * con = 0l;
+	Connector * con = nullptr;
 	
 	// Check if we need to swap the ends around, and create the connector
 	if ( endNode->type() == Node::fp_out )
@@ -370,14 +370,14 @@ Connector * ICNDocument::createConnector( Node *startNode, Node *endNode, TQPoin
 Connector * ICNDocument::createConnector( Node *node, Connector *con, const TQPoint &pos2, TQPointList *pointList )
 {
 	if ( !canConnect( node, con ) )
-		return 0l;
+		return nullptr;
 	
 	Node *conStartNode = con->startNode();
 	Node *conEndNode = con->endNode();
 	
 	const bool usedManual = con->usesManualPoints();
 	
-	Node *newNode = 0l;
+	Node *newNode = nullptr;
 	if ( type() == Document::dt_circuit )
 		newNode = new ECNode( this, Node::ec_junction, Node::dir_right, pos2 );
 	
@@ -385,7 +385,7 @@ Connector * ICNDocument::createConnector( Node *node, Connector *con, const TQPo
 		newNode = new FPNode( this, Node::fp_junction, Node::dir_right, pos2 );
 	
 	else
-		return 0l;
+		return nullptr;
 	
 	TQPointList autoPoints;
 	if (!pointList)
@@ -434,7 +434,7 @@ Connector * ICNDocument::createConnector( Node *node, Connector *con, const TQPo
 Connector * ICNDocument::createConnector( Connector *con1, Connector *con2, const TQPoint &pos1, const TQPoint &pos2, TQPointList *pointList )
 {
 	if ( !canConnect( con1, con2 ) )
-		return 0l;
+		return nullptr;
 	
 	const bool con1UsedManual = con1->usesManualPoints();
 	const bool con2UsedManual = con2->usesManualPoints();
@@ -449,13 +449,13 @@ Connector * ICNDocument::createConnector( Connector *con1, Connector *con2, cons
 	Node *node2b = con2->endNode();
 	
 	if ( !node1a || !node1b || !node2a || !node2b )
-		return 0l;
+		return nullptr;
 	
 	con1->hide();	
 	con2->hide();
 	
 	if ( type() != Document::dt_circuit )
-		return 0l;
+		return nullptr;
 	
 	ECNode * newNode1 = new ECNode( this, Node::ec_junction, Node::dir_right, pos1 );
 	ECNode * newNode2 = new ECNode( this, Node::ec_junction, Node::dir_right, pos2 );
@@ -495,7 +495,7 @@ Connector * ICNDocument::createConnector( Connector *con1, Connector *con2, cons
 		newNode2->removeNode();
 		
 		flushDeleteList();
-		return 0l;
+		return nullptr;
 	}
 	
 	con1a->setRoutePoints( *oldCon1Points.at(0), con1UsedManual );
@@ -547,7 +547,7 @@ Connector * ICNDocument::createConnector( Connector *con1, Connector *con2, cons
 NodeGroup* ICNDocument::createNodeGroup( Node *node )
 {
 	if ( !node || node->isChildNode() ) {
-		return 0l;
+		return nullptr;
 	}
 	
 	const GuardedNodeGroupList::iterator end = m_nodeGroupList.end();
@@ -819,10 +819,10 @@ void ICNDocument::flushDeleteList()
 	for ( TQCanvasItemList::iterator it = m_itemDeleteList.begin(); it != end; ++it )
 	{
 		if ( *it && m_itemDeleteList.contains(*it) > 1 ) {
-			*it = 0l;
+			*it = nullptr;
 		}
 	}
-	m_itemDeleteList.remove(0l);
+	m_itemDeleteList.remove(nullptr);
 	
 	end = m_itemDeleteList.end();
 	for ( TQCanvasItemList::iterator it = m_itemDeleteList.begin(); it != end; ++it )
@@ -842,10 +842,10 @@ void ICNDocument::flushDeleteList()
 		else
 			kdError() << k_funcinfo << "Unknown qcanvasItem! "<<qcanvasItem << endl;
 		
-		qcanvasItem->setCanvas(0l);
+		qcanvasItem->setCanvas(nullptr);
 		
 		delete qcanvasItem;
-		*it = 0l;
+		*it = nullptr;
 	}
 	
 // 	// Check connectors for merging
@@ -1059,7 +1059,7 @@ void ICNDocument::selectAll()
 Item* ICNDocument::addItem( const TQString &id, const TQPoint &p, bool newItem )
 {
 	if ( !isValidItem(id) ) {
-		return 0l;
+		return nullptr;
 	}
 	
 	// First, we need to tell all containers to go to full bounding so that
@@ -1079,11 +1079,11 @@ Item* ICNDocument::addItem( const TQString &id, const TQPoint &p, bool newItem )
 	
 	
 	Item *item = itemLibrary()->createItem( id, this, newItem );
-	if (!item) return 0L;
+	if (!item) return nullptr;
 	
 	// Look through the CNItems at the given point (sorted by z-coordinate) for
 	// a container item.
-	FlowContainer *container = 0l;
+	FlowContainer *container = nullptr;
 	const TQCanvasItemList::iterator pcEnd = preCollisions.end();
 	for ( TQCanvasItemList::iterator it = preCollisions.begin(); it != pcEnd && !container; ++it )
 	{
@@ -1097,7 +1097,7 @@ Item* ICNDocument::addItem( const TQString &id, const TQPoint &p, bool newItem )
 	{
 		item->removeItem();
 		flushDeleteList();
-		return 0L;
+		return nullptr;
 	}
 	
 	int x = int(p.x());
@@ -1245,14 +1245,14 @@ Connector* ICNDocument::createConnector( const TQString &startNodeId, const TQSt
 	if ( !startNode || !endNode )
 	{
 		kdDebug() << "Either/both the connector start node and end node could not be found" << endl;
-		return 0L;
+		return nullptr;
 	}
 	
 	Connector *connector = endNode->createInputConnector(startNode);
 	if (!connector)
 	{
 		kdError() << k_funcinfo << "End node did not create the connector" << endl;
-		return 0l;
+		return nullptr;
 	}
 	startNode->addOutputConnector(connector);
 	flushDeleteList(); // Delete any connectors that might have been removed by the nodes
@@ -1285,7 +1285,7 @@ void ICNDocument::deleteSelection()
 	
 	// We need to emit this so that property widgets etc...
 	// can clear themselves.
-	emit itemUnselected(0L);
+	emit itemUnselected(nullptr);
 	
 	requestRerouteInvalidatedConnectors();
 	requestStateSave();
@@ -1304,7 +1304,7 @@ ConnectorList ICNDocument::getCommonConnectors( const ItemList &list )
 	{
 		Connector *con = *it;
 		if ( !con || !nodeList.contains(con->startNode()) || !nodeList.contains(con->endNode()) ) {
-			*it = 0l;
+			*it = nullptr;
 		}
 	}
 	connectorList.remove((Connector*)0l);
@@ -1353,7 +1353,7 @@ NodeList ICNDocument::getCommonNodes( const ItemList &list )
 
 
 
-DirCursor *DirCursor::m_self = 0l;
+DirCursor *DirCursor::m_self = nullptr;
 
 DirCursor::DirCursor()
 {
diff --git a/src/icndocument.h b/src/icndocument.h
index faa2ce2..fcc48a6 100644
--- a/src/icndocument.h
+++ b/src/icndocument.h
@@ -46,7 +46,7 @@ public:
 		hs_item = 1000
 	};
 
-	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 	
 	/**
 	 * Will attempt to create an item with the given id at position p. Some item
@@ -58,7 +58,7 @@ public:
 	 * Creates a connector between two nodes, and returns a pointer to it
 	 * and adds the operation to the undo list
 	 */
-	Connector* createConnector( const TQString &startNodeId, const TQString &endNodeId, TQPointList *pointList = 0L );
+	Connector* createConnector( const TQString &startNodeId, const TQString &endNodeId, TQPointList *pointList = nullptr );
 	/**
 	 * short for casting whatever itemWithID(id) returns
 	 */
@@ -136,19 +136,19 @@ public:
 	 * Creates a connector from node1 to node2. If pointList is non-null, then the
 	 * connector will be assigned those points
 	 */
-	Connector * createConnector( Node *node1, Node *node2, TQPointList *pointList = 0L );
+	Connector * createConnector( Node *node1, Node *node2, TQPointList *pointList = nullptr );
 	/**
 	 * Splits Connector con into two connectors at point pos2, and creates a connector from the node
 	 * to the intersection of the two new connectors. If pointList is non-null, then the new connector
 	 * from the node will be assigned those points
 	 */
-	Connector * createConnector( Node *node, Connector *con, const TQPoint &pos2, TQPointList *pointList = 0L );
+	Connector * createConnector( Node *node, Connector *con, const TQPoint &pos2, TQPointList *pointList = nullptr );
 	/**
 	 * Splits con1 and con2 into two new connectors each at points pos1 and pos2, and creates a new connector
 	 * between the two points of intersection given by pos1 and pos2. If pointList is non-null, then the new
 	 * connector between the two points will be assigned those points
 	 */
-	Connector * createConnector( Connector *con1, Connector *con2, const TQPoint &pos1, const TQPoint &pos2, TQPointList *pointList = 0L );
+	Connector * createConnector( Connector *con1, Connector *con2, const TQPoint &pos1, const TQPoint &pos2, TQPointList *pointList = nullptr );
 	/**
 	 * Returns the flowcontainer at the given position at the highest level that
 	 * is not in the current select list, or 0l if there isn't one
@@ -159,7 +159,7 @@ public:
 	 */
 	void setItemResizeCursor( int cornerType );
 	
-	void getTranslatable( const ItemList & itemList, ConnectorList * fixedConnectors = 0l, ConnectorList * translatableConnectors = 0l, NodeGroupList * translatableNodeGroups = 0l );
+	void getTranslatable( const ItemList & itemList, ConnectorList * fixedConnectors = nullptr, ConnectorList * translatableConnectors = nullptr, NodeGroupList * translatableNodeGroups = nullptr );
 	/**
 	 * Reroutes invalidated directors. You shouldn't call this function
 	 * directly - instead use ItemDocument::requestEvent.
diff --git a/src/icnview.cpp b/src/icnview.cpp
index 2977daa..ee3c354 100644
--- a/src/icnview.cpp
+++ b/src/icnview.cpp
@@ -40,7 +40,7 @@ ICNView::ICNView( ICNDocument *icnDocument, ViewContainer *viewContainer, uint v
 	
 	
 	// This popup gets inserted into the toolbar
-	m_pRoutingModeToolbarPopup = new TDEToolBarPopupAction( i18n("Connection Routing Mode"), "pencil", 0, 0, 0, ac, "routing_mode" );
+	m_pRoutingModeToolbarPopup = new TDEToolBarPopupAction( i18n("Connection Routing Mode"), "pencil", 0, nullptr, nullptr, ac, "routing_mode" );
 	m_pRoutingModeToolbarPopup->setDelayed(false);
 	
 	TDEPopupMenu * m = m_pRoutingModeToolbarPopup->popupMenu();
diff --git a/src/icnview.h b/src/icnview.h
index 1c4bfe4..d60029d 100644
--- a/src/icnview.h
+++ b/src/icnview.h
@@ -25,7 +25,7 @@ class ICNView : public ItemView
 	TQ_OBJECT
   
 	public:
-		ICNView( ICNDocument * icnDocument, ViewContainer *viewContainer, uint viewAreaId, const char * name = 0l );
+		ICNView( ICNDocument * icnDocument, ViewContainer *viewContainer, uint viewAreaId, const char * name = nullptr );
 		~ICNView();
 		
 	protected slots:
diff --git a/src/item.cpp b/src/item.cpp
index 320b99a..f16eef9 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -32,7 +32,7 @@ Item::Item( ItemDocument *itemDocument, bool newItem, const TQString &id )
 	m_bDynamicContent = false;
 	m_bIsRaised = false;
 	m_bDoneCreation = false;
-	p_parentItem = 0l;
+	p_parentItem = nullptr;
 	b_deleted = false;
 	p_itemDocument = itemDocument;
 	m_baseZ = -1;
@@ -72,7 +72,7 @@ void Item::removeItem()
 	b_deleted = true;
 	
 	hide();
-	setCanvas(0l);
+	setCanvas(nullptr);
 	emit removed(this);
 	p_itemDocument->appendDeleteList(this);
 }
@@ -311,7 +311,7 @@ bool Item::mouseDoubleClickEvent( const EventInfo &eventInfo )
 // 	bool ok;
 // 	TQString text = KInputDialog::getMultiLineText( v->caption(), "", v->getValue(), ok );
 
-	KDialogBase *dlg = new KDialogBase( 0l, "", true, v->editorCaption(), KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::User1, KDialogBase::Ok, false, KStdGuiItem::clear() );
+	KDialogBase *dlg = new KDialogBase( nullptr, "", true, v->editorCaption(), KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::User1, KDialogBase::Ok, false, KStdGuiItem::clear() );
 	TQFrame *frame = dlg->makeMainWidget();
 	TQVBoxLayout *layout = new TQVBoxLayout( frame, 0, dlg->spacingHint() );
 	KTextEdit *textEdit = new KTextEdit( frame );
@@ -576,7 +576,7 @@ Variant * Item::property( const TQString & id ) const
 		return m_variantData[id];
 	
 	kdError() << k_funcinfo << " No such property with id " << id << endl;
-	return 0l;
+	return nullptr;
 }
 
 
diff --git a/src/itemdocument.cpp b/src/itemdocument.cpp
index 66b6e0c..a93cf47 100644
--- a/src/itemdocument.cpp
+++ b/src/itemdocument.cpp
@@ -59,8 +59,8 @@ ItemDocument::ItemDocument( const TQString &caption, KTechlab *ktechlab, const c
 	m_queuedEvents = 0;
 	p_ktechlab = ktechlab;
 	m_nextIdNum = 1;
-	m_savedState = 0l;
-	m_currentState = 0l;
+	m_savedState = nullptr;
+	m_currentState = nullptr;
 	m_bIsLoading = false;
 	
 	m_canvas = new Canvas( this, "canvas" );
@@ -101,11 +101,11 @@ ItemDocument::~ItemDocument()
 		delete *it;
 	
 	delete m_cmManager;
-	m_cmManager = 0l;
+	m_cmManager = nullptr;
 	delete m_currentState;
-	m_currentState = 0l;
+	m_currentState = nullptr;
 	delete m_canvasTip;
-	m_canvasTip = 0l;
+	m_canvasTip = nullptr;
 }
 
 
@@ -270,7 +270,7 @@ void ItemDocument::print()
 	p.setClipRect( 0, 0, w, h, TQPainter::CoordPainter );
 	
 	// Send off the painter for drawing
-	m_canvas->setBackgroundPixmap( 0 );
+	m_canvas->setBackgroundPixmap( nullptr );
 	
 	TQRect bounding = canvasBoundingRect();
 	unsigned int rows = (unsigned) std::ceil( double( bounding.height() ) / double( h ) );
@@ -310,7 +310,7 @@ void ItemDocument::requestStateSave( int actionTicket )
 	if ( (actionTicket >= 0) && (actionTicket == m_currentActionTicket) )
 	{
 		delete m_currentState;
-		m_currentState = 0l;
+		m_currentState = nullptr;
 	}
 	
 	m_currentActionTicket = actionTicket;
@@ -350,7 +350,7 @@ void ItemDocument::clearHistory()
 	m_undoStack.clear();
 	m_redoStack.clear();
 	delete m_currentState;
-	m_currentState = 0l;
+	m_currentState = nullptr;
 	requestStateSave();
 }
 
@@ -437,7 +437,7 @@ Item *ItemDocument::itemWithID( const TQString &id )
 		if ( (*it)->id() == id )
 			return *it;
 	}
-	return 0L;
+	return nullptr;
 }
 
 
@@ -504,7 +504,7 @@ TQCanvasItem* ItemDocument::itemAtTop( const TQPoint &pos ) const
 		}
 	}
 	
-	return 0L;
+	return nullptr;
 }
 
 
@@ -869,7 +869,7 @@ void ItemDocument::exportToImage()
 		cropArea = canvasBoundingRect();
 		if ( cropArea.isNull() )
 		{  
-			KMessageBox::sorry( 0l, i18n("There is nothing to crop"), i18n("Export As Image") );
+			KMessageBox::sorry( nullptr, i18n("There is nothing to crop"), i18n("Export As Image") );
 			return;
 		}
 		else
@@ -974,7 +974,7 @@ void ItemDocument::raiseZ( const ItemList & itemList )
 	IntItemMap::iterator it = --m_zOrder.end();
 	do
 	{
-		Item * previousData = (previous == m_zOrder.end()) ? 0l : previous.data();
+		Item * previousData = (previous == m_zOrder.end()) ? nullptr : previous.data();
 		Item * currentData = it.data();
 		
 		if ( currentData && previousData && itemList.contains(currentData) && !itemList.contains(previousData) )
@@ -1280,7 +1280,7 @@ void Canvas::drawForeground ( TQPainter &p, const TQRect & clip )
 	TQSize minSize;
 	const ViewList viewList = p_itemDocument->viewList();
 	ViewList::const_iterator end = viewList.end();
-	View * firstView = 0l;
+	View * firstView = nullptr;
 	for ( ViewList::const_iterator it = viewList.begin(); it != end; ++it )
 	{
 		if ( !*it )
diff --git a/src/itemdocument.h b/src/itemdocument.h
index 1ee6a71..c02aeb0 100644
--- a/src/itemdocument.h
+++ b/src/itemdocument.h
@@ -44,7 +44,7 @@ class ItemDocument : public Document
 	TQ_OBJECT
   
 	public:
-		ItemDocument( const TQString &caption, KTechlab *ktechlab, const char *name = 0 );
+		ItemDocument( const TQString &caption, KTechlab *ktechlab, const char *name = nullptr );
 		~ItemDocument();
 
 		class Z
@@ -320,7 +320,7 @@ class ItemDocument : public Document
 		 * Enables / disables / selects various actions depending on
 		 * what is selected or not.
 		 */
-		virtual void slotInitItemActions( Item *item = 0 );
+		virtual void slotInitItemActions( Item *item = nullptr );
 		/**
 		 * Process queued events (see ItemDocument::ItemDocumentEvent).
 		 */
@@ -334,7 +334,7 @@ class ItemDocument : public Document
 		/**
 		 * Emitted when a Item is unselected
 		 */
-		void itemUnselected( Item *item = 0 );
+		void itemUnselected( Item *item = nullptr );
 		
 	protected:
 		/**
@@ -399,7 +399,7 @@ class Canvas : public TQCanvas
 	TQ_OBJECT
   
 	public:
-		Canvas( ItemDocument *itemDocument, const char * name = 0 );
+		Canvas( ItemDocument *itemDocument, const char * name = nullptr );
 		
 		/**
 		 * Sets a message to be displayed on the canvas for a brief period of
diff --git a/src/itemdocumentdata.cpp b/src/itemdocumentdata.cpp
index bc9c052..1abf7f2 100644
--- a/src/itemdocumentdata.cpp
+++ b/src/itemdocumentdata.cpp
@@ -63,7 +63,7 @@ static TQBitArray toTQBitArray( TQString text )
 	
 	for ( unsigned i = 0; i < size; ++i )
 	{
-		unsigned val = TQString(text[i]).toInt( 0l, 16 );
+		unsigned val = TQString(text[i]).toInt( nullptr, 16 );
 		for ( unsigned j = 0; j < 4; ++j )
 			data[4*i+j] = val & (1 << j);
 	}
@@ -100,11 +100,11 @@ void ItemDocumentData::reset()
 bool ItemDocumentData::loadData( const KURL &url )
 {
 	TQString target;
-	if ( !TDEIO::NetAccess::download( url, target, 0l ) )
+	if ( !TDEIO::NetAccess::download( url, target, nullptr ) )
 	{
 		// If the file could not be downloaded, for example does not
 		// exist on disk, NetAccess will tell us what error to use
-		KMessageBox::error( 0l, TDEIO::NetAccess::lastErrorString() );
+		KMessageBox::error( nullptr, TDEIO::NetAccess::lastErrorString() );
 		
 		return false;
 	}
@@ -112,7 +112,7 @@ bool ItemDocumentData::loadData( const KURL &url )
 	TQFile file(target);
 	if ( !file.open( IO_ReadOnly ) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open %1 for reading").arg(target) );
+		KMessageBox::sorry( nullptr, i18n("Could not open %1 for reading").arg(target) );
 		return false;
 	}
 	
@@ -134,7 +134,7 @@ bool ItemDocumentData::fromXML( const TQString &xml )
 	TQString errorMessage;
 	if ( !doc.setContent( xml, &errorMessage ) )
 	{
-		KMessageBox::sorry( 0l, i18n("Couldn't parse xml:\n%1").arg(errorMessage) );
+		KMessageBox::sorry( nullptr, i18n("Couldn't parse xml:\n%1").arg(errorMessage) );
 		return false;
 	}
 	
@@ -182,7 +182,7 @@ bool ItemDocumentData::saveData( const KURL &url )
 		TQFile file( url.path() );
 		if ( !file.open(IO_WriteOnly) )
 		{
-			KMessageBox::sorry( 0l, i18n("Could not open '%1' for writing. Check that you have write permissions").arg(url.path()), i18n("Saving File") );
+			KMessageBox::sorry( nullptr, i18n("Could not open '%1' for writing. Check that you have write permissions").arg(url.path()), i18n("Saving File") );
 			return false;
 		}
 		
@@ -196,9 +196,9 @@ bool ItemDocumentData::saveData( const KURL &url )
 		*file.textStream() << toXML();
 		file.close();
 		
-		if ( !TDEIO::NetAccess::upload( file.name(), url, 0l ) )
+		if ( !TDEIO::NetAccess::upload( file.name(), url, nullptr ) )
 		{
-			KMessageBox::error( 0l, TDEIO::NetAccess::lastErrorString() );
+			KMessageBox::error( nullptr, TDEIO::NetAccess::lastErrorString() );
 			return false;
 		}
 	}
@@ -367,7 +367,7 @@ void ItemDocumentData::elementToMicroData( TQDomElement element )
 						type = PinMapping::Keypad_4x4;
 					
 					PinMapping pinMapping( type );
-					pinMapping.setPins( TQStringList::split( " ", childElement.attribute( "map", 0 ) ) );
+					pinMapping.setPins( TQStringList::split( " ", childElement.attribute( "map", nullptr ) ) );
 					
 					m_microData.pinMappings[id] = pinMapping;
 				}
@@ -998,7 +998,7 @@ void ItemDocumentData::mergeWithDocument( ItemDocument *itemDocument, bool selec
 				kdWarning() << "Attempted to create invalid item with id: " << it.key() << endl;
 				item->removeItem();
 				itemDocument->flushDeleteList();
-				item = 0l;
+				item = nullptr;
 			}
 			if (item)
 			{
@@ -1032,8 +1032,8 @@ void ItemDocumentData::mergeWithDocument( ItemDocument *itemDocument, bool selec
 				continue;
 			
 			TQString id = it.key();
-			Node *startNode = 0l;
-			Node *endNode = 0l;
+			Node *startNode = nullptr;
+			Node *endNode = nullptr;
 			
 			if ( it.data().startNodeIsChild )
 			{
@@ -1309,7 +1309,7 @@ void SubcircuitData::initECSubcircuit( ECSubcircuit * ecSubcircuit )
 			component->setParentItem(ecSubcircuit);
 			component->updateConnectorPoints(false);
 			component->setVisible(false);
-			component->setCanvas(0l);
+			component->setCanvas(nullptr);
 			ecSubcircuit->connect( ecSubcircuit, TQ_SIGNAL(subcircuitDeleted()), component, TQ_SLOT(removeItem()) );
 		}
 	}
@@ -1320,7 +1320,7 @@ void SubcircuitData::initECSubcircuit( ECSubcircuit * ecSubcircuit )
 		{
 			connector->updateConnectorPoints(false);
 			connector->setVisible(false);
-			connector->setCanvas(0l);
+			connector->setCanvas(nullptr);
 			ecSubcircuit->connect( ecSubcircuit, TQ_SIGNAL(subcircuitDeleted()), connector, TQ_SLOT(removeConnector()) );
 		}
 	}
@@ -1331,7 +1331,7 @@ void SubcircuitData::initECSubcircuit( ECSubcircuit * ecSubcircuit )
 		if (node)
 		{
 			node->setVisible(false);
-			node->setCanvas(0l);
+			node->setCanvas(nullptr);
 			ecSubcircuit->connect( ecSubcircuit, TQ_SIGNAL(subcircuitDeleted()), node, TQ_SLOT(removeNode()) );
 		}
 	}
diff --git a/src/itemgroup.cpp b/src/itemgroup.cpp
index 9ff4a23..4de3c2c 100644
--- a/src/itemgroup.cpp
+++ b/src/itemgroup.cpp
@@ -20,7 +20,7 @@
 ItemGroup::ItemGroup( ItemDocument *view, const char *name )
 	: TQObject( view, name )
 {
-	m_activeItem = 0l;
+	m_activeItem = nullptr;
 	b_itemsAreSameType = true;
 	p_view = view;
 	p_icnDocument = dynamic_cast<ICNDocument*>(p_view);
@@ -63,7 +63,7 @@ ItemList ItemGroup::items( bool excludeParentedItems ) const
 		for ( ItemList::iterator it = children.begin(); it != end; ++it )
 		{
 			if ( children.contains(*it) > 1 )
-				*it = 0l;
+				*it = nullptr;
 		}
 		children.remove((Item*)0l);
 		
@@ -246,7 +246,7 @@ void ItemGroup::slotDistributeHorizontally()
 	
 	double avg_spacing = 0;
 	
-	Item * previous = 0l;
+	Item * previous = nullptr;
 	const DIMap::iterator rankedEnd = ranked.end();
 	for ( DIMap::iterator it = ranked.begin(); it != rankedEnd; ++it )
 	{
@@ -292,7 +292,7 @@ void ItemGroup::slotDistributeVertically()
 	
 	double avg_spacing = 0;
 	
-	Item * previous = 0l;
+	Item * previous = nullptr;
 	const DIMap::iterator rankedEnd = ranked.end();
 	for ( DIMap::iterator it = ranked.begin(); it != rankedEnd; ++it )
 	{
diff --git a/src/itemgroup.h b/src/itemgroup.h
index c2846c3..d22aa81 100644
--- a/src/itemgroup.h
+++ b/src/itemgroup.h
@@ -36,7 +36,7 @@ class ItemGroup : public TQObject
 TQ_OBJECT
   
 public:
-	ItemGroup( ItemDocument *view, const char *name = 0 );
+	ItemGroup( ItemDocument *view, const char *name = nullptr );
 	virtual ~ItemGroup();
 	
 	/**
diff --git a/src/iteminterface.cpp b/src/iteminterface.cpp
index 3fcac4b..13531de 100644
--- a/src/iteminterface.cpp
+++ b/src/iteminterface.cpp
@@ -32,7 +32,7 @@
 
 #include <assert.h>
 
-ItemInterface * ItemInterface::m_pSelf = 0l;
+ItemInterface * ItemInterface::m_pSelf = nullptr;
 
 ItemInterface * ItemInterface::self( KTechlab * ktechlab )
 {
@@ -49,10 +49,10 @@ ItemInterface::ItemInterface( KTechlab * ktechlab )
 	: TQObject(ktechlab),
 	p_ktechlab(ktechlab)
 {
-	m_pActiveItemEditorToolBar = 0;
-	p_cvb = 0l;
-	p_itemGroup = 0l;
-	p_lastItem = 0l;
+	m_pActiveItemEditorToolBar = nullptr;
+	p_cvb = nullptr;
+	p_itemGroup = nullptr;
+	p_lastItem = nullptr;
 	m_currentActionTicket = -1;
 	m_toolBarWidgetID = -1;
 }
@@ -78,7 +78,7 @@ void ItemInterface::slotItemDocumentChanged( ItemDocument * doc )
 		disconnect( itemDocument, TQ_SIGNAL(itemUnselected(Item*)), this, TQ_SLOT(slotUpdateItemInterface()) );
 	}
 	
-	p_itemGroup = 0l;
+	p_itemGroup = nullptr;
 	p_cvb = doc;
 	
 	slotGetActionTicket();
@@ -109,7 +109,7 @@ void ItemInterface::slotClearAll()
 	ContextHelp::self()->slotClear();
 	ItemEditor::self()->slotClear();
 	clearItemEditorToolBar();
-	p_lastItem = 0l;
+	p_lastItem = nullptr;
 }
 
 
@@ -118,7 +118,7 @@ void ItemInterface::slotMultipleSelected()
 	ContextHelp::self()->slotMultipleSelected();
 	ItemEditor::self()->slotMultipleSelected();
 	clearItemEditorToolBar();
-	p_lastItem = 0l;
+	p_lastItem = nullptr;
 }
 
 
@@ -169,7 +169,7 @@ void ItemInterface::slotUpdateItemInterface()
 
 void ItemInterface::updateItemActions()
 {
-	ItemView * itemView = ((ItemDocument*)p_cvb) ? dynamic_cast<ItemView*>(p_cvb->activeView()) : 0l;
+	ItemView * itemView = ((ItemDocument*)p_cvb) ? dynamic_cast<ItemView*>(p_cvb->activeView()) : nullptr;
 	if ( !itemView )
 		return;
 	
@@ -229,7 +229,7 @@ void ItemInterface::itemEditTBCleared()
 TQWidget * ItemInterface::configWidget()
 {
 	if ( !p_itemGroup || !p_itemGroup->activeItem() || !m_pActiveItemEditorToolBar )
-		return 0l;
+		return nullptr;
 	
 	VariantDataMap *variantMap = p_itemGroup->activeItem()->variantMap();
 	
@@ -258,7 +258,7 @@ TQWidget * ItemInterface::configWidget()
 		if ( type != Variant::Type::Bool && !toolbarCaption.isEmpty() )
 			configLayout->addWidget( new TQLabel( toolbarCaption, configWidget ) );
 		
-		TQWidget * editWidget = 0l; // Should be set to the created widget
+		TQWidget * editWidget = nullptr; // Should be set to the created widget
 		
 		switch( type )
 		{
diff --git a/src/iteminterface.h b/src/iteminterface.h
index fedb27d..76dacb3 100644
--- a/src/iteminterface.h
+++ b/src/iteminterface.h
@@ -53,7 +53,7 @@ class ItemInterface : public TQObject
   
 	public:
 		~ItemInterface();
-		static ItemInterface * self( KTechlab * ktechlab = 0l );
+		static ItemInterface * self( KTechlab * ktechlab = nullptr );
 		
 		/**
 		 * Sets the orientation of all flowparts in the group.
diff --git a/src/itemlibrary.cpp b/src/itemlibrary.cpp
index 6b215cf..288a08c 100644
--- a/src/itemlibrary.cpp
+++ b/src/itemlibrary.cpp
@@ -293,7 +293,7 @@ void ItemLibrary::addLibraryItem( LibraryItem *item )
 
 Item *ItemLibrary::createItem( const TQString &id, ItemDocument *itemDocument, bool newItem, const char *newId, bool finishCreation  )
 {
-	Item * item = 0l;
+	Item * item = nullptr;
 	if ( id.startsWith("sc/") )
 	{
 		// Is a subcircuit...
@@ -302,7 +302,7 @@ Item *ItemLibrary::createItem( const TQString &id, ItemDocument *itemDocument, b
 		if (!circuitDocument)
 		{
 			kdWarning() << "Cannot create subcircuit without a circuit document" << endl;
-			return 0l;
+			return nullptr;
 		}
 		
 		TQString temp = id;
diff --git a/src/itemlibrary.h b/src/itemlibrary.h
index 5f0e39f..9fc336f 100644
--- a/src/itemlibrary.h
+++ b/src/itemlibrary.h
@@ -49,7 +49,7 @@ public:
 	/**
 	 * Creates a new item with the given id, and returns a pointer to it
 	 */
-	Item *createItem( const TQString &id, ItemDocument *itemDocument, bool newItem, const char *newId = 0L, bool finishCreation = true );
+	Item *createItem( const TQString &id, ItemDocument *itemDocument, bool newItem, const char *newId = nullptr, bool finishCreation = true );
 	/**
 	 * Returns an image of the given cnitem. As TQPixmap::convertToImage is
 	 * a *very* slow function, this will cache the result and return that for
diff --git a/src/itemview.cpp b/src/itemview.cpp
index 5b84954..4d4875b 100644
--- a/src/itemview.cpp
+++ b/src/itemview.cpp
@@ -48,18 +48,18 @@ ItemView::ItemView( ItemDocument * itemDocument, ViewContainer *viewContainer, u
 	pAccel->readSettings();
 
 	new TDEAction( i18n("Delete"), "edit-delete", TQt::Key_Delete, itemDocument, TQ_SLOT(deleteSelection()), ac, "edit_delete" );
-	new TDEAction( i18n("Export as Image..."), 0, 0, itemDocument, TQ_SLOT(exportToImage()), ac, "file_export_image");
+	new TDEAction( i18n("Export as Image..."), nullptr, 0, itemDocument, TQ_SLOT(exportToImage()), ac, "file_export_image");
 
 	//BEGIN Item Alignment actions
-	new TDEAction( i18n("Align Horizontally"), 0, 0, itemDocument, TQ_SLOT(alignHorizontally()), ac, "align_horizontally" );
-	new TDEAction( i18n("Align Vertically"), 0, 0, itemDocument, TQ_SLOT(alignVertically()), ac, "align_vertically" );
-	new TDEAction( i18n("Distribute Horizontally"), 0, 0, itemDocument, TQ_SLOT(distributeHorizontally()), ac, "distribute_horizontally" );
-	new TDEAction( i18n("Distribute Vertically"), 0, 0, itemDocument, TQ_SLOT(distributeVertically()), ac, "distribute_vertically" );
+	new TDEAction( i18n("Align Horizontally"), nullptr, 0, itemDocument, TQ_SLOT(alignHorizontally()), ac, "align_horizontally" );
+	new TDEAction( i18n("Align Vertically"), nullptr, 0, itemDocument, TQ_SLOT(alignVertically()), ac, "align_vertically" );
+	new TDEAction( i18n("Distribute Horizontally"), nullptr, 0, itemDocument, TQ_SLOT(distributeHorizontally()), ac, "distribute_horizontally" );
+	new TDEAction( i18n("Distribute Vertically"), nullptr, 0, itemDocument, TQ_SLOT(distributeVertically()), ac, "distribute_vertically" );
 	//END Item Alignment actions
 
 
 	//BEGIN Draw actions
-	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Draw"), "paintbrush", 0, 0, 0, ac, "edit_draw" );
+	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Draw"), "paintbrush", 0, nullptr, nullptr, ac, "edit_draw" );
 	pa->setDelayed(false);
 
 	TDEPopupMenu * m = pa->popupMenu();
@@ -80,7 +80,7 @@ ItemView::ItemView( ItemDocument * itemDocument, ViewContainer *viewContainer, u
 	//END Item Control actions
 
 
-	TDEAction * na = new TDEAction( "", 0, 0, 0, 0, ac, "null_action" );
+	TDEAction * na = new TDEAction( "", nullptr, 0, nullptr, nullptr, ac, "null_action" );
 	na->setEnabled(false);
 
 	setXMLFile( "ktechlabitemviewui.rc" );
diff --git a/src/itemview.h b/src/itemview.h
index cd70f66..1c0077e 100644
--- a/src/itemview.h
+++ b/src/itemview.h
@@ -28,7 +28,7 @@ class ItemView : public View
 	TQ_OBJECT
   
 	public:
-		ItemView( ItemDocument *itemDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0 );
+		ItemView( ItemDocument *itemDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 		~ItemView();
 
 		virtual bool canZoomIn() const;
diff --git a/src/katemdi.cpp b/src/katemdi.cpp
index c027fe6..9cfeff3 100644
--- a/src/katemdi.cpp
+++ b/src/katemdi.cpp
@@ -108,7 +108,7 @@ GUIClient::GUIClient ( MainWindow *mw )
   connect( m_mw->guiFactory(), TQ_SIGNAL( clientAdded( KXMLGUIClient * ) ),
            this, TQ_SLOT( clientAdded( KXMLGUIClient * ) ) );
 
-  if (actionCollection()->tdeaccel()==0)
+  if (!actionCollection()->tdeaccel())
     actionCollection()->setWidget(m_mw);
 
 
@@ -195,8 +195,8 @@ void ToolView::childEvent ( TQChildEvent *ev )
 Sidebar::Sidebar (KMultiTabBar::KMultiTabBarPosition pos, MainWindow *mainwin, TQWidget *parent)
   : KMultiTabBar ((pos == KMultiTabBar::Top || pos == KMultiTabBar::Bottom) ? KMultiTabBar::Horizontal : KMultiTabBar::Vertical, parent)
   , m_mainWin (mainwin)
-  , m_splitter (0)
-  , m_ownSplit (0)
+  , m_splitter (nullptr)
+  , m_ownSplit (nullptr)
   , m_lastSize (0)
 {
   setSidebarPosition( pos );
@@ -590,7 +590,7 @@ void Sidebar::saveSession (TDEConfig *config)
 
 MainWindow::MainWindow (TQWidget* parentWidget, const char* name)
  : KParts::MainWindow( parentWidget, name)
- , m_restoreConfig (0)
+ , m_restoreConfig (nullptr)
  , m_guiClient (new GUIClient (this))
 {
   // init the internal widgets
@@ -645,7 +645,7 @@ TQWidget *MainWindow::centralWidget () const
 ToolView *MainWindow::createToolView (const TQString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const TQPixmap &icon, const TQString &text)
 {
   if (m_idToWidget[identifier])
-    return 0;
+    return nullptr;
 
   // try the restore config to figure out real pos
   if (m_restoreConfig && m_restoreConfig->hasGroup (m_restoreGroup))
@@ -654,7 +654,7 @@ ToolView *MainWindow::createToolView (const TQString &identifier, KMultiTabBar::
     pos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (TQString ("Kate-MDI-ToolView-%1-Position").arg(identifier), pos);
   }
 
-  ToolView *v  = m_sidebars[pos]->addWidget (icon, text, 0);
+  ToolView *v  = m_sidebars[pos]->addWidget (icon, text, nullptr);
   v->id = identifier;
 
   m_idToWidget.insert (identifier, v);
@@ -818,7 +818,7 @@ void MainWindow::finishRestore ()
   }
 
   // clear this stuff, we are done ;)
-  m_restoreConfig = 0;
+  m_restoreConfig = nullptr;
   m_restoreGroup = "";
 }
 
diff --git a/src/katemdi.h b/src/katemdi.h
index c9cf0d6..3ed03ea 100644
--- a/src/katemdi.h
+++ b/src/katemdi.h
@@ -39,7 +39,7 @@ class Splitter : public TQSplitter
   
 
   public:
-    Splitter(TQt::Orientation o, TQWidget* parent=0, const char* name=0);
+    Splitter(TQt::Orientation o, TQWidget* parent=nullptr, const char* name=nullptr);
     ~Splitter();
 
     /** Since there is supposed to be only 2 childs of a katesplitter,
@@ -60,7 +60,7 @@ class ToggleToolViewAction : public TDEToggleAction
 
   public:
     ToggleToolViewAction ( const TQString& text, const TDEShortcut& cut,
-                           class ToolView *tv, TQObject* parent = 0, const char* name = 0 );
+                           class ToolView *tv, TQObject* parent = nullptr, const char* name = nullptr );
 
     virtual ~ToggleToolViewAction();
 
@@ -256,7 +256,7 @@ class MainWindow : public KParts::MainWindow
     /**
      * Constructor
      */
-    MainWindow (TQWidget* parentWidget = 0, const char* name = 0);
+    MainWindow (TQWidget* parentWidget = nullptr, const char* name = nullptr);
 
     /**
      * Destructor
diff --git a/src/ktechlab.cpp b/src/ktechlab.cpp
index 243fb1c..c73b2c1 100644
--- a/src/ktechlab.cpp
+++ b/src/ktechlab.cpp
@@ -59,17 +59,17 @@
 #include <twin.h>
 
 KTechlab::KTechlab()
-	: KateMDI::MainWindow( 0, "KTechlab" )
+	: KateMDI::MainWindow( nullptr, "KTechlab" )
 {
 	TQTime ct;
 	ct.start();
 	
 	m_bIsShown = false;
-	m_pContainerDropSource = 0l;
-	m_pContainerDropReceived = 0l;
-	m_pContextMenuContainer = 0l;
-	m_pFocusedContainer = 0l;
-	m_pToolBarOverlayLabel = 0l;
+	m_pContainerDropSource = nullptr;
+	m_pContainerDropReceived = nullptr;
+	m_pContextMenuContainer = nullptr;
+	m_pFocusedContainer = nullptr;
+	m_pToolBarOverlayLabel = nullptr;
 	
 	m_pUpdateCaptionsTimer = new TQTimer( this );
 	connect( m_pUpdateCaptionsTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotUpdateCaptions()) );
@@ -158,7 +158,7 @@ void KTechlab::setupToolDocks()
 	
 	TQPixmap pm;
 	TDEIconLoader * loader = TDEGlobal::iconLoader();
-	KateMDI::ToolView * tv = 0l;
+	KateMDI::ToolView * tv = nullptr;
 	
 	tv = createToolView( ProjectManager::toolViewIdentifier(),
 						 KMultiTabBar::Left,
@@ -254,7 +254,7 @@ void KTechlab::overlayToolBarScreenshot()
 {
 	if ( !m_pToolBarOverlayLabel )
 	{
-		m_pToolBarOverlayLabel = new TQLabel( 0, 0, WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WNoAutoErase | WType_Popup  );
+		m_pToolBarOverlayLabel = new TQLabel( nullptr, nullptr, WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WNoAutoErase | WType_Popup  );
 		m_pToolBarOverlayLabel->hide();
 		m_pToolBarOverlayLabel->setBackgroundMode( NoBackground );
 	}
@@ -403,7 +403,7 @@ void KTechlab::slotUpdateTabWidget()
 		button->setHidden( noWindows );
 	
 	if ( noWindows )
-		setCaption( 0 );
+		setCaption( nullptr );
 }
 
 
@@ -452,7 +452,7 @@ void KTechlab::setupActions()
 // 	m_recentProjects = new TDERecentFilesAction( i18n("Open &Recent Project..."), 0, ProjectManager::self(), TQ_SLOT(slotOpenProject(const KURL&)), ac, "project_open_recent" );
 	m_recentProjects = new RecentFilesAction( "Recent Projects", i18n("Open &Recent Project..."), ProjectManager::self(), TQ_SLOT(slotOpenProject(const KURL&)), ac, "project_open_recent" );
 	new TDEAction( i18n("Export to Makefile..."), "fileexport",	0, pm, TQ_SLOT(slotExportToMakefile()),		ac, "project_export_makefile" );
-	new TDEAction( i18n("Create Subproject..."), 0,				0, pm, TQ_SLOT(slotCreateSubproject()),		ac, "project_create_subproject" );
+	new TDEAction( i18n("Create Subproject..."), nullptr,				0, pm, TQ_SLOT(slotCreateSubproject()),		ac, "project_create_subproject" );
 	new TDEAction( i18n("Add Existing File..."), "document-open",		0, pm, TQ_SLOT(slotAddFile()),					ac, "project_add_existing_file" );
 	new TDEAction( i18n("Add Current File..."), "fileimport",		0, pm, TQ_SLOT(slotAddCurrentFile()),			ac, "project_add_current_file" );
 // 	new TDEAction( i18n("Project Options"), "configure",			0, pm, TQ_SLOT(slotProjectOptions()),			ac, "project_options" );
@@ -469,10 +469,10 @@ void KTechlab::setupActions()
 	new TDEAction( i18n("Split View Left/Right"), "view_right", TQt::CTRL|TQt::SHIFT|TQt::Key_L, this, TQ_SLOT(slotViewSplitLeftRight()), ac, "view_split_leftright" );
 	new TDEAction( i18n("Split View Top/Bottom"), "view_bottom", TQt::CTRL|TQt::SHIFT|TQt::Key_T, this, TQ_SLOT(slotViewSplitTopBottom()), ac, "view_split_topbottom" );
 	
-	TDEToggleAction * ta = new TDEToggleAction( i18n("Run Simulation"), "media-playback-start", TQt::Key_F10, 0, 0, ac, "simulation_run" );
+	TDEToggleAction * ta = new TDEToggleAction( i18n("Run Simulation"), "media-playback-start", TQt::Key_F10, nullptr, nullptr, ac, "simulation_run" );
 	ta->setChecked(true);
 	connect( ta, TQ_SIGNAL(toggled(bool )), Simulator::self(), TQ_SLOT(slotSetSimulating(bool )) );
-	ta->setCheckedState( KGuiItem( i18n("Pause Simulation"), "media-playback-pause", 0 ) );
+	ta->setCheckedState( KGuiItem( i18n("Pause Simulation"), "media-playback-pause", nullptr ) );
 	
 	// We can call slotCloseProject now that the actions have been created
 	ProjectManager::self(this)->updateActions();
@@ -798,7 +798,7 @@ void KTechlab::slotTabContext( TQWidget* widget,const TQPoint & pos )
 	tabMenu->insertTitle( (dynamic_cast<ViewContainer*>(widget))->caption() );
 
 	//Find the document on whose tab the user clicked
-	m_pContextMenuContainer = 0l;
+	m_pContextMenuContainer = nullptr;
 	
 	m_viewContainerList.remove((ViewContainer*)0l);
 	
@@ -812,7 +812,7 @@ void KTechlab::slotTabContext( TQWidget* widget,const TQPoint & pos )
 			
 			tabMenu->insertItem( i18n("Close"), 0 );
 			
-			View *view = (viewContainer->viewCount() == 1) ? viewContainer->activeView() : 0l;
+			View *view = (viewContainer->viewCount() == 1) ? viewContainer->activeView() : nullptr;
 			
 			if ( view && view->document()->isModified() )
 				tabMenu->insertItem( i18n("Save"), 1 );
@@ -933,7 +933,7 @@ void KTechlab::slotFileNew()
 	if (!accepted)
 		return;
 	
-	Document *created = 0l;
+	Document *created = nullptr;
 	
 	if ( finalType == Document::dt_circuit )
 		created = DocManager::self()->createCircuitDocument();
@@ -994,7 +994,7 @@ KURL::List KTechlab::getFileURLs()
 			"*.flowcode|FlowCode (*.flowcode)\n"
 			"*.basic *.microbe|Microbe (*.microbe, *.basic)\n"
 			"*.mechanics|Mechanics (*.mechanics)\n",
-			0L,
+			nullptr,
 			i18n("Open Location") );
 }
 
@@ -1148,7 +1148,7 @@ void KTechlab::slotFileQuit()
 	TDEMainWindow* w;
 	if(memberList)
 	{
-		for( w=memberList->first(); w!=0; w=memberList->next() )
+		for( w=memberList->first(); w; w=memberList->next() )
 		{
 			// only close the window if the closeEvent is accepted. If the user presses Cancel on the saveModified() dialog,
 			// the window and the application stay open.
diff --git a/src/languages/asmparser.h b/src/languages/asmparser.h
index e0c1e2c..9f6a05e 100644
--- a/src/languages/asmparser.h
+++ b/src/languages/asmparser.h
@@ -35,7 +35,7 @@ class AsmParser
 		 * from the assembly file (such as those beginning with ";#CSRC" will be
 		 * passed to hllDebugger).
 		 */
-		bool parse( GpsimDebugger * debugger = 0l );
+		bool parse( GpsimDebugger * debugger = nullptr );
 		/**
 		 * Returns the PIC ID
 		 */
diff --git a/src/languages/externallanguage.cpp b/src/languages/externallanguage.cpp
index cda47ee..ab57693 100644
--- a/src/languages/externallanguage.cpp
+++ b/src/languages/externallanguage.cpp
@@ -20,7 +20,7 @@
 ExternalLanguage::ExternalLanguage( ProcessChain *processChain, KTechlab *parent, const TQString &name )
  : Language( processChain, parent, name )
 {
-	m_languageProcess = 0l;
+	m_languageProcess = nullptr;
 }
 
 
@@ -42,7 +42,7 @@ void ExternalLanguage::deleteLanguageProcess()
 	m_languageProcess->kill();
 	m_languageProcess->deleteLater();
 	
-	m_languageProcess = 0L;
+	m_languageProcess = nullptr;
 }
 
 
diff --git a/src/languages/flowcode.cpp b/src/languages/flowcode.cpp
index 16d8358..01ce9bb 100644
--- a/src/languages/flowcode.cpp
+++ b/src/languages/flowcode.cpp
@@ -27,7 +27,7 @@ FlowCode::FlowCode( ProcessChain *processChain, KTechlab *parent )
 {
 	m_successfulMessage = i18n("*** Microbe generation successful ***");
 	m_failedMessage = i18n("*** Microbe generation failed ***");
-	p_startPart = 0l;
+	p_startPart = nullptr;
 }
 
 FlowCode::~FlowCode()
@@ -41,7 +41,7 @@ void FlowCode::processInput( ProcessOptions options )
 	
 	if ( !options.p_flowCodeDocument )
 	{
-		options.p_flowCodeDocument = new FlowCodeDocument( TQString(), 0l );
+		options.p_flowCodeDocument = new FlowCodeDocument( TQString(), nullptr );
 		options.p_flowCodeDocument->openURL( options.inputFiles().first() );
 		
 		connect( this, TQ_SIGNAL(processSucceeded( Language *)), options.p_flowCodeDocument, TQ_SLOT(deleteLater()) );
@@ -192,7 +192,7 @@ TQString FlowCode::generateMicrobe( const ItemList &itemList, MicroSettings *set
 	if (!foundStart)
 	{
 		outputError( i18n("KTechlab was unable to find the \"Start\" part.\nThis must be included as the starting point for your program.") );
-		return 0;
+		return nullptr;
 	}
 	
 	m_addedParts.clear();
diff --git a/src/languages/language.cpp b/src/languages/language.cpp
index 5503d12..9a8be49 100644
--- a/src/languages/language.cpp
+++ b/src/languages/language.cpp
@@ -134,7 +134,7 @@ ProcessOptionsSpecial::ProcessOptionsSpecial()
 	b_forceList = true;
 	b_addToProject = ProjectManager::self()->currentProject();
 	
-	p_flowCodeDocument = 0l;
+	p_flowCodeDocument = nullptr;
 	
 	switch ( KTLConfig::hexFormat() )
 	{
@@ -165,7 +165,7 @@ ProcessOptions::ProcessOptions()
 	m_pHelper = new ProcessOptionsHelper;
 	
 	b_targetFileSet = false;
-	m_pTextOutputTarget = 0l;
+	m_pTextOutputTarget = nullptr;
 }
 
 
@@ -178,11 +178,11 @@ ProcessOptions::ProcessOptions( OutputMethodInfo info )
 	b_targetFileSet = false;
 	
 	TQString target;
-	if ( !TDEIO::NetAccess::download( info.outputFile(), target, 0l ) )
+	if ( !TDEIO::NetAccess::download( info.outputFile(), target, nullptr ) )
 	{
 		// If the file could not be downloaded, for example does not
 		// exist on disk, NetAccess will tell us what error to use
-		KMessageBox::error( 0l, TDEIO::NetAccess::lastErrorString() );
+		KMessageBox::error( nullptr, TDEIO::NetAccess::lastErrorString() );
 		
 		return;
 	}
diff --git a/src/languages/languagemanager.cpp b/src/languages/languagemanager.cpp
index a71ca5a..0883d73 100644
--- a/src/languages/languagemanager.cpp
+++ b/src/languages/languagemanager.cpp
@@ -30,7 +30,7 @@
 #include <assert.h>
 
 
-LanguageManager * LanguageManager::m_pSelf = 0l;
+LanguageManager * LanguageManager::m_pSelf = nullptr;
 
 
 LanguageManager * LanguageManager::self( KateMDI::ToolView * parent, KTechlab * ktl )
diff --git a/src/languages/languagemanager.h b/src/languages/languagemanager.h
index bf5d488..929ce22 100644
--- a/src/languages/languagemanager.h
+++ b/src/languages/languagemanager.h
@@ -38,7 +38,7 @@ class LanguageManager : public TQObject
 	TQ_OBJECT
   
 	public:
-		static LanguageManager * self( KateMDI::ToolView * parent = 0l, KTechlab * ktl = 0l );
+		static LanguageManager * self( KateMDI::ToolView * parent = nullptr, KTechlab * ktl = nullptr );
 		static TQString toolViewIdentifier() { return "LanguageManager"; }
 		~LanguageManager();
 	
diff --git a/src/languages/processchain.cpp b/src/languages/processchain.cpp
index a0d8e40..0d0d98d 100644
--- a/src/languages/processchain.cpp
+++ b/src/languages/processchain.cpp
@@ -40,14 +40,14 @@ ProcessChain::ProcessChain( ProcessOptions options, KTechlab * ktechlab, const c
 	: TQObject( (TQObject*)ktechlab, name)
 {
 	m_pKTechlab = ktechlab;
-	m_pFlowCode = 0l;
-	m_pGpasm = 0l;
-	m_pGpdasm = 0l;
-	m_pGplib = 0l;
-	m_pGplink = 0l;
-	m_pMicrobe = 0l;
-	m_pPicProgrammer = 0l;
-	m_pSDCC = 0l;
+	m_pFlowCode = nullptr;
+	m_pGpasm = nullptr;
+	m_pGpdasm = nullptr;
+	m_pGplib = nullptr;
+	m_pGplink = nullptr;
+	m_pMicrobe = nullptr;
+	m_pPicProgrammer = nullptr;
+	m_pSDCC = nullptr;
 	m_processOptions = options;
 	
 	TQString target;
@@ -64,21 +64,21 @@ ProcessChain::ProcessChain( ProcessOptions options, KTechlab * ktechlab, const c
 ProcessChain::~ProcessChain()
 {
 	delete m_pFlowCode;
-	m_pFlowCode = 0l;
+	m_pFlowCode = nullptr;
 	delete m_pGpasm;
-	m_pGpasm = 0l;
+	m_pGpasm = nullptr;
 	delete m_pGpdasm;
-	m_pGpdasm = 0l;
+	m_pGpdasm = nullptr;
 	delete m_pGplib;
-	m_pGplib = 0l;
+	m_pGplib = nullptr;
 	delete m_pGplink;
-	m_pGplink = 0l;
+	m_pGplink = nullptr;
 	delete m_pMicrobe;
-	m_pMicrobe = 0l;
+	m_pMicrobe = nullptr;
 	delete m_pPicProgrammer;
-	m_pPicProgrammer = 0l;
+	m_pPicProgrammer = nullptr;
 	delete m_pSDCC;
-	m_pSDCC = 0l;
+	m_pSDCC = nullptr;
 }
 
 
@@ -149,12 +149,12 @@ void ProcessChain::slotFinishedCompile(Language *language)
 	
 	ProcessOptions::ProcessPath::MediaType typeTo = ProcessOptions::ProcessPath::to( m_processOptions.processPath() );
 	
-	TextDocument * editor = 0l;
+	TextDocument * editor = nullptr;
 	if ( KTLConfig::reuseSameViewForOutput() )
 	{
 		editor = options.textOutputTarget();
 		if ( editor && (!editor->url().isEmpty() || editor->isModified()) )
-			editor = 0l;
+			editor = nullptr;
 	}
 	
 	switch (typeTo)
@@ -183,7 +183,7 @@ void ProcessChain::slotFinishedCompile(Language *language)
 					if ( !f.open( IO_ReadOnly ) )
 					{
 						editor->deleteLater();
-						editor = 0l;
+						editor = nullptr;
 						break;
 					}
 				
diff --git a/src/languages/processchain.h b/src/languages/processchain.h
index 5ca466a..8432035 100644
--- a/src/languages/processchain.h
+++ b/src/languages/processchain.h
@@ -37,7 +37,7 @@ class ProcessChain : public TQObject
 	TQ_OBJECT
   
 	public:
-		ProcessChain( ProcessOptions options, KTechlab *parent, const char *name = 0l );
+		ProcessChain( ProcessOptions options, KTechlab *parent, const char *name = nullptr );
 		~ProcessChain();
 		
 		void setProcessOptions( ProcessOptions options ) { m_processOptions = options; }
@@ -105,7 +105,7 @@ class ProcessListChain : public TQObject
   
 			
 	public:
-		ProcessListChain( ProcessOptionsList pol, KTechlab *parent, const char *name = 0l );
+		ProcessListChain( ProcessOptionsList pol, KTechlab *parent, const char *name = nullptr );
 		
 	signals:
 		/**
diff --git a/src/mechanics/chassiscircular2.h b/src/mechanics/chassiscircular2.h
index d0752b7..195f25f 100644
--- a/src/mechanics/chassiscircular2.h
+++ b/src/mechanics/chassiscircular2.h
@@ -20,7 +20,7 @@
 class ChassisCircular2 : public MechanicsItem
 {
 public:
-	ChassisCircular2( MechanicsDocument *mechanicsDocument, bool newItem, const char *id = 0l );
+	ChassisCircular2( MechanicsDocument *mechanicsDocument, bool newItem, const char *id = nullptr );
 	~ChassisCircular2();
 	
 	static Item* construct( ItemDocument *itemDocument, bool newItem, const char *id );
diff --git a/src/mechanics/mechanicsdocument.cpp b/src/mechanics/mechanicsdocument.cpp
index b261970..ab9aa54 100644
--- a/src/mechanics/mechanicsdocument.cpp
+++ b/src/mechanics/mechanicsdocument.cpp
@@ -82,11 +82,11 @@ bool MechanicsDocument::isValidItem( Item *item )
 Item* MechanicsDocument::addItem( const TQString &id, const TQPoint &p, bool newItem )
 {
 	if ( !isValidItem(id) )
-		return 0l;
+		return nullptr;
 	
 	Item *item = itemLibrary()->createItem( id, this, newItem );
 	if (!item)
-		return 0L;
+		return nullptr;
 	
 	TQRect rect = item->boundingRect();
 	
@@ -125,7 +125,7 @@ void MechanicsDocument::deleteSelection()
 	
 	// We need to emit this so that property widgets etc...
 	// can clear themselves.
-	emit itemUnselected(0L);
+	emit itemUnselected(nullptr);
 	requestStateSave();
 }
 
@@ -160,15 +160,15 @@ void MechanicsDocument::flushDeleteList()
 	for ( ItemList::iterator it = m_itemDeleteList.begin(); it != end; ++it )
 	{
 		if ( *it && m_itemDeleteList.contains(*it) > 1 )
-			*it = 0l;
+			*it = nullptr;
 	}
-	m_itemDeleteList.remove(TQGuardedPtr<Item>(0l));
+	m_itemDeleteList.remove(TQGuardedPtr<Item>(nullptr));
 	
 	end = m_itemDeleteList.end();
 	for ( ItemList::iterator it = m_itemDeleteList.begin(); it != end; ++it )
 	{
 		m_itemList.remove(*it);
-		(*it)->setCanvas(0l);
+		(*it)->setCanvas(nullptr);
 		delete *it;
 	}
 }
diff --git a/src/mechanics/mechanicsdocument.h b/src/mechanics/mechanicsdocument.h
index 4058b18..32eaaec 100644
--- a/src/mechanics/mechanicsdocument.h
+++ b/src/mechanics/mechanicsdocument.h
@@ -29,10 +29,10 @@ class MechanicsDocument : public ItemDocument
 TQ_OBJECT
   
 public:
-	MechanicsDocument( const TQString &caption, KTechlab *ktechlab, const char *name = 0 );
+	MechanicsDocument( const TQString &caption, KTechlab *ktechlab, const char *name = nullptr );
 	~MechanicsDocument();
 	
-	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 	
 	virtual bool isValidItem( const TQString &itemId );
 	virtual bool isValidItem( Item *item );
diff --git a/src/mechanics/mechanicsgroup.h b/src/mechanics/mechanicsgroup.h
index a3433a8..c160ae7 100644
--- a/src/mechanics/mechanicsgroup.h
+++ b/src/mechanics/mechanicsgroup.h
@@ -26,7 +26,7 @@ class MechanicsGroup : public ItemGroup
 TQ_OBJECT
   
 public:
-	MechanicsGroup( MechanicsDocument *mechanicsDocument, const char *name = 0);
+	MechanicsGroup( MechanicsDocument *mechanicsDocument, const char *name = nullptr);
 	~MechanicsGroup();
 	
 	/**
diff --git a/src/mechanics/mechanicssimulation.cpp b/src/mechanics/mechanicssimulation.cpp
index c657c77..015783f 100644
--- a/src/mechanics/mechanicssimulation.cpp
+++ b/src/mechanics/mechanicssimulation.cpp
@@ -40,7 +40,7 @@ void MechanicsSimulation::slotAdvance()
 RigidBody::RigidBody( MechanicsDocument *mechanicsDocument )
 {
 	p_mechanicsDocument = mechanicsDocument;
-	p_overallParent = 0l;
+	p_overallParent = nullptr;
 }
 
 
@@ -76,11 +76,11 @@ void RigidBody::rotateBy( double dtheta )
 
 bool RigidBody::findOverallParent()
 {
-	p_overallParent = 0l;
+	p_overallParent = nullptr;
 	if ( m_mechanicsItemList.isEmpty() )
 		return false;
 	
-	m_mechanicsItemList.remove(0l);
+	m_mechanicsItemList.remove(nullptr);
 	
 	const MechanicsItemList::iterator end = m_mechanicsItemList.end();
 	for ( MechanicsItemList::iterator it = m_mechanicsItemList.begin(); it != end; ++it )
@@ -100,7 +100,7 @@ bool RigidBody::findOverallParent()
 		
 		if ( p_overallParent != parentItem )
 		{
-			p_overallParent = 0l;
+			p_overallParent = nullptr;
 			return false;
 		}
 	}
diff --git a/src/mechanics/mechanicsview.cpp b/src/mechanics/mechanicsview.cpp
index 2694b17..02e829e 100644
--- a/src/mechanics/mechanicsview.cpp
+++ b/src/mechanics/mechanicsview.cpp
@@ -24,7 +24,7 @@ MechanicsView::MechanicsView( MechanicsDocument *mechanicsDocument, ViewContaine
 MechanicsView::~MechanicsView()
 {
 	delete m_pViewIface;
-	m_pViewIface = 0l;
+	m_pViewIface = nullptr;
 }
 
 
diff --git a/src/mechanics/mechanicsview.h b/src/mechanics/mechanicsview.h
index 3473591..5f3a942 100644
--- a/src/mechanics/mechanicsview.h
+++ b/src/mechanics/mechanicsview.h
@@ -23,7 +23,7 @@ class MechanicsView : public ItemView
 	TQ_OBJECT
   
 	public:
-		MechanicsView( MechanicsDocument *mechanicsDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+		MechanicsView( MechanicsDocument *mechanicsDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 		~MechanicsView();
 	
 	protected:
diff --git a/src/micro/microinfo.cpp b/src/micro/microinfo.cpp
index febf2af..ddeb91e 100644
--- a/src/micro/microinfo.cpp
+++ b/src/micro/microinfo.cpp
@@ -13,13 +13,13 @@
 
 MicroInfo::MicroInfo()
 {
-	m_package = 0L;
+	m_package = nullptr;
 }
 
 MicroInfo::~MicroInfo()
 {
 	delete m_package;
-	m_package = 0L;
+	m_package = nullptr;
 }
 
 #if 0
diff --git a/src/micro/microlibrary.cpp b/src/micro/microlibrary.cpp
index 2c0a4f0..d720a02 100644
--- a/src/micro/microlibrary.cpp
+++ b/src/micro/microlibrary.cpp
@@ -20,7 +20,7 @@
 
 #include "micropackage.h"
 
-MicroLibrary * MicroLibrary::m_pSelf = 0l;
+MicroLibrary * MicroLibrary::m_pSelf = nullptr;
 static KStaticDeleter<MicroLibrary> staticMicroLibraryDeleter;
 
 MicroLibrary * MicroLibrary::self()
@@ -75,7 +75,7 @@ MicroLibrary::~MicroLibrary()
 	for ( MicroInfoList::iterator it = m_microInfoList.begin(); it != end; ++it )
 	{
 		delete *it;
-		*it = 0l;
+		*it = nullptr;
 	}
 }
 
@@ -88,7 +88,7 @@ MicroInfo * const MicroLibrary::microInfoWithID( TQString id )
 		if ( (*it)->id() == id ) return *it;
 	}
 	
-	return 0L;
+	return nullptr;
 }
 
 void MicroLibrary::addMicroInfo( MicroInfo *microInfo )
diff --git a/src/micro/picinfo.cpp b/src/micro/picinfo.cpp
index 2e38c12..09ea2c3 100644
--- a/src/micro/picinfo.cpp
+++ b/src/micro/picinfo.cpp
@@ -13,7 +13,7 @@
 PicInfo::PicInfo()
 	: MicroInfo()
 {
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 
diff --git a/src/micro/picinfo12bit.cpp b/src/micro/picinfo12bit.cpp
index 7df9472..8144207 100644
--- a/src/micro/picinfo12bit.cpp
+++ b/src/micro/picinfo12bit.cpp
@@ -14,7 +14,7 @@
 #include <tdelocale.h>
 #include <kstaticdeleter.h>
 
-PicAsm12bit *PicAsm12bit::m_self = 0;
+PicAsm12bit *PicAsm12bit::m_self = nullptr;
 static KStaticDeleter<PicAsm12bit> staticDeleter;
 
 PicAsm12bit *PicAsm12bit::self()
@@ -38,46 +38,46 @@ PicAsm12bit::PicAsm12bit()
 	: AsmInfo()
 {
 	// Byte-orientated file register operations
-	addInstruction( "ADDWF",	0,					"000111dfffff" );
-	addInstruction( "ANDWF",	0,					"000101dfffff" );
-	addInstruction( "CLRF",		0,						"0000011fffff" );
-	addInstruction( "CLRW",		0,						"000001000000" );
-	addInstruction( "COMF",		0,					"001001dfffff" );
-	addInstruction( "DECF",		0,					"000011dfffff" );
-	addInstruction( "DECFSZ",	0,			"001011dfffff" );
-	addInstruction( "INCF",		0,					"001010dfffff" );
-	addInstruction( "INCFSZ",	0,			"001111dfffff" );
-	addInstruction( "IORWF",	0,			"000100dfffff" );
-	addInstruction( "MOVF",		0,							"001000dfffff" );
-	addInstruction( "MOVWF",	0,					"0000001fffff" );
-	addInstruction( "NOP",		0,					"000000000000" );
-	addInstruction( "RLF",		0,	"001101dfffff" );
-	addInstruction( "RRF",		0,	"001100dfffff" );
-	addInstruction( "SUBWF",	0,				"000010dfffff" );
-	addInstruction( "SWAPF",	0,				"001110dfffff" );
-	addInstruction( "XORWF",	0,			"000110dfffff" );
+	addInstruction( "ADDWF",	nullptr,					"000111dfffff" );
+	addInstruction( "ANDWF",	nullptr,					"000101dfffff" );
+	addInstruction( "CLRF",		nullptr,						"0000011fffff" );
+	addInstruction( "CLRW",		nullptr,						"000001000000" );
+	addInstruction( "COMF",		nullptr,					"001001dfffff" );
+	addInstruction( "DECF",		nullptr,					"000011dfffff" );
+	addInstruction( "DECFSZ",	nullptr,			"001011dfffff" );
+	addInstruction( "INCF",		nullptr,					"001010dfffff" );
+	addInstruction( "INCFSZ",	nullptr,			"001111dfffff" );
+	addInstruction( "IORWF",	nullptr,			"000100dfffff" );
+	addInstruction( "MOVF",		nullptr,							"001000dfffff" );
+	addInstruction( "MOVWF",	nullptr,					"0000001fffff" );
+	addInstruction( "NOP",		nullptr,					"000000000000" );
+	addInstruction( "RLF",		nullptr,	"001101dfffff" );
+	addInstruction( "RRF",		nullptr,	"001100dfffff" );
+	addInstruction( "SUBWF",	nullptr,				"000010dfffff" );
+	addInstruction( "SWAPF",	nullptr,				"001110dfffff" );
+	addInstruction( "XORWF",	nullptr,			"000110dfffff" );
 	
 	// Bit-orientated file register operations
-	addInstruction( "BCF",		0,					"0100bbbfffff" );
-	addInstruction( "BSF",		0,						"0101bbbfffff" );
-	addInstruction( "BTFSC",	0,		"0110bbbfffff" );
-	addInstruction( "BTFSS",	0,		"0111bbbfffff" );
+	addInstruction( "BCF",		nullptr,					"0100bbbfffff" );
+	addInstruction( "BSF",		nullptr,						"0101bbbfffff" );
+	addInstruction( "BTFSC",	nullptr,		"0110bbbfffff" );
+	addInstruction( "BTFSS",	nullptr,		"0111bbbfffff" );
 	
 	// Literal and control operations
-	addInstruction( "ANDLW",	0,				"1110kkkkkkkk" );
-	addInstruction( "CALL",		0,				"1001kkkkkkkk" );
-	addInstruction( "CLRWDT",	0,			"000000000100" );
-	addInstruction( "GOTO",		0,					"101kkkkkkkkk" );
-	addInstruction( "IORLW",	0,	"1101kkkkkkkk" );
-	addInstruction( "MOVLW",	0,				"1100kkkkkkkk" );
+	addInstruction( "ANDLW",	nullptr,				"1110kkkkkkkk" );
+	addInstruction( "CALL",		nullptr,				"1001kkkkkkkk" );
+	addInstruction( "CLRWDT",	nullptr,			"000000000100" );
+	addInstruction( "GOTO",		nullptr,					"101kkkkkkkkk" );
+	addInstruction( "IORLW",	nullptr,	"1101kkkkkkkk" );
+	addInstruction( "MOVLW",	nullptr,				"1100kkkkkkkk" );
 // 	addInstruction( "RETFIE",	0,			"00000000001001" );
-	addInstruction( "OPTION",	0,			"000000000010" );
-	addInstruction( "RETLW",	0,		"1000kkkkkkkk" );
+	addInstruction( "OPTION",	nullptr,			"000000000010" );
+	addInstruction( "RETLW",	nullptr,		"1000kkkkkkkk" );
 // 	addInstruction( "RETURN",	0,			"00000000001000" );
-	addInstruction( "SLEEP",	0,			"000000000011" );
+	addInstruction( "SLEEP",	nullptr,			"000000000011" );
 // 	addInstruction( "SUBLW",	0,		"11110xkkkkkkkk" );
-	addInstruction( "TRIS",		0,				"000000000fff" );
-	addInstruction( "XORLW",	0,	"1111kkkkkkkk" );
+	addInstruction( "TRIS",		nullptr,				"000000000fff" );
+	addInstruction( "XORLW",	nullptr,	"1111kkkkkkkk" );
 }
 
 
@@ -115,7 +115,7 @@ PicInfo16C54::PicInfo16C54()
 PicInfo16C54::~PicInfo16C54()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo16C55::PicInfo16C55()
@@ -149,7 +149,7 @@ PicInfo12C508::PicInfo12C508()
 PicInfo12C508::~PicInfo12C508()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo12C509::PicInfo12C509()
diff --git a/src/micro/picinfo14bit.cpp b/src/micro/picinfo14bit.cpp
index 203b33c..af6e405 100644
--- a/src/micro/picinfo14bit.cpp
+++ b/src/micro/picinfo14bit.cpp
@@ -14,7 +14,7 @@
 #include <tdelocale.h>
 #include <kstaticdeleter.h>
 
-PicAsm14bit *PicAsm14bit::m_self = 0;
+PicAsm14bit *PicAsm14bit::m_self = nullptr;
 static KStaticDeleter<PicAsm14bit> staticDeleter;
 
 PicAsm14bit *PicAsm14bit::self()
@@ -39,45 +39,45 @@ PicAsm14bit::PicAsm14bit()
 	: AsmInfo()
 {
 	// Byte-orientated file register operations
-	addInstruction( "ADDWF",	0,					"000111dfffffff" );
-	addInstruction( "ANDWF",	0,					"000101dfffffff" );
-	addInstruction( "CLRF",		0,						"0000011fffffff" );
-	addInstruction( "CLRW",		0,						"0000010xxxxxxx" );
-	addInstruction( "COMF",		0,					"001001dfffffff" );
-	addInstruction( "DECF",		0,					"000011dfffffff" );
-	addInstruction( "DECFSZ",	0,			"001011dfffffff" );
-	addInstruction( "INCF",		0,					"001010dfffffff" );
-	addInstruction( "INCFSZ",	0,			"001111dfffffff" );
-	addInstruction( "IORWF",	0,			"000100dfffffff" );
-	addInstruction( "MOVF",		0,							"001000dfffffff" );
-	addInstruction( "MOVWF",	0,					"0000001fffffff" );
-	addInstruction( "NOP",		0,					"0000000xx00000" );
-	addInstruction( "RLF",		0,	"001101dfffffff" );
-	addInstruction( "RRF",		0,	"001100dfffffff" );
-	addInstruction( "SUBWF",	0,				"000010dfffffff" );
-	addInstruction( "SWAPF",	0,				"001110dfffffff" );
-	addInstruction( "XORWF",	0,			"000110dfffffff" );
+	addInstruction( "ADDWF",	nullptr,					"000111dfffffff" );
+	addInstruction( "ANDWF",	nullptr,					"000101dfffffff" );
+	addInstruction( "CLRF",		nullptr,						"0000011fffffff" );
+	addInstruction( "CLRW",		nullptr,						"0000010xxxxxxx" );
+	addInstruction( "COMF",		nullptr,					"001001dfffffff" );
+	addInstruction( "DECF",		nullptr,					"000011dfffffff" );
+	addInstruction( "DECFSZ",	nullptr,			"001011dfffffff" );
+	addInstruction( "INCF",		nullptr,					"001010dfffffff" );
+	addInstruction( "INCFSZ",	nullptr,			"001111dfffffff" );
+	addInstruction( "IORWF",	nullptr,			"000100dfffffff" );
+	addInstruction( "MOVF",		nullptr,							"001000dfffffff" );
+	addInstruction( "MOVWF",	nullptr,					"0000001fffffff" );
+	addInstruction( "NOP",		nullptr,					"0000000xx00000" );
+	addInstruction( "RLF",		nullptr,	"001101dfffffff" );
+	addInstruction( "RRF",		nullptr,	"001100dfffffff" );
+	addInstruction( "SUBWF",	nullptr,				"000010dfffffff" );
+	addInstruction( "SWAPF",	nullptr,				"001110dfffffff" );
+	addInstruction( "XORWF",	nullptr,			"000110dfffffff" );
 	
 	// Bit-orientated file register operations
-	addInstruction( "BCF",		0,					"0100bbbfffffff" );
-	addInstruction( "BSF",		0,						"0101bbbfffffff" );
-	addInstruction( "BTFSC",	0,		"0110bbbfffffff" );
-	addInstruction( "BTFSS",	0,		"0111bbbfffffff" );
+	addInstruction( "BCF",		nullptr,					"0100bbbfffffff" );
+	addInstruction( "BSF",		nullptr,						"0101bbbfffffff" );
+	addInstruction( "BTFSC",	nullptr,		"0110bbbfffffff" );
+	addInstruction( "BTFSS",	nullptr,		"0111bbbfffffff" );
 	
 	// Literal and control operations
-	addInstruction( "ADDLW",	0,				"11111xkkkkkkkk" );
-	addInstruction( "ANDLW",	0,				"111001kkkkkkkk" );
-	addInstruction( "CALL",		0,				"100kkkkkkkkkkk" );
-	addInstruction( "CLRWDT",	0,			"00000001100100" );
-	addInstruction( "GOTO",		0,					"101kkkkkkkkkkk" );
-	addInstruction( "IORLW",	0,	"111000kkkkkkkk" );
-	addInstruction( "MOVLW",	0,				"1100xxkkkkkkkk" );
-	addInstruction( "RETFIE",	0,			"00000000001001" );
-	addInstruction( "RETLW",	0,		"1101xxkkkkkkkk" );
-	addInstruction( "RETURN",	0,			"00000000001000" );
-	addInstruction( "SLEEP",	0,			"00000000000011" );
-	addInstruction( "SUBLW",	0,		"11110xkkkkkkkk" );
-	addInstruction( "XORLW",	0,	"111010kkkkkkkk" );
+	addInstruction( "ADDLW",	nullptr,				"11111xkkkkkkkk" );
+	addInstruction( "ANDLW",	nullptr,				"111001kkkkkkkk" );
+	addInstruction( "CALL",		nullptr,				"100kkkkkkkkkkk" );
+	addInstruction( "CLRWDT",	nullptr,			"00000001100100" );
+	addInstruction( "GOTO",		nullptr,					"101kkkkkkkkkkk" );
+	addInstruction( "IORLW",	nullptr,	"111000kkkkkkkk" );
+	addInstruction( "MOVLW",	nullptr,				"1100xxkkkkkkkk" );
+	addInstruction( "RETFIE",	nullptr,			"00000000001001" );
+	addInstruction( "RETLW",	nullptr,		"1101xxkkkkkkkk" );
+	addInstruction( "RETURN",	nullptr,			"00000000001000" );
+	addInstruction( "SLEEP",	nullptr,			"00000000000011" );
+	addInstruction( "SUBLW",	nullptr,		"11110xkkkkkkkk" );
+	addInstruction( "XORLW",	nullptr,	"111010kkkkkkkk" );
 }
 
 PicInfo16C8x::PicInfo16C8x()
@@ -111,7 +111,7 @@ PicInfo16C8x::PicInfo16C8x()
 PicInfo16C8x::~PicInfo16C8x()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo16C84::PicInfo16C84()
@@ -220,7 +220,7 @@ PicInfo16C62::PicInfo16C62()
 PicInfo16C62::~PicInfo16C62()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo16C63::PicInfo16C63()
@@ -289,7 +289,7 @@ PicInfo16C64::PicInfo16C64()
 PicInfo16C64::~PicInfo16C64()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo16C65::PicInfo16C65()
@@ -333,7 +333,7 @@ PicInfo16F62x::PicInfo16F62x()
 PicInfo16F62x::~PicInfo16F62x()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo16F627::PicInfo16F627()
diff --git a/src/micro/picinfo16bit.cpp b/src/micro/picinfo16bit.cpp
index 632cc17..7a40f81 100644
--- a/src/micro/picinfo16bit.cpp
+++ b/src/micro/picinfo16bit.cpp
@@ -14,7 +14,7 @@
 #include <tdelocale.h>
 #include <kstaticdeleter.h>
 
-PicAsm16bit *PicAsm16bit::m_self = 0;
+PicAsm16bit *PicAsm16bit::m_self = nullptr;
 static KStaticDeleter<PicAsm16bit> staticDeleter;
 
 PicAsm16bit *PicAsm16bit::self()
@@ -41,45 +41,45 @@ PicAsm16bit::PicAsm16bit()
 	// TODO 16 bit Asm instructions for PICs
 	
 	// Byte-orientated file register operations
-	addInstruction( "ADDWF",	0,					"000111dfffffff" );
-	addInstruction( "ANDWF",	0,					"000101dfffffff" );
-	addInstruction( "CLRF",		0,						"0000011fffffff" );
-	addInstruction( "CLRW",		0,						"0000010xxxxxxx" );
-	addInstruction( "COMF",		0,					"001001dfffffff" );
-	addInstruction( "DECF",		0,					"000011dfffffff" );
-	addInstruction( "DECFSZ",	0,			"001011dfffffff" );
-	addInstruction( "INCF",		0,					"001010dfffffff" );
-	addInstruction( "INCFSZ",	0,			"001111dfffffff" );
-	addInstruction( "IORWF",	0,			"000100dfffffff" );
-	addInstruction( "MOVF",		0,							"001000dfffffff" );
-	addInstruction( "MOVWF",	0,					"0000001fffffff" );
-	addInstruction( "NOP",		0,					"0000000xx00000" );
-	addInstruction( "RLF",		0,	"001101dfffffff" );
-	addInstruction( "RRF",		0,	"001100dfffffff" );
-	addInstruction( "SUBWF",	0,				"000010dfffffff" );
-	addInstruction( "SWAPF",	0,				"001110dfffffff" );
-	addInstruction( "XORWF",	0,			"000110dfffffff" );
+	addInstruction( "ADDWF",	nullptr,					"000111dfffffff" );
+	addInstruction( "ANDWF",	nullptr,					"000101dfffffff" );
+	addInstruction( "CLRF",		nullptr,						"0000011fffffff" );
+	addInstruction( "CLRW",		nullptr,						"0000010xxxxxxx" );
+	addInstruction( "COMF",		nullptr,					"001001dfffffff" );
+	addInstruction( "DECF",		nullptr,					"000011dfffffff" );
+	addInstruction( "DECFSZ",	nullptr,			"001011dfffffff" );
+	addInstruction( "INCF",		nullptr,					"001010dfffffff" );
+	addInstruction( "INCFSZ",	nullptr,			"001111dfffffff" );
+	addInstruction( "IORWF",	nullptr,			"000100dfffffff" );
+	addInstruction( "MOVF",		nullptr,							"001000dfffffff" );
+	addInstruction( "MOVWF",	nullptr,					"0000001fffffff" );
+	addInstruction( "NOP",		nullptr,					"0000000xx00000" );
+	addInstruction( "RLF",		nullptr,	"001101dfffffff" );
+	addInstruction( "RRF",		nullptr,	"001100dfffffff" );
+	addInstruction( "SUBWF",	nullptr,				"000010dfffffff" );
+	addInstruction( "SWAPF",	nullptr,				"001110dfffffff" );
+	addInstruction( "XORWF",	nullptr,			"000110dfffffff" );
 	
 	// Bit-orientated file register operations
-	addInstruction( "BCF",		0,					"0100bbbfffffff" );
-	addInstruction( "BSF",		0,						"0101bbbfffffff" );
-	addInstruction( "BTFSC",	0,		"0110bbbfffffff" );
-	addInstruction( "BTFSS",	0,		"0111bbbfffffff" );
+	addInstruction( "BCF",		nullptr,					"0100bbbfffffff" );
+	addInstruction( "BSF",		nullptr,						"0101bbbfffffff" );
+	addInstruction( "BTFSC",	nullptr,		"0110bbbfffffff" );
+	addInstruction( "BTFSS",	nullptr,		"0111bbbfffffff" );
 	
 	// Literal and control operations
-	addInstruction( "ADDLW",	0,				"11111xkkkkkkkk" );
-	addInstruction( "ANDLW",	0,				"111001kkkkkkkk" );
-	addInstruction( "CALL",		0,				"100kkkkkkkkkkk" );
-	addInstruction( "CLRWDT",	0,			"00000001100100" );
-	addInstruction( "GOTO",		0,					"101kkkkkkkkkkk" );
-	addInstruction( "IORLW",	0,	"111000kkkkkkkk" );
-	addInstruction( "MOVLW",	0,				"1100xxkkkkkkkk" );
-	addInstruction( "RETFIE",	0,			"00000000001001" );
-	addInstruction( "RETLW",	0,		"1101xxkkkkkkkk" );
-	addInstruction( "RETURN",	0,			"00000000001000" );
-	addInstruction( "SLEEP",	0,			"00000000000011" );
-	addInstruction( "SUBLW",	0,		"11110xkkkkkkkk" );
-	addInstruction( "XORLW",	0,	"111010kkkkkkkk" );
+	addInstruction( "ADDLW",	nullptr,				"11111xkkkkkkkk" );
+	addInstruction( "ANDLW",	nullptr,				"111001kkkkkkkk" );
+	addInstruction( "CALL",		nullptr,				"100kkkkkkkkkkk" );
+	addInstruction( "CLRWDT",	nullptr,			"00000001100100" );
+	addInstruction( "GOTO",		nullptr,					"101kkkkkkkkkkk" );
+	addInstruction( "IORLW",	nullptr,	"111000kkkkkkkk" );
+	addInstruction( "MOVLW",	nullptr,				"1100xxkkkkkkkk" );
+	addInstruction( "RETFIE",	nullptr,			"00000000001001" );
+	addInstruction( "RETLW",	nullptr,		"1101xxkkkkkkkk" );
+	addInstruction( "RETURN",	nullptr,			"00000000001000" );
+	addInstruction( "SLEEP",	nullptr,			"00000000000011" );
+	addInstruction( "SUBLW",	nullptr,		"11110xkkkkkkkk" );
+	addInstruction( "XORLW",	nullptr,	"111010kkkkkkkk" );
 }
 
 
@@ -240,7 +240,7 @@ PicInfo18C4x2::PicInfo18C4x2()
 PicInfo18C4x2::~PicInfo18C4x2()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo18C442::PicInfo18C442()
@@ -330,7 +330,7 @@ PicInfo18F1220::PicInfo18F1220()
 PicInfo18F1220::~PicInfo18F1220()
 {
 	delete m_package;
-	m_package = 0l;
+	m_package = nullptr;
 }
 
 PicInfo18F1320::PicInfo18F1320()
diff --git a/src/microsettings.cpp b/src/microsettings.cpp
index 2c118b6..37f372f 100644
--- a/src/microsettings.cpp
+++ b/src/microsettings.cpp
@@ -131,7 +131,7 @@ PinSettings* MicroSettings::pinWithID( const TQString &id )
 	{
 		if ( (*it)->id() == id ) return *it;
 	}
-	return 0L;
+	return nullptr;
 }
 
 int MicroSettings::portState( const TQString &port )
@@ -286,12 +286,12 @@ TQStringList MicroSettings::variableNames()
 
 VariableInfo* MicroSettings::variableInfo( const TQString &name )
 {
-	if ( name.isNull() ) return 0l;
+	if ( name.isNull() ) return nullptr;
 	VariableMap::iterator it = m_variableMap.find(name);
 	if ( it != m_variableMap.end() ) {
 		return &(it.data());
 	} else {
-		return 0l;
+		return nullptr;
 	}
 }
 
diff --git a/src/node.cpp b/src/node.cpp
index d259c08..ed944b6 100644
--- a/src/node.cpp
+++ b/src/node.cpp
@@ -21,8 +21,8 @@
 Node::Node( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id )
 	: TQObject(), TQCanvasPolygon( icnDocument->canvas() )
 {
-	p_nodeGroup = 0l;
-	p_parentItem = 0L;
+	p_nodeGroup = nullptr;
+	p_parentItem = nullptr;
 	b_deleted = false;
 	m_dir = dir;
 	m_type = type;
@@ -407,7 +407,7 @@ bool Node::handleNewConnector( Connector * connector )
 Connector* Node::createInputConnector( Node * startNode )
 {
 	if ( type() == fp_out || !startNode )
-		return 0l;
+		return nullptr;
 	
 	Connector *connector = new Connector( startNode, this, p_icnDocument );
 	addInputConnector(connector);
@@ -427,14 +427,14 @@ void Node::removeConnector( Connector *connector )
 	if ( it != m_inputConnectorList.end() )
 	{
 		(*it)->removeConnector();
-		(*it) = 0L;
+		(*it) = nullptr;
 	}
 	
 	it = m_outputConnectorList.find(connector);
 	if ( it != m_outputConnectorList.end() )
 	{
 		(*it)->removeConnector();
-		(*it) = 0L;
+		(*it) = nullptr;
 	}
 }
 
diff --git a/src/node.h b/src/node.h
index 64558fc..19e209d 100644
--- a/src/node.h
+++ b/src/node.h
@@ -57,7 +57,7 @@ public:
 		dir_down = 90,
 		dir_left = 180
 	};
-	Node( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = 0L );
+	Node( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = nullptr );
 	virtual ~Node();
 	
 	/**
@@ -123,7 +123,7 @@ public:
 	 * Returns true if the node is part of a CNItem
 	 * (i.e. not between multiple connectors)
 	 */
-	bool isChildNode() const { return (p_parentItem != 0L); }
+	bool isChildNode() const { return (p_parentItem != nullptr); }
 	/**
 	 * Returns a pointer to the CNItem to which the node belongs,
 	 * or Null if it doesn't.
@@ -173,7 +173,7 @@ public:
 	 * being the connected nodes, and so can simply return if they are in there.
 	 * If it is null, it will assume that it is the first ndoe & will create a list
 	 */
-	bool isConnected( Node *node, NodeList *checkedNodes = 0L );
+	bool isConnected( Node *node, NodeList *checkedNodes = nullptr );
 	
 	void removeNullConnectors();
 	/**
diff --git a/src/nodegroup.cpp b/src/nodegroup.cpp
index 3b23e23..6a97d68 100644
--- a/src/nodegroup.cpp
+++ b/src/nodegroup.cpp
@@ -33,13 +33,13 @@ NodeGroup::~NodeGroup()
 	m_extNodeList.remove( (Node*)0l );
 	const NodeList::iterator xnEnd = m_extNodeList.end();
 	for ( NodeList::iterator it = m_extNodeList.begin(); it != xnEnd; ++it )
-		(*it)->setNodeGroup(0l);
+		(*it)->setNodeGroup(nullptr);
 	m_extNodeList.clear();
 	
 	m_nodeList.remove( (Node*)0l );
 	const NodeList::iterator nEnd = m_nodeList.end();
 	for ( NodeList::iterator it = m_nodeList.begin(); it != nEnd; ++it )
-		(*it)->setNodeGroup(0l);
+		(*it)->setNodeGroup(nullptr);
 	m_nodeList.clear();
 }
 
@@ -135,7 +135,7 @@ void NodeGroup::updateRoutes()
 	while ( !currentList.isEmpty() )
 	{
 		findBestPair( &currentList, &n1, &n2 );
-		if ( n1 == 0l || n2 == 0l ) {
+		if ( !n1 || !n2 ) {
 			return;
 		}
 		NodeList route = findRoute( n1, n2 );
@@ -238,7 +238,7 @@ IntList NodeGroup::findRoute( IntList used, int currentNode, int endNode, bool *
 Connector* NodeGroup::findCommonConnector( Node *n1, Node *n2 )
 {
 	if ( !n1 || !n2 || n1==n2 ) {
-		return 0l;
+		return nullptr;
 	}
 	
 	ConnectorList n1Con = n1->inputConnectorList() + n1->outputConnectorList();
@@ -251,14 +251,14 @@ Connector* NodeGroup::findCommonConnector( Node *n1, Node *n2 )
 			return *it;
 		}
 	}
-	return 0l;
+	return nullptr;
 }
 
 
 void NodeGroup::findBestPair( NodeList *list, Node **n1, Node **n2 )
 {
-	*n1 = 0l;
-	*n2 = 0l;
+	*n1 = nullptr;
+	*n2 = nullptr;
 	
 	if ( list->size() < 2 ) {
 		return;
@@ -403,7 +403,7 @@ void NodeGroup::removeRoutedNodes( NodeList *nodes, Node *n1, Node *n2 )
 	for ( NodeList::iterator it = nodes->begin(); it != end; ++it )
 	{
 		if ( nodes->contains(*it) > 1 ) {
-			*it = 0l;
+			*it = nullptr;
 		}
 	}
 	nodes->remove((Node*)0l);
@@ -457,7 +457,7 @@ int NodeGroup::getNodePos( Node *n )
 Node* NodeGroup::getNodePtr( int n )
 {
 	if ( n<0 ) {
-		return 0l;
+		return nullptr;
 	}
 	const int a = m_nodeList.size();
 	if (n<a) {
@@ -467,7 +467,7 @@ Node* NodeGroup::getNodePtr( int n )
 	if (n<a+b) {
 		return m_extNodeList[n-a];
 	}
-	return 0l;
+	return nullptr;
 }
 
 
@@ -479,7 +479,7 @@ void NodeGroup::clearConList()
 		Connector *con = *it;
 		if (con)
 		{
-			con->setNodeGroup(0l);
+			con->setNodeGroup(nullptr);
 			disconnect( con, TQ_SIGNAL(removed(Connector*)), this, TQ_SLOT(connectorRemoved(Connector*)) );
 		}
 	}
@@ -492,7 +492,7 @@ void NodeGroup::init()
 	NodeList::iterator xnEnd = m_extNodeList.end();
 	for ( NodeList::iterator it = m_extNodeList.begin(); it != xnEnd; ++it )
 	{
-		(*it)->setNodeGroup(0l);
+		(*it)->setNodeGroup(nullptr);
 	}
 	m_extNodeList.clear();
 	
@@ -548,7 +548,7 @@ void NodeGroup::nodeRemoved( Node *node )
 {
 	// We are probably about to get deleted by ICNDocument anyway...so no point in doing anything
 	m_nodeList.remove(node);
-	node->setNodeGroup(0l);
+	node->setNodeGroup(nullptr);
 	node->setVisible(true);
 	m_extNodeList.remove(node);
 }
diff --git a/src/nodegroup.h b/src/nodegroup.h
index 9a7a4de..6468468 100644
--- a/src/nodegroup.h
+++ b/src/nodegroup.h
@@ -38,7 +38,7 @@ class NodeGroup : public TQObject
 TQ_OBJECT
   
 public:
-	NodeGroup( ICNDocument *icnDocument, const char *name = 0);
+	NodeGroup( ICNDocument *icnDocument, const char *name = nullptr);
 	~NodeGroup();
 	/**
 	 * Adds a node to the group (this checks to make sure that the node is not
@@ -116,7 +116,7 @@ protected:
 	bool b_visible;
 	
 private:
-	IntList findRoute( IntList used, int currentNode, int endNode, bool *success = 0l );
+	IntList findRoute( IntList used, int currentNode, int endNode, bool *success = nullptr );
 	void resetRoutedMap();
 	/**
 	 * Looks at b_routedMap as well as the connectors coming out of nodes, and
diff --git a/src/oscilloscopedata.h b/src/oscilloscopedata.h
index 8860842..13046dc 100644
--- a/src/oscilloscopedata.h
+++ b/src/oscilloscopedata.h
@@ -88,7 +88,7 @@ class DCArray
 				allocateUpTo(i+1024);
 			
 			if ( i >= DATA_CHUNK_ARRAY_SIZE )
-				return 0l;
+				return nullptr;
 			
 			return m_data[i];
 		}
@@ -133,7 +133,7 @@ class StoredData
 		{
 			return dataAt(i);
 		}
-		inline T & dataAt( ullong i, ullong * insertPos = 0 )
+		inline T & dataAt( ullong i, ullong * insertPos = nullptr )
 		{
 			ullong c = i % DATA_CHUNK_SIZE;
 			ullong b = ullong((i-c)/DATA_CHUNK_SIZE) % DATA_CHUNK_ARRAY_SIZE;
@@ -161,7 +161,7 @@ class StoredData
 		
 		DCArray<T> * dcArray( unsigned pos ) const
 		{
-			return (pos < m_allocatedUpTo) ? m_data[pos] : 0l;
+			return (pos < m_allocatedUpTo) ? m_data[pos] : nullptr;
 		}
 		
 		/**
diff --git a/src/picitem.cpp b/src/picitem.cpp
index 7c212a8..b610c4b 100644
--- a/src/picitem.cpp
+++ b/src/picitem.cpp
@@ -34,7 +34,7 @@ static const int PinDirArrow = 3;
 
 //BEGIN class PinItem
 PinItem::PinItem( FlowCodeDocument* _view, TQPoint position, bool _onLeft, PinSettings * pinSettings )
-	: TQCanvasRectangle(0)
+	: TQCanvasRectangle(nullptr)
 {
 	m_pinSettings = pinSettings;
 	view = _view;
@@ -356,7 +356,7 @@ void PicItem::buttonStateChanged( const TQString &id, bool state )
 		button("settings")->setState(false);
 		update();
 	
-		MicroSettingsDlg *dlg = new MicroSettingsDlg( microSettings, 0L, "microSettingsDlg" );
+		MicroSettingsDlg *dlg = new MicroSettingsDlg( microSettings, nullptr, "microSettingsDlg" );
 		connect( dlg, TQ_SIGNAL(okClicked()), this, TQ_SLOT(slotMicroSettingsDlgAccepted()) );
 		connect( dlg, TQ_SIGNAL(applyClicked()), this, TQ_SLOT(slotMicroSettingsDlgAccepted()) );
 		dlg->show();
diff --git a/src/projectmanager.cpp b/src/projectmanager.cpp
index 777beb7..28e15b4 100644
--- a/src/projectmanager.cpp
+++ b/src/projectmanager.cpp
@@ -183,7 +183,7 @@ ProjectItem::ProjectItem( ProjectItem * parent, Type type, ProjectManager * proj
 	: TQObject()
 {
 	m_pParent = parent;
-	m_pILVItem = 0l;
+	m_pILVItem = nullptr;
 	m_pProjectManager = projectManager;
 	p_ktechlab = ktechlab;
 	m_type = type;
@@ -199,7 +199,7 @@ ProjectItem::~ProjectItem()
 	m_children.clear();
 	
 	delete m_pILVItem;
-	m_pILVItem = 0l;
+	m_pILVItem = nullptr;
 }
 
 
@@ -420,7 +420,7 @@ bool ProjectItem::build( ProcessOptionsList * pol )
 	
 	if ( outputURL().isEmpty() )
 	{
-		KMessageBox::sorry( 0l, i18n("Don't know how to build \"%1\" (output url is empty).").arg(name()) );
+		KMessageBox::sorry( nullptr, i18n("Don't know how to build \"%1\" (output url is empty).").arg(name()) );
 		return false;
 	}
 	
@@ -431,7 +431,7 @@ bool ProjectItem::build( ProcessOptionsList * pol )
 		ProjectItem * lib = projectInfo->findItem( projectInfo->directory() + *it );
 		if ( !lib )
 		{
-			KMessageBox::sorry( 0l, i18n("Don't know how to build \"%1\" (library does not exist in project).").arg(*it) );
+			KMessageBox::sorry( nullptr, i18n("Don't know how to build \"%1\" (library does not exist in project).").arg(*it) );
 			return false;
 		}
 		
@@ -461,7 +461,7 @@ bool ProjectItem::build( ProcessOptionsList * pol )
 	switch ( outputType() )
 	{
 		case UnknownOutput:
-			KMessageBox::sorry( 0l, i18n("Don't know how to build \"%1\" (unknown output type).").arg(name()) );
+			KMessageBox::sorry( nullptr, i18n("Don't know how to build \"%1\" (unknown output type).").arg(name()) );
 			return false;
 			
 		case ProgramOutput:
@@ -612,7 +612,7 @@ ProjectItem * ProjectItem::findItem( const KURL & url )
 			return found;
 	}
 	
-	return 0l;
+	return nullptr;
 }
 
 
@@ -762,7 +762,7 @@ void ProjectItem::domElementToItem( const TQDomElement & element, const KURL & b
 
 //BEGIN class ProjectInfo
 ProjectInfo::ProjectInfo( ProjectManager * projectManager, KTechlab * ktechlab )
-	: ProjectItem( 0l, ProjectItem::ProjectType, projectManager, ktechlab )
+	: ProjectItem( nullptr, ProjectItem::ProjectType, projectManager, ktechlab )
 {
 	m_microID = TQString();
 }
@@ -776,11 +776,11 @@ ProjectInfo::~ ProjectInfo()
 bool ProjectInfo::open( const KURL & url )
 {
 	TQString target;
-	if ( !TDEIO::NetAccess::download( url, target, 0l ) )
+	if ( !TDEIO::NetAccess::download( url, target, nullptr ) )
 	{
 		// If the file could not be downloaded, for example does not
 		// exist on disk, NetAccess will tell us what error to use
-		KMessageBox::error( 0l, TDEIO::NetAccess::lastErrorString() );
+		KMessageBox::error( nullptr, TDEIO::NetAccess::lastErrorString() );
 		
 		return false;
 	}
@@ -788,7 +788,7 @@ bool ProjectInfo::open( const KURL & url )
 	TQFile file(target);
 	if ( !file.open( IO_ReadOnly ) )
 	{
-		KMessageBox::sorry( 0l, i18n("Could not open %1 for reading").arg(target) );
+		KMessageBox::sorry( nullptr, i18n("Could not open %1 for reading").arg(target) );
 		return false;
 	}
 	
@@ -805,7 +805,7 @@ bool ProjectInfo::open( const KURL & url )
 	TQString errorMessage;
 	if ( !doc.setContent( xml, &errorMessage ) )
 	{
-		KMessageBox::sorry( 0l, i18n("Couldn't parse xml:\n%1").arg(errorMessage) );
+		KMessageBox::sorry( nullptr, i18n("Couldn't parse xml:\n%1").arg(errorMessage) );
 		return false;
 	}
 	
@@ -887,7 +887,7 @@ bool ProjectInfo::saveAndClose()
 
 
 //BEGIN class ProjectManager
-ProjectManager * ProjectManager::m_pSelf = 0l;
+ProjectManager * ProjectManager::m_pSelf = nullptr;
 
 ProjectManager * ProjectManager::self( KTechlab * ktl, KateMDI::ToolView * parent )
 {
@@ -903,7 +903,7 @@ ProjectManager * ProjectManager::self( KTechlab * ktl, KateMDI::ToolView * paren
 
 ProjectManager::ProjectManager( KTechlab * ktl, KateMDI::ToolView * parent )
 	: ItemSelector( parent, "Project Manager" ),
-	m_pCurrentProject(0l),
+	m_pCurrentProject(nullptr),
 	p_ktechlab(ktl)
 {
 	TQWhatsThis::add( this, i18n("Displays the list of files in the project.\nTo open or close a project, use the \"Project\" menu. Right click on a file to remove it from the project") );
@@ -978,7 +978,7 @@ void ProjectManager::slotOpenProject( const KURL & url )
 	if ( !m_pCurrentProject->open(url) )
 	{
 		m_pCurrentProject->deleteLater();
-		m_pCurrentProject = 0l;
+		m_pCurrentProject = nullptr;
 		return;
 	}
 	
@@ -1002,7 +1002,7 @@ bool ProjectManager::slotCloseProject()
 		return false;
 	
 	m_pCurrentProject->deleteLater();
-	m_pCurrentProject = 0l;
+	m_pCurrentProject = nullptr;
 	updateActions();
 	emit projectClosed();
 	return true;
diff --git a/src/projectmanager.h b/src/projectmanager.h
index 4ea27dc..b84fc0a 100644
--- a/src/projectmanager.h
+++ b/src/projectmanager.h
@@ -270,7 +270,7 @@ class ProjectManager : public ItemSelector
   
 	public:
 		~ProjectManager();
-		static ProjectManager * self( KTechlab * ktl = 0l, KateMDI::ToolView * parent = 0l );
+		static ProjectManager * self( KTechlab * ktl = nullptr, KateMDI::ToolView * parent = nullptr );
 	
 		static TQString toolViewIdentifier() { return "ProjectManager"; }
 	
diff --git a/src/resizeoverlay.cpp b/src/resizeoverlay.cpp
index b2b19ef..218e4b2 100644
--- a/src/resizeoverlay.cpp
+++ b/src/resizeoverlay.cpp
@@ -32,7 +32,7 @@ ResizeOverlay::~ResizeOverlay()
 	for ( ResizeHandleMap::iterator it = m_resizeHandleMap.begin(); it != end; ++it )
 	{
 		if (it.data())
-			it.data()->setCanvas(0l);
+			it.data()->setCanvas(nullptr);
 		delete (ResizeHandle*)it.data();
 	}
 	m_resizeHandleMap.clear();
@@ -92,7 +92,7 @@ ResizeHandle *ResizeOverlay::resizeHandle( int id )
 	ResizeHandleMap::iterator it = m_resizeHandleMap.find(id);
 	if ( it != m_resizeHandleMap.end() )
 		return it.data();
-	return 0l;
+	return nullptr;
 }
 
 
@@ -258,7 +258,7 @@ void RectangularOverlay::removeTopMiddle()
 	if (!m_tm)
 		return;
 	removeResizeHandle( m_tm->id() );
-	m_tm = 0l;
+	m_tm = nullptr;
 }
 
 
@@ -267,7 +267,7 @@ void RectangularOverlay::removeBotMiddle()
 	if (!m_bm)
 		return;
 	removeResizeHandle( m_bm->id() );
-	m_bm = 0l;
+	m_bm = nullptr;
 }
 
 
@@ -298,7 +298,7 @@ bool RectangularOverlay::isValidXPos( ResizeHandle *rh )
 {
 	Q_UNUSED(rh);
 	bool ok;
-	getSizeRect( 0l, &ok, 0l );
+	getSizeRect( nullptr, &ok, nullptr );
 	return ok;
 }
 
@@ -307,7 +307,7 @@ bool RectangularOverlay::isValidYPos( ResizeHandle *rh )
 {
 	Q_UNUSED(rh);
 	bool ok;
-	getSizeRect( 0l, 0l, &ok );
+	getSizeRect( nullptr, nullptr, &ok );
 	return ok;
 }
 
diff --git a/src/resizeoverlay.h b/src/resizeoverlay.h
index 8a3f5c6..2ebf647 100644
--- a/src/resizeoverlay.h
+++ b/src/resizeoverlay.h
@@ -233,7 +233,7 @@ public:
 	 * then *ok is set to false; otherwise to true.
 	 * @returns the sizerect, regardless of whether or not it is valid
 	 */
-	TQRect getSizeRect( bool *ok = 0l, bool *widthOk = 0l, bool *heightOk = 0l ) const;
+	TQRect getSizeRect( bool *ok = nullptr, bool *widthOk = nullptr, bool *heightOk = nullptr ) const;
 	virtual bool isValidXPos( ResizeHandle *rh );
 	virtual bool isValidYPos( ResizeHandle *rh );
 	
diff --git a/src/simulator.cpp b/src/simulator.cpp
index 48c6681..033e3c5 100644
--- a/src/simulator.cpp
+++ b/src/simulator.cpp
@@ -19,7 +19,7 @@
 
 
 //BEGIN class Simulator
-Simulator * Simulator::m_pSelf = 0l;
+Simulator * Simulator::m_pSelf = nullptr;
 static KStaticDeleter<Simulator> staticSimulatorDeleter;
 
 Simulator * Simulator::self()
@@ -36,17 +36,17 @@ Simulator::Simulator()
 	m_llNumber = 0;
 	m_stepNumber = 0;
 	m_bIsSimulating = true;
-	m_gpsimProcessors = 0l;
-	m_componentCallbacks = 0l;
-	m_components = 0l;
-	m_ordinaryCircuits = 0l;
-	m_switches = 0l;
+	m_gpsimProcessors = nullptr;
+	m_componentCallbacks = nullptr;
+	m_components = nullptr;
+	m_ordinaryCircuits = nullptr;
+	m_switches = nullptr;
 	
 	unsigned max = unsigned(LOGIC_UPDATE_RATE/LINEAR_UPDATE_RATE);
 	for ( unsigned i = 0; i < max; i++ )
 	{
-		m_pStartStepCallback[i] = 0l;
-		m_pNextStepCallback[i] = 0l;
+		m_pStartStepCallback[i] = nullptr;
+		m_pNextStepCallback[i] = nullptr;
 	}
 	
 	LogicConfig lc;
@@ -125,11 +125,11 @@ void Simulator::step()
 			while (callback)
 			{
 				LinkedList<ComponentCallback> * next = callback->m_pNext;
-				callback->m_pNext = 0l;
+				callback->m_pNext = nullptr;
 				callback->data()->callback();
 				callback = next;
 			}
-			m_pStartStepCallback[m_llNumber] = 0l;
+			m_pStartStepCallback[m_llNumber] = nullptr;
 		
 #ifndef NO_GPSIM
 			// Update the gpsim processors
@@ -152,13 +152,13 @@ void Simulator::step()
 				for ( Circuit * circuit = changed; circuit; circuit = circuit->nextChanged(prevChain) )
 					circuit->setCanAddChanged(true);
 			
-				m_pChangedCircuitStart->setNextChanged( 0l, prevChain );
+				m_pChangedCircuitStart->setNextChanged( nullptr, prevChain );
 				m_pChangedCircuitLast = m_pChangedCircuitStart;
 			
 				do
 				{
 					Circuit * next = changed->nextChanged(prevChain);
-					changed->setNextChanged( 0l, prevChain );
+					changed->setNextChanged( nullptr, prevChain );
 					changed->doLogic();
 					changed = next;
 				}
@@ -171,12 +171,12 @@ void Simulator::step()
 				for ( LogicOut * out = changed; out; out = out->nextChanged(prevChain) )
 					out->setCanAddChanged(true);
 			
-				m_pChangedLogicStart->setNextChanged( 0l, prevChain );
+				m_pChangedLogicStart->setNextChanged( nullptr, prevChain );
 				m_pChangedLogicLast = m_pChangedLogicStart;
 				do
 				{
 					LogicOut * next = changed->nextChanged(prevChain);
-					changed->setNextChanged( 0l, prevChain );
+					changed->setNextChanged( nullptr, prevChain );
 			
 					double v = changed->isHigh() ? changed->outputHighVoltage() : 0.0;
 				
@@ -233,7 +233,7 @@ void Simulator::createLogicChain( LogicOut * logicOut, const LogicInList & logic
 		last->setLastState(state);
 		last = next;
 	}
-	last->setNextLogic(0l);
+	last->setNextLogic(nullptr);
 	last->setLastState(state);
 	
 	// Mark it as changed, if it isn't already changed...
@@ -405,8 +405,8 @@ void Simulator::removeLogicOutReferences( LogicOut * logic )
 	
 	if ( m_pChangedLogicLast == logic )
 	{
-		LogicOut * previous_1 = 0l;
-		LogicOut * previous_2 = 0l;
+		LogicOut * previous_1 = nullptr;
+		LogicOut * previous_2 = nullptr;
 		for ( LogicOut * logic = m_pChangedLogicStart; logic; )
 		{
 			if (previous_1)
@@ -441,8 +441,8 @@ void Simulator::detachCircuit( Circuit * circuit )
 	
 	if ( m_pChangedCircuitLast == circuit )
 	{
-		Circuit * previous_1 = 0l;
-		Circuit * previous_2 = 0l;
+		Circuit * previous_1 = nullptr;
+		Circuit * previous_2 = nullptr;
 		for ( Circuit * circuit = m_pChangedCircuitStart; circuit; )
 		{
 			if (previous_1)
diff --git a/src/simulator.h b/src/simulator.h
index 9686a2e..2eac88b 100644
--- a/src/simulator.h
+++ b/src/simulator.h
@@ -47,7 +47,7 @@ template <typename T>
 class LinkedList
 {
 	public:
-		LinkedList( T * data ) { m_pData = data; m_pNext = 0l; }
+		LinkedList( T * data ) { m_pData = data; m_pNext = nullptr; }
 		T * data() const { return m_pData; }
 		
 		LinkedList<T> * m_pNext;
diff --git a/src/textdocument.cpp b/src/textdocument.cpp
index 80381a4..e66afa1 100644
--- a/src/textdocument.cpp
+++ b/src/textdocument.cpp
@@ -40,13 +40,13 @@ TextDocument *TextDocument::constructTextDocument( const TQString& caption, KTec
 	if( textDocument->m_constructorSuccessful )
 		return textDocument;
 	delete textDocument;
-	return 0L;
+	return nullptr;
 }
 
 
 TextDocument::TextDocument( const TQString &caption, KTechlab *ktechlab, const char *name )
 	: Document( caption, ktechlab, name ),
-	  m_doc(0)
+	  m_doc(nullptr)
 {
 	m_constructorSuccessful = false;
 	
@@ -57,7 +57,7 @@ TextDocument::TextDocument( const TQString &caption, KTechlab *ktechlab, const c
 	m_pDebugger = 0l;
 #endif
 
-	m_pLastTextOutputTarget = 0l;
+	m_pLastTextOutputTarget = nullptr;
 	m_guessedCodeType = TextDocument::ct_unknown;
 	m_type = Document::dt_text;
 	m_bookmarkActions.setAutoDelete(true);
@@ -69,7 +69,7 @@ TextDocument::TextDocument( const TQString &caption, KTechlab *ktechlab, const c
 		KMessageBox::sorry( ktechlab, i18n("Libkatepart not available for constructing editor") );
 		return;
 	}
-	m_doc = (Kate::Document*)(KTextEditor::Document *)factory->create( 0L, "kate", "KTextEditor::Document");
+	m_doc = (Kate::Document*)(KTextEditor::Document *)factory->create( nullptr, "kate", "KTextEditor::Document");
 	
 	guessScheme();
 	
@@ -109,10 +109,10 @@ TextDocument::~TextDocument()
 	}
 	
 	delete m_doc;
-	m_doc = 0l;
+	m_doc = nullptr;
 	
 	delete m_pDocumentIface;
-	m_pDocumentIface = 0l;
+	m_pDocumentIface = nullptr;
 }
 
 
diff --git a/src/textdocument.h b/src/textdocument.h
index 1f1f0bf..e26f878 100644
--- a/src/textdocument.h
+++ b/src/textdocument.h
@@ -55,14 +55,14 @@ public:
 		ExecutionPoint     = KTextEditor::MarkInterface::markType06
 	};
 	
-	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+	virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 
 	/**
 	 * Attempts to construct a new TextDocument object and returns a pointer to
 	 * it if successful, or 0 if it failed.
 	 * @returns pointer to constructed object, or 0 if there was a problem
 	 */
-	static TextDocument *constructTextDocument( const TQString& caption, KTechlab *parent, const char *name = 0L );
+	static TextDocument *constructTextDocument( const TQString& caption, KTechlab *parent, const char *name = nullptr );
 	/**
 	 * @returns the guessed code type that this file is
 	 */
@@ -136,7 +136,7 @@ public:
 	virtual void print();
 	virtual void setModified( bool modified );
 	
-	Kate::View* createKateView( TQWidget *parent, const char *name = 0l );
+	Kate::View* createKateView( TQWidget *parent, const char *name = nullptr );
 	
 	virtual void undo();
 	virtual void redo();
@@ -232,7 +232,7 @@ private slots:
 	void slotSelectionmChanged();
 
 private:
-	TextDocument( const TQString& caption, KTechlab *parent, const char *name = 0L );
+	TextDocument( const TQString& caption, KTechlab *parent, const char *name = nullptr );
 	bool m_constructorSuccessful;
 	CodeType m_guessedCodeType;
 	TQPtrList<TDEAction> m_bookmarkActions;
diff --git a/src/textview.cpp b/src/textview.cpp
index b8c2ba6..6bad859 100644
--- a/src/textview.cpp
+++ b/src/textview.cpp
@@ -53,7 +53,7 @@ TextView::TextView( TextDocument * textDocument, ViewContainer *viewContainer, u
 	
 	
 	//BEGIN Convert To * Actions
-	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Convert to"), "fork", 0, 0, 0, ac, "program_convert" );
+	TDEToolBarPopupAction * pa = new TDEToolBarPopupAction( i18n("Convert to"), "fork", 0, nullptr, nullptr, ac, "program_convert" );
 	pa->setDelayed(false);
 	
 	TDEPopupMenu * m = pa->popupMenu();
@@ -132,7 +132,7 @@ TextView::~TextView()
 	}
 	
 	delete m_pViewIface;
-	m_pViewIface = 0l;
+	m_pViewIface = nullptr;
 }
 
 
@@ -403,7 +403,7 @@ bool TextViewEventFilter::eventFilter( TQObject *, TQEvent * e )
 	{
 		// user moved focus somewhere - hide the tip and sleep
 		if ( ((TQFocusEvent*)e)->reason() != TQFocusEvent::Popup )
-			updateHovering( 0, -1, -1 );
+			updateHovering( nullptr, -1, -1 );
 	}
 	
 	return false;
@@ -429,7 +429,7 @@ void TextViewEventFilter::gotoSleep()
 
 void TextViewEventFilter::slotNoWordTimeout()
 {
-	updateHovering( 0, -1, -1 );
+	updateHovering( nullptr, -1, -1 );
 }
 
 
diff --git a/src/textview.h b/src/textview.h
index 320ebb3..31f9054 100644
--- a/src/textview.h
+++ b/src/textview.h
@@ -36,7 +36,7 @@ class TextView : public View
 	TQ_OBJECT
   
 	public:
-		TextView( TextDocument *textDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0 );
+		TextView( TextDocument *textDocument, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 		~TextView();
 		virtual bool closeView();
 		/**
diff --git a/src/view.cpp b/src/view.cpp
index 31a5758..02a9d87 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -41,7 +41,7 @@
 */
 class KVSSBSep : public TQWidget {
 	public:
-		KVSSBSep( View * parent=0) : TQWidget(parent)
+		KVSSBSep( View * parent=nullptr) : TQWidget(parent)
 		{
 			setFixedHeight( 2 );
 		}
@@ -69,7 +69,7 @@ View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, c
 	m_pDocument = document;
 	p_ktechlab = document->ktechlab();
 	p_viewContainer = viewContainer;
-	m_pViewIface = 0l;
+	m_pViewIface = nullptr;
 	
 	if ( ViewArea * viewArea = viewContainer->viewArea(viewAreaId) )
 		viewArea->setView(this);
diff --git a/src/view.h b/src/view.h
index b66413e..db1e027 100644
--- a/src/view.h
+++ b/src/view.h
@@ -63,7 +63,7 @@ class View : public TQWidget, public KXMLGUIClient
 TQ_OBJECT
   
 public:
-	View( Document *document, ViewContainer *viewContainer, uint viewAreaId, const char *name = 0 );
+	View( Document *document, ViewContainer *viewContainer, uint viewAreaId, const char *name = nullptr );
 	virtual ~View();
 	
 	TDEAction * action( const TQString & name ) const;
@@ -120,7 +120,7 @@ public:
 	 * Called by ktechlab when it has entered its destructor to avoid calls to
 	 * it (such as from the TextView destructor).
 	 */
-	void setKTechlabDeleted() { p_ktechlab = 0l; }
+	void setKTechlabDeleted() { p_ktechlab = nullptr; }
 	
 public slots:
 	/**
diff --git a/src/viewcontainer.cpp b/src/viewcontainer.cpp
index a87a233..0ec85bc 100644
--- a/src/viewcontainer.cpp
+++ b/src/viewcontainer.cpp
@@ -109,11 +109,11 @@ View *ViewContainer::view( uint id ) const
 {
 	ViewArea *va = viewArea(id);
 	if (!va)
-		return 0l;
+		return nullptr;
 	
 	// We do not want a recursive search as ViewAreas also hold other ViewAreas
-	TQObjectList *l = va->queryList( "View", 0, false, false );
-	View *view = 0l;
+	TQObjectList *l = va->queryList( "View", nullptr, false, false );
+	View *view = nullptr;
 	if ( !l->isEmpty() )
 		view = dynamic_cast<View*>(l->first());
 	delete l;
@@ -125,7 +125,7 @@ View *ViewContainer::view( uint id ) const
 ViewArea *ViewContainer::viewArea( uint id ) const
 {
 	if ( !m_viewAreaMap.contains(id) )
-		return 0l;
+		return nullptr;
 	
 	return m_viewAreaMap[id];
 }
@@ -362,7 +362,7 @@ void ViewContainer::updateCaption()
 
 void ViewContainer::setKTechlabDeleted()
 {
-	p_ktechlab = 0l;
+	p_ktechlab = nullptr;
 	ViewAreaMap::iterator end = m_viewAreaMap.end();
 	for ( ViewAreaMap::iterator it = m_viewAreaMap.begin(); it != end; ++it )
 	{
@@ -380,9 +380,9 @@ ViewArea::ViewArea( TQWidget *parent, ViewContainer *viewContainer, int id, cons
 {
 	p_viewContainer = viewContainer;
 	m_id = id;
-	p_view = 0l;
-	p_viewArea1 = 0l;
-	p_viewArea2 = 0l;
+	p_view = nullptr;
+	p_viewArea1 = nullptr;
+	p_viewArea2 = nullptr;
 	if (id >= 0)
 		p_viewContainer->setViewAreaId( this, uint(id) );
 	p_viewContainer->setIdUsed(id);
@@ -402,12 +402,12 @@ ViewArea *ViewArea::createViewArea( Position position, uint id )
 	if (p_viewArea1 || p_viewArea2)
 	{
 		kdError() << k_funcinfo << "Attempting to create ViewArea when already containing ViewAreas!" << endl;
-		return 0l;
+		return nullptr;
 	}
 	if (!p_view)
 	{
 		kdError() << k_funcinfo << "We don't have a view yet, so creating a new ViewArea is redundant" << endl;
-		return 0l;
+		return nullptr;
 	}
 	
 	setOrientation( ( position == Right ) ? TQt::Horizontal : TQt::Vertical );
@@ -420,7 +420,7 @@ ViewArea *ViewArea::createViewArea( Position position, uint id )
 	
 	p_view->reparent( p_viewArea1, TQPoint(), true );
 	p_viewArea1->setView(p_view);
-	p_view = 0l;
+	p_view = nullptr;
 	m_id = p_viewContainer->uniqueParentId();
 	
 	TQValueList<int> splitPos;
@@ -439,10 +439,10 @@ void ViewArea::viewAreaDestroyed( TQObject *obj )
 	ViewArea *viewArea = static_cast<ViewArea*>(obj);
 	
 	if ( viewArea == p_viewArea1 )
-		p_viewArea1 = 0l;
+		p_viewArea1 = nullptr;
 	
 	if ( viewArea == p_viewArea2 )
-		p_viewArea2 = 0l;
+		p_viewArea2 = nullptr;
 	
 	if ( !p_viewArea1 && !p_viewArea2 )
 		deleteLater();
diff --git a/src/viewcontainer.h b/src/viewcontainer.h
index 20f1523..cedf02f 100644
--- a/src/viewcontainer.h
+++ b/src/viewcontainer.h
@@ -58,7 +58,7 @@ public:
 		Bottom
 	};
 	
-	ViewArea( TQWidget *parent, ViewContainer *viewContainer, int id, const char *name = 0 );
+	ViewArea( TQWidget *parent, ViewContainer *viewContainer, int id, const char *name = nullptr );
 	~ViewArea();
 	
 	ViewContainer *viewContainer() const { return p_viewContainer; }
@@ -120,7 +120,7 @@ public:
 	 * parenting a View, with an id of 0. parent is only used if ktechlab is
 	 * null; otherwise the parent widget is ktechlab's tabWidget()
 	 */
-	ViewContainer( const TQString & caption, KTechlab * ktechlab, TQWidget * parent = 0 );
+	ViewContainer( const TQString & caption, KTechlab * ktechlab, TQWidget * parent = nullptr );
 	~ViewContainer();
 	
 	/**
-- 
cgit v1.2.3

