From 1fe9da4586b2a6cfef9caee389b0f63296a02293 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Tue, 22 Sep 2026 23:47:53 -0300
Subject: Replace NULL 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>
---
 src/buttonwithindexsignal.h                |   2 +-
 src/kqalculate.cpp                         | 154 ++++++++++++++---------------
 src/kqalculate.h                           |   8 +-
 src/main.cpp                               |   2 +-
 src/preferences.cpp                        |  10 +-
 src/qalculate_tde_utils.cpp                |  14 +--
 src/qalculate_tde_utils.h                  |   4 +-
 src/qalculatebuttonwithdata.h              |   4 +-
 src/qalculateconvertnumberbasesdialog.h    |   2 +-
 src/qalculateconvertunitsdialog.cpp        |   2 +-
 src/qalculateconvertunitsdialog.h          |   2 +-
 src/qalculatedatasetsdialog.cpp            |  18 ++--
 src/qalculatedatasetsdialog.h              |   2 +-
 src/qalculatedecimalsdialog.h              |   2 +-
 src/qalculateeditdataobjectdialog.cpp      |   6 +-
 src/qalculateeditdataobjectdialog.h        |   2 +-
 src/qalculateeditdatasetdialog.cpp         |  38 +++----
 src/qalculateeditdatasetdialog.h           |   4 +-
 src/qalculateeditfunctiondialog.cpp        |  44 ++++-----
 src/qalculateeditfunctiondialog.h          |   6 +-
 src/qalculateeditmatrixvectordialog.cpp    |  22 ++---
 src/qalculateeditmatrixvectordialog.h      |   2 +-
 src/qalculateeditnamesdialog.cpp           |   4 +-
 src/qalculateeditnamesdialog.h             |   2 +-
 src/qalculateeditunitdialog.cpp            |  20 ++--
 src/qalculateeditunitdialog.h              |   2 +-
 src/qalculateeditunknownvariabledialog.cpp |  16 +--
 src/qalculateeditunknownvariabledialog.h   |   2 +-
 src/qalculateeditvariabledialog.cpp        |  16 +--
 src/qalculateeditvariabledialog.h          |   2 +-
 src/qalculateexportcsvdialog.cpp           |   4 +-
 src/qalculateexportcsvdialog.h             |   2 +-
 src/qalculateexpressionedit.cpp            |  16 +--
 src/qalculateexpressionedit.h              |   4 +-
 src/qalculatefunctionsdialog.cpp           |  12 +--
 src/qalculatefunctionsdialog.h             |   2 +-
 src/qalculateimportcsvdialog.cpp           |   2 +-
 src/qalculateimportcsvdialog.h             |   2 +-
 src/qalculateinsertfunctiondialog.cpp      |   4 +-
 src/qalculateinsertfunctiondialog.h        |   2 +-
 src/qalculateinsertmatrixvectordialog.cpp  |   8 +-
 src/qalculateinsertmatrixvectordialog.h    |   2 +-
 src/qalculateperiodictabledialog.h         |   4 +-
 src/qalculateplotdialog.cpp                |  14 +--
 src/qalculateplotdialog.h                  |   2 +-
 src/qalculateprecisiondialog.h             |   2 +-
 src/qalculatepreferencesdialog.h           |   2 +-
 src/qalculateresultdisplay.cpp             |   4 +-
 src/qalculateresultdisplay.h               |   2 +-
 src/qalculatesetbasedialog.h               |   2 +-
 src/qalculateunitsdialog.cpp               |  18 ++--
 src/qalculateunitsdialog.h                 |   2 +-
 src/qalculatevariablesdialog.cpp           |  22 ++---
 src/qalculatevariablesdialog.h             |   2 +-
 54 files changed, 275 insertions(+), 275 deletions(-)

diff --git a/src/buttonwithindexsignal.h b/src/buttonwithindexsignal.h
index 82f0841..c1efe04 100644
--- a/src/buttonwithindexsignal.h
+++ b/src/buttonwithindexsignal.h
@@ -26,7 +26,7 @@ class ButtonWithIndexSignal : public TQPushButton {
 	TQ_OBJECT
 
 public:
-	ButtonWithIndexSignal(const TQString & text, int index, TQWidget *parent = 0, const char *name = 0);
+	ButtonWithIndexSignal(const TQString & text, int index, TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~ButtonWithIndexSignal();
 	int i;
 public slots:
diff --git a/src/kqalculate.cpp b/src/kqalculate.cpp
index 2df06ab..02df8f0 100644
--- a/src/kqalculate.cpp
+++ b/src/kqalculate.cpp
@@ -179,7 +179,7 @@ extern int inhistory_current_id;
 int initial_inhistory_index = 0;
 
 const MathStructure *KQalculate::getResultPart(int i) {
-	if(i < 1 || (size_t) i > result_parts.size()) return NULL;
+	if(i < 1 || (size_t) i > result_parts.size()) return nullptr;
 	return &result_parts[(size_t) i - 1];
 }
 
@@ -207,28 +207,28 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 	
 	TQStyleSheet::setDefaultSheet(new QalculateStyleSheet());
 
-	insert_matrix_dialog = NULL;
-	preferences_dialog = NULL;
-	precisionDialog = NULL;
-	decimalsDialog = NULL;
-	variable_edit_dialog = NULL;
-	store_dialog = NULL;
-	matrix_edit_dialog = NULL;
-	import_csv_dialog = NULL;
-	export_csv_dialog = NULL;
-	unit_edit_dialog = NULL;
-	function_edit_dialog = NULL;
-	dataset_edit_dialog = NULL;
-	unknown_edit_dialog = NULL;
-	variables_dialog = NULL;
-	functions_dialog = NULL;
-	units_dialog = NULL;
-	datasets_dialog = NULL;
-	convert_to_unit_expression_dialog = NULL;
-	convert_number_bases_dialog = NULL;
-	periodic_table_dialog = NULL;
-	plot_dialog = NULL;
-	set_base_dialog = NULL;
+	insert_matrix_dialog = nullptr;
+	preferences_dialog = nullptr;
+	precisionDialog = nullptr;
+	decimalsDialog = nullptr;
+	variable_edit_dialog = nullptr;
+	store_dialog = nullptr;
+	matrix_edit_dialog = nullptr;
+	import_csv_dialog = nullptr;
+	export_csv_dialog = nullptr;
+	unit_edit_dialog = nullptr;
+	function_edit_dialog = nullptr;
+	dataset_edit_dialog = nullptr;
+	unknown_edit_dialog = nullptr;
+	variables_dialog = nullptr;
+	functions_dialog = nullptr;
+	units_dialog = nullptr;
+	datasets_dialog = nullptr;
+	convert_to_unit_expression_dialog = nullptr;
+	convert_number_bases_dialog = nullptr;
+	periodic_table_dialog = nullptr;
+	plot_dialog = nullptr;
+	set_base_dialog = nullptr;
 	
 	prev_result_approx = false;
 	expression_has_changed = false;
@@ -239,7 +239,7 @@ KQalculate::KQalculate(TDEUniqueApplication *parent, const char* name, WFlags fl
 	
 	history_height = 0;
 	
-	trayicon = NULL; 
+	trayicon = nullptr;
 	ActionHideSystemTrayIcon = new TDEAction(i18n("Remove from System Tray"), "hidesystemtrayicon", 0, this, TQ_SLOT(hideSystemTrayIcon()), actionCollection(), "hide_system_tray_icon");
 	ActionHide = new TDEAction(i18n("Hide"), "hide", 0, this, TQ_SLOT(hide()), actionCollection(), "hide");
 	showSystemTrayIcon(close_to_systray);
@@ -973,7 +973,7 @@ void KQalculate::setupActions() {
 	if(close_to_systray) {
 		ActionClose = KStdAction::close(this, TQ_SLOT(close()), actionCollection());
 	} else {
-		ActionClose = NULL;
+		ActionClose = nullptr;
 	}
 	globalAccel = new TDEGlobalAccel(this);
 	globalAccel->insert("Show/hide Qalculate!", i18n("Show/hide main Qalculate! window"), TQString::null, TDEShortcut(), TDEShortcut(), this, TQ_SLOT(showHide()));
@@ -2246,14 +2246,14 @@ void on_abort_display() {
 
 void *view_proc(void *pipe) {
 
-	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);	
+	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
+	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, nullptr);
 	FILE *view_pipe = (FILE*) pipe;
 
 	while(true) {
 
 		bool *do_wrap;
-		void *x = NULL;
+		void *x = nullptr;
 		fread(&x, sizeof(void*), 1, view_pipe);
 		KQalculate *win = (KQalculate*) x;
 		fread(&x, sizeof(void*), 1, view_pipe);
@@ -2314,7 +2314,7 @@ void *view_proc(void *pipe) {
 		}
 		m.format(printops);
 		result_history_text = m.print(printops).c_str();
-		printops.can_display_unicode_string_arg = NULL;
+		printops.can_display_unicode_string_arg = nullptr;
 		/*if(result_history_text.length() > 5000) {
 			result_text = i18n("result is too long\nsee history");
 			*printops.is_approximate = false;
@@ -2336,12 +2336,12 @@ void *view_proc(void *pipe) {
 				result_text += "</div>";
 				*do_wrap = true;
 			}
-			printops.can_display_unicode_string_arg = NULL;
+			printops.can_display_unicode_string_arg = nullptr;
 			printops.allow_non_usable = false;
 		}
 		b_busy = false;
 	}
-	return NULL;
+	return nullptr;
 }
 
 void KQalculate::clearresult() {	
@@ -2576,7 +2576,7 @@ void KQalculate::setResult2() {
 	} else {
 		MathStructure *mreg = CALCULATOR->getRPNRegister(stack_index + 1);
 		fwrite(&mreg, sizeof(void*), 1, view_pipe_w);
-		void *x = NULL;
+		void *x = nullptr;
 		fwrite(&x, sizeof(void*), 1, view_pipe_w);
 	}
 	bool *b = &do_wrap;
@@ -2587,7 +2587,7 @@ void KQalculate::setResult2() {
 		fwrite(&parsed_approx_p, sizeof(void*), 1, view_pipe_w);
 		fwrite(&parsed_tostruct, sizeof(void*), 1, view_pipe_w);
 	} else {
-		void *x = NULL;
+		void *x = nullptr;
 		fwrite(&x, sizeof(void*), 1, view_pipe_w);
 	}
 	fflush(view_pipe_w);
@@ -2597,12 +2597,12 @@ void KQalculate::setResult2() {
 	rtime.tv_nsec = 20000000;
 	int i = 0;
 	while(b_busy && i < 50) {
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		i++;
 	}
 	i = 0;
 
-	KProgressDialog *dialog = NULL;
+	KProgressDialog *dialog = nullptr;
 	if(b_busy) {
 		dialog = new KProgressDialog(this, "display_progress_dialog", i18n("Processing..."), i18n("Processing..."), true);
 		dialog->progressBar()->setPercentageVisible(false);
@@ -2616,7 +2616,7 @@ void KQalculate::setResult2() {
 	while(b_busy) {
 		dialog->progressBar()->advance(1);
 		tqApp->processEvents();
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		if(dialog->wasCancelled()) on_abort_display();
 	}
 
@@ -2745,7 +2745,7 @@ void KQalculate::setResult2() {
 			prev_result_approx = *printops.is_approximate;
 		}
 	}
-	printops.prefix = NULL;
+	printops.prefix = nullptr;
 	
 	b_busy = false;
 	display_errors();
@@ -2769,13 +2769,13 @@ void on_abort_command() {
 
 void *command_proc(void *pipe) {
 
-	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);	
+	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
+	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, nullptr);
 	FILE *command_pipe = (FILE*) pipe;
 	
 	while(true) {
 	
-		void *x = NULL;
+		void *x = nullptr;
 		int command_type;
 		fread(&command_type, sizeof(int), 1, command_pipe);
 		fread(&x, sizeof(void*), 1, command_pipe);
@@ -2794,7 +2794,7 @@ void *command_proc(void *pipe) {
 		b_busy = false;
 		
 	}
-	return NULL;
+	return nullptr;
 }
 
 int execute_command_command_type;
@@ -2831,12 +2831,12 @@ void KQalculate::executeCommand2() {
 	rtime.tv_nsec = 20000000;
 	int i = 0;
 	while(b_busy && i < 50) {
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		i++;
 	}
 	i = 0;
 	
-	KProgressDialog *dialog = NULL;
+	KProgressDialog *dialog = nullptr;
 	if(b_busy) {
 		TQString progress_str;
 		switch(command_type) {
@@ -2864,7 +2864,7 @@ void KQalculate::executeCommand2() {
 	while(b_busy) {
 		dialog->progressBar()->advance(1);
 		tqApp->processEvents();
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		if(dialog->wasCancelled()) {			
 			on_abort_command();
 			command_aborted = true;
@@ -2892,7 +2892,7 @@ void KQalculate::executeCommand2() {
 				break;
 			}
 		}
-		set_result_prefix = NULL;
+		set_result_prefix = nullptr;
 		set_result_update_history = true;
 		set_result_update_parse = false;
 		set_result_force = true;
@@ -2908,19 +2908,19 @@ void KQalculate::executeCommand2() {
 }
 
 void KQalculate::result_display_updated() {
-	setResult(NULL, false, false, false);
+	setResult(nullptr, false, false, false);
 	update_status_text();
 	expressionEdit->setFocus();
 }
 void KQalculate::result_format_updated() {
-	setResult(NULL, true, false, false);
+	setResult(nullptr, true, false, false);
 	update_status_text();
 	expressionEdit->setFocus();
 }
 void KQalculate::result_action_executed() {
 	//display_errors();
 	printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE);
-	setResult(NULL, true, false, true);
+	setResult(nullptr, true, false, true);
 	expressionEdit->setFocus();
 }
 void KQalculate::result_prefix_changed(Prefix *prefix) {
@@ -3077,14 +3077,14 @@ void KQalculate::execute_expression2() {
 						had_nonnum = true;
 					}
 				}
-				f = NULL;
+				f = nullptr;
 				if(test_function) {
 					if(in_par) f = CALCULATOR->getActiveFunction(str2.substr(0, in_par));
 					else f = CALCULATOR->getActiveFunction(str2);
 				}
 				if(f && f->minargs() > 1) {
 					KMessageBox::error(this, "Can only apply functions wich requires one argument on RPN stack.");
-					f = NULL;
+					f = nullptr;
 					return;
 				}
 				if(f && f->minargs() > 0) {
@@ -3103,11 +3103,11 @@ void KQalculate::execute_expression2() {
 	rtime.tv_nsec = 20000000;
 	int i = 0;
 	while(CALCULATOR->busy() && i < 50) {
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		i++;
 	}
 	i = 0;
-	KProgressDialog *dialog = NULL;
+	KProgressDialog *dialog = nullptr;
 	if(CALCULATOR->busy()) {
 		dialog = new KProgressDialog(this, "calculation_progress_dialog", i18n("Calculating..."), i18n("Calculating..."), true);
 		dialog->progressBar()->setPercentageVisible(false);
@@ -3121,7 +3121,7 @@ void KQalculate::execute_expression2() {
 	while(CALCULATOR->busy()) {
 		dialog->progressBar()->advance(1);
 		tqApp->processEvents();
-		nanosleep(&rtime, NULL);
+		nanosleep(&rtime, nullptr);
 		if(dialog->wasCancelled()) CALCULATOR->abort();
 	}
 	if(dialog) {
@@ -3164,7 +3164,7 @@ void KQalculate::execute_expression2() {
 		result_history_text = str;
 	}
 	printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE);
-	set_result_prefix = NULL;
+	set_result_prefix = nullptr;
 	set_result_update_history = true;
 	set_result_update_parse = (!do_stack || stack_index == 0);
 	set_result_force = true;
@@ -3257,7 +3257,7 @@ void KQalculate::create_vmenu() {
 		++variable_cats.rit;
 		titem->rit = titem->items.rbegin();
 	} else {
-		titem = NULL;
+		titem = nullptr;
 	}
 
 	menu_variables_ids.clear();
@@ -3352,7 +3352,7 @@ void KQalculate::create_fmenu() {
 		++function_cats.rit;
 		titem->rit = titem->items.rbegin();
 	} else {
-		titem = NULL;
+		titem = nullptr;
 	}
 
 	menu_functions_ids.clear();
@@ -3450,7 +3450,7 @@ void KQalculate::create_umenu() {
 		++unit_cats.rit;
 		titem->rit = titem->items.rbegin();
 	} else {
-		titem = NULL;
+		titem = nullptr;
 	}
 
 	menu_units_ids.clear();
@@ -3574,7 +3574,7 @@ void KQalculate::create_toumenu() {
 		++unit_cats.rit;
 		titem->rit = titem->items.rbegin();
 	} else {
-		titem = NULL;
+		titem = nullptr;
 	}
 
 	menu_to_unit_ids.clear();
@@ -4697,7 +4697,7 @@ void KQalculate::loadMode(int index) {
 	printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE);
 	TQString str = expressionEdit->text().stripWhiteSpace();
 	if(expression_has_changed || str.isEmpty()) {
-		setResult(NULL, true, false, false);
+		setResult(nullptr, true, false, false);
 	} else {
 		execute_expression(false);
 	}
@@ -5066,7 +5066,7 @@ void KQalculate::calculateRPN(int op) {
 	execute_expression_do_stack = false;
 	execute_expression_do_mathoperation = true;
 	execute_expression_op = (MathOperation) op;
-	execute_expression_f = NULL;
+	execute_expression_f = nullptr;
 	execute_expression2();
 }
 void KQalculate::calculateRPN(MathFunction *f) {
@@ -5112,7 +5112,7 @@ TQListViewItem *KQalculate::getRPNRegister(size_t index) {
 		index--;
 		li = li->nextSibling();
 	}
-	return NULL;
+	return nullptr;
 }
 void KQalculate::clearStack() {
 	CALCULATOR->clearRPNStack();
@@ -5136,7 +5136,7 @@ void KQalculate::registerUp() {
 			mstruct->unref();
 			mstruct = CALCULATOR->getRPNRegister(1);
 			mstruct->ref();
-			setResult(NULL, true, false, false, "", 0, true);
+			setResult(nullptr, true, false, false, "", 0, true);
 		}
 	}
 }
@@ -5155,7 +5155,7 @@ void KQalculate::registerDown() {
 			mstruct->unref();
 			mstruct = CALCULATOR->getRPNRegister(1);
 			mstruct->ref();
-			setResult(NULL, true, false, false, "", 0, true);
+			setResult(nullptr, true, false, false, "", 0, true);
 		}
 	}
 }
@@ -5173,7 +5173,7 @@ void KQalculate::deleteRegister() {
 			mstruct->unref();
 			mstruct = CALCULATOR->getRPNRegister(1);
 			mstruct->ref();
-			setResult(NULL, true, false, false, "", 0, true);
+			setResult(nullptr, true, false, false, "", 0, true);
 		}
 		updateRPNIndexes();
 	}
@@ -5204,7 +5204,7 @@ void KQalculate::stackRegisterMoved() {
 				mstruct->unref();
 				mstruct = CALCULATOR->getRPNRegister(1);
 				mstruct->ref();
-				setResult(NULL, true, false, false, "", 0, true);
+				setResult(nullptr, true, false, false, "", 0, true);
 			}
 			updateRPNIndexes();
 			registerSelected();
@@ -5222,8 +5222,8 @@ void KQalculate::stackRegisterSet(TQListViewItem *li) {
 	execute_expression2();
 }
 void KQalculate::popupStackMenu(TDEListView*, TQListViewItem *li, const TQPoint &p) {
-	stackMenu->setItemEnabled(stackMenu->idAt(0), li != NULL);
-	stackMenu->setItemEnabled(stackMenu->idAt(1), li != NULL);
+	stackMenu->setItemEnabled(stackMenu->idAt(0), li != nullptr);
+	stackMenu->setItemEnabled(stackMenu->idAt(1), li != nullptr);
 	stackMenu->setItemEnabled(stackMenu->idAt(3), CALCULATOR->RPNStackSize() > 0);
 	stackMenu->popup(p);
 }
@@ -5497,7 +5497,7 @@ void KQalculate::storeResult() {
 	if(!store_dialog) {
 		store_dialog = new QalculateEditVariableDialog(this);
 	}
-	Variable *v = store_dialog->editVariable(i18n("Temporary"), NULL, mstruct, true);
+	Variable *v = store_dialog->editVariable(i18n("Temporary"), nullptr, mstruct, true);
 	if(v) {
 		update_vmenu();
 		variable_inserted(v);
@@ -5954,7 +5954,7 @@ void KQalculate::applySetUnknowns(bool okclicked) {
 			str = mp.print(printops).c_str();
 			expressionEdit->blockSignals(true);			
 			expressionEdit->setText(str);
-			printops.can_display_unicode_string_arg = NULL;
+			printops.can_display_unicode_string_arg = nullptr;
 			//expressionEdit->addToHistory(str);
 			expressionEdit->expression_history_index = -1;
 			expressionEdit->blockSignals(false);
@@ -5967,7 +5967,7 @@ void KQalculate::applySetUnknowns(bool okclicked) {
 	}
 	if(b_unknowns_changed) {
 		printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE);
-		setResult(NULL, true, false, false, result_mod);
+		setResult(nullptr, true, false, false, result_mod);
 	}	
 	//if(!okclicked && b) mstruct->set(*mstruct_before_unknowns);
 }
@@ -6014,7 +6014,7 @@ void KQalculate::setUnknowns() {
 			}
 			mstruct->set(*mstruct_before_unknowns);
 			printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE);
-			setResult(NULL, true, false, false, result_mod);
+			setResult(nullptr, true, false, false, result_mod);
 			expressionEdit->setFocus();
 		}
 	}
@@ -6085,7 +6085,7 @@ void KQalculate::insertMatrix() {
 			return;
 		}
 	}
-	insertMatrixVector(NULL, false);
+	insertMatrixVector(nullptr, false);
 }
 void KQalculate::insertVector() {
 	TQString str = expressionEdit->selectedText().stripWhiteSpace();
@@ -6099,7 +6099,7 @@ void KQalculate::insertVector() {
 			return;
 		}
 	}
-	insertMatrixVector(NULL, true);
+	insertMatrixVector(nullptr, true);
 }
 
 void KQalculate::keyPressEvent(TQKeyEvent *e) {
@@ -6263,9 +6263,9 @@ void KQalculate::displayParseStatus() {
 			full_parsed = true;
 		}
 		int warnings_count;
-		had_errors = CALCULATOR->endTemporaryStopMessages(NULL, &warnings_count) > 0;
+		had_errors = CALCULATOR->endTemporaryStopMessages(nullptr, &warnings_count) > 0;
 		had_warnings = warnings_count > 0;
-		evalops.parse_options.unended_function = NULL;
+		evalops.parse_options.unended_function = nullptr;
 	}
 	if(mfunc.isFunction()) {
 		if(mfunc.countChildren() == 0) {
@@ -6281,7 +6281,7 @@ void KQalculate::displayParseStatus() {
 			CALCULATOR->separateToExpression(str_e, str_u, evalops);
 			CALCULATOR->parse(&mparse, str_e, evalops.parse_options);
 			int warnings_count;
-			had_errors = CALCULATOR->endTemporaryStopMessages(NULL, &warnings_count) > 0;
+			had_errors = CALCULATOR->endTemporaryStopMessages(nullptr, &warnings_count) > 0;
 			had_warnings = warnings_count > 0;
 		}
 		PrintOptions po;
@@ -6309,7 +6309,7 @@ void KQalculate::displayParseStatus() {
 			CALCULATOR->beginTemporaryStopMessages();
 			CompositeUnit cu("", "temporary_composite_parse", "", str_u);
 			int warnings_count;
-			had_errors = CALCULATOR->endTemporaryStopMessages(NULL, &warnings_count) > 0 || had_errors;
+			had_errors = CALCULATOR->endTemporaryStopMessages(nullptr, &warnings_count) > 0 || had_errors;
 			had_warnings = had_warnings || warnings_count > 0;
 			mparse = cu.generateMathStructure(!printops.negative_exponents);
 			mparse.format(po);
diff --git a/src/kqalculate.h b/src/kqalculate.h
index 59a086f..a3e73c2 100644
--- a/src/kqalculate.h
+++ b/src/kqalculate.h
@@ -123,15 +123,15 @@ public:
 	void setAssumptionsMenu();
 	void setModeActions();
 	void execute_expression(bool force = true);
-	void setResult(Prefix *prefix = NULL, bool update_history = true, bool update_parse = false, bool force = false, TQString transformation = "", size_t stack_index = 0, bool register_moved = false);
+	void setResult(Prefix *prefix = nullptr, bool update_history = true, bool update_parse = false, bool force = false, TQString transformation = "", size_t stack_index = 0, bool register_moved = false);
 	void executeCommand(int command_type);
 	void result_display_updated();
 	void result_format_updated();
 	void result_action_executed();
-	void result_prefix_changed(Prefix *prefix = NULL);
+	void result_prefix_changed(Prefix *prefix = nullptr);
 	void expression_calculation_updated();
 	void expression_format_updated(bool recalculate = false);
-	void display_errors(TQString *new_text = NULL, int *inhistory_index = NULL);
+	void display_errors(TQString *new_text = nullptr, int *inhistory_index = nullptr);
 	void update_status_text();
 	void display_function_hint(MathFunction *f, int arg_index = 1);
 	void clearresult();
@@ -151,7 +151,7 @@ public:
 	void insertButtonFunction(TQString text, bool append_space = true);
 	void insertButtonFunction(MathFunction *f);
 	const MathStructure *getResultPart(int);
-	void insertMatrixVector(const MathStructure *m = NULL, bool do_vector = false, bool is_text_struct = false, bool is_result = false);
+	void insertMatrixVector(const MathStructure *m = nullptr, bool do_vector = false, bool is_text_struct = false, bool is_result = false);
 
 	void calculateRPN(int op);
 	void calculateRPN(MathFunction *f);
diff --git a/src/main.cpp b/src/main.cpp
index d844088..18921ec 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -276,7 +276,7 @@ public:
 
 int main(int argc, char **argv) {
 
-	mainWin = NULL;
+	mainWin = nullptr;
 
 	TDEAboutData about(PACKAGE, I18N_NOOP("Qalculate!"), version, description, TDEAboutData::License_GPL, "(C) 2005-2006 Niklas Knutsson", 0, "http://qalculate.sourceforge.net/", "nique769@users.sourceforge.net");
 	about.addAuthor("Niklas Knutsson", 0, "nq@altern.org");
diff --git a/src/preferences.cpp b/src/preferences.cpp
index c7d18f9..0259c90 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -156,7 +156,7 @@ void load_preferences() {
 	default_plot_use_sampling_rate = true;
 
 	printops.is_approximate = new bool(false);
-	printops.prefix = NULL;
+	printops.prefix = nullptr;
 	printops.use_min_decimals = false;
 	printops.use_denominator_prefix = true;
 	printops.min_decimals = 0;
@@ -247,7 +247,7 @@ void load_preferences() {
 	}
 
 	int version_numbers[] = {0, 9, 6};
-	FILE *file = NULL;
+	FILE *file = nullptr;
 	filename += "qalculate-tde.cfg";
 	file = fopen(filename.c_str(), "r");
 	if(file) {
@@ -256,7 +256,7 @@ void load_preferences() {
 		int i;
 		int v;
 		while(true) {
-			if(fgets(line, 10000, file) == NULL)
+			if(fgets(line, 10000, file) == nullptr)
 				break;
 			stmp = line;
 			stmp = stmp.stripWhiteSpace();
@@ -662,12 +662,12 @@ void load_preferences() {
 
 void save_preferences(bool mode) {
 
-	FILE *file = NULL;
+	FILE *file = nullptr;
 	std::string filename = getLocalDir();
 	mkdir(filename.c_str(), S_IRWXU);
 	filename += "qalculate-tde.cfg";
 	file = fopen(filename.c_str(), "w+");
-	if(file == NULL) {
+	if(file == nullptr) {
 		fprintf(stderr, i18n("Couldn't write preferences to\n%s").local8Bit(), filename.c_str());
 		return;
 	}
diff --git a/src/qalculate_tde_utils.cpp b/src/qalculate_tde_utils.cpp
index 4bfaf65..9583cc0 100644
--- a/src/qalculate_tde_utils.cpp
+++ b/src/qalculate_tde_utils.cpp
@@ -53,7 +53,7 @@ TQString get_value_string(const MathStructure &mstruct_, bool rlabel, Prefix *pr
 	printops.prefix = prefix;
 	TQString str = CALCULATOR->printMathStructureTimeOut(mstruct_, 100, printops).c_str();
 	printops.allow_non_usable = false;
-	printops.prefix = NULL;
+	printops.prefix = nullptr;
 	return str;
 }
 
@@ -85,10 +85,10 @@ void generate_units_tree_struct() {
 	size_t cat_i, cat_i_prev; 
 	bool b;	
 	std::string str, cat, cat_sub;
-	Unit *u = NULL;
+	Unit *u = nullptr;
 	unit_cats.items.clear();
 	unit_cats.objects.clear();
-	unit_cats.parent = NULL;	
+	unit_cats.parent = nullptr;
 	ia_units.clear();
 	std::list<tree_struct>::iterator it;	
 	for(size_t i = 0; i < CALCULATOR->units.size(); i++) {
@@ -160,10 +160,10 @@ void generate_variables_tree_struct() {
 	size_t cat_i, cat_i_prev; 
 	bool b;	
 	std::string str, cat, cat_sub;
-	Variable *v = NULL;
+	Variable *v = nullptr;
 	variable_cats.items.clear();
 	variable_cats.objects.clear();
-	variable_cats.parent = NULL;
+	variable_cats.parent = nullptr;
 	ia_variables.clear();
 	std::list<tree_struct>::iterator it;	
 	for(size_t i = 0; i < CALCULATOR->variables.size(); i++) {
@@ -236,10 +236,10 @@ void generate_functions_tree_struct() {
 	size_t cat_i, cat_i_prev; 
 	bool b;	
 	std::string str, cat, cat_sub;
-	MathFunction *f = NULL;
+	MathFunction *f = nullptr;
 	function_cats.items.clear();
 	function_cats.objects.clear();
-	function_cats.parent = NULL;
+	function_cats.parent = nullptr;
 	ia_functions.clear();
 	std::list<tree_struct>::iterator it;
 
diff --git a/src/qalculate_tde_utils.h b/src/qalculate_tde_utils.h
index e0c9238..29205e8 100644
--- a/src/qalculate_tde_utils.h
+++ b/src/qalculate_tde_utils.h
@@ -67,12 +67,12 @@ struct mode_struct {
 
 void insert_text_in_expression(const TQString  &str);
 bool is_answer_variable(Variable *v);
-TQString get_value_string(const MathStructure &mstruct_, bool rlabel = false, Prefix *prefix = NULL);
+TQString get_value_string(const MathStructure &mstruct_, bool rlabel = false, Prefix *prefix = nullptr);
 void set_name_label_and_entry(ExpressionItem *item, TQLineEdit *entry, TQLabel *label);
 bool can_display_unicode_string_function(const char *str, void *arg);
 void generate_units_tree_struct();
 void generate_functions_tree_struct();
 void generate_variables_tree_struct();
-size_t save_mode_as(TQString name, bool *new_mode = NULL);
+size_t save_mode_as(TQString name, bool *new_mode = nullptr);
 
 #endif
diff --git a/src/qalculatebuttonwithdata.h b/src/qalculatebuttonwithdata.h
index 6a2e947..ab4e933 100644
--- a/src/qalculatebuttonwithdata.h
+++ b/src/qalculatebuttonwithdata.h
@@ -30,8 +30,8 @@ class QalculateButtonWithData : public TQPushButton {
 
 public:
 
-	QalculateButtonWithData(void *data, const TQString & text, TQWidget *parent, const char *name = 0);
-	QalculateButtonWithData(void *data, const TQIconSet & icon, const TQString & text, TQWidget * parent, const char * name = 0);
+	QalculateButtonWithData(void *data, const TQString & text, TQWidget *parent, const char *name = nullptr);
+	QalculateButtonWithData(void *data, const TQIconSet & icon, const TQString & text, TQWidget * parent, const char * name = nullptr);
 	virtual ~QalculateButtonWithData();
 	void *user_data;
 
diff --git a/src/qalculateconvertnumberbasesdialog.h b/src/qalculateconvertnumberbasesdialog.h
index 4e4f1b7..3306cc8 100644
--- a/src/qalculateconvertnumberbasesdialog.h
+++ b/src/qalculateconvertnumberbasesdialog.h
@@ -31,7 +31,7 @@ class MathStructure;
 class QalculateConvertNumberBasesDialog : public KDialogBase {
 	TQ_OBJECT
 public:
-	QalculateConvertNumberBasesDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateConvertNumberBasesDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 
 	virtual ~QalculateConvertNumberBasesDialog();
 
diff --git a/src/qalculateconvertunitsdialog.cpp b/src/qalculateconvertunitsdialog.cpp
index ca50237..22a1acf 100644
--- a/src/qalculateconvertunitsdialog.cpp
+++ b/src/qalculateconvertunitsdialog.cpp
@@ -95,7 +95,7 @@ void QalculateConvertUnitsDialog::updateUnitTree() {
 		++unit_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 	str = "";
 	i2 = i;
diff --git a/src/qalculateconvertunitsdialog.h b/src/qalculateconvertunitsdialog.h
index e3b5b7f..5bba324 100644
--- a/src/qalculateconvertunitsdialog.h
+++ b/src/qalculateconvertunitsdialog.h
@@ -37,7 +37,7 @@ class QalculateConvertUnitsDialog : public KDialogBase {
 
 public:
 
-	QalculateConvertUnitsDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateConvertUnitsDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateConvertUnitsDialog();
 
 	KLineEdit *unitExpressionEdit;
diff --git a/src/qalculatedatasetsdialog.cpp b/src/qalculatedatasetsdialog.cpp
index 25d4373..0bf81ff 100644
--- a/src/qalculatedatasetsdialog.cpp
+++ b/src/qalculatedatasetsdialog.cpp
@@ -45,8 +45,8 @@ extern TQWidget *expressionWidget;
 
 QalculateDataSetsDialog::QalculateDataSetsDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Data Sets"), Close, Close, false) {
 
-	dataset_edit_dialog = NULL;
-	object_edit_dialog = NULL;
+	dataset_edit_dialog = nullptr;
+	object_edit_dialog = nullptr;
 
 	TQVBox *box = makeVBoxMainWidget();
 	TQSplitter *splitter = new TQSplitter(TQt::Vertical, box);
@@ -147,7 +147,7 @@ void QalculateDataSetsDialog::updateDataSetTree() {
 	dataSetsView->blockSignals(false);
 	if(!b) {
 		dataSetsView->selectAll(false);
-		selected_dataset = NULL;
+		selected_dataset = nullptr;
 	}
 
 }
@@ -160,7 +160,7 @@ void QalculateDataSetsDialog::deleteDataSet() {
 	UPDATE_SELECTED_DATASET
 	CHECK_IF_DATASET_STILL_THERE
 	if(selected_dataset->isLocal()) {
-		selected_object = NULL;
+		selected_object = nullptr;
 		//ensure that all references are removed in Calculator
 		selected_dataset->destroy();
 		//update menus and trees
@@ -216,7 +216,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
 		DataSet *ds = dataSetItems[selected];
 		if(!CALCULATOR->stillHasFunction(ds)) {
 			KMessageBox::error(this, i18n("Data set does not exist anymore."));
-			selected_dataset = NULL;
+			selected_dataset = nullptr;
 			emit dataSetsChanged();
 			return;
 		}
@@ -377,7 +377,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
 		editDataSetButton->setEnabled(false);
 		deleteDataSetButton->setEnabled(false);
 		newObjectButton->setEnabled(false);
-		selected_dataset = NULL;
+		selected_dataset = nullptr;
 		descriptionBrowser->clear();
 	}
 	objectSelected();
@@ -401,7 +401,7 @@ void QalculateDataSetsDialog::insertObjectData(void *data) {
 void QalculateDataSetsDialog::objectSelected() {
 
 	TQListViewItem *selected = objectsView->selectedItem();
-	DataObject *o = NULL;
+	DataObject *o = nullptr;
 	if(selected) o = objectItems[selected];
 
 	if(o) {
@@ -442,7 +442,7 @@ void QalculateDataSetsDialog::objectSelected() {
 		attributesGrid->setSpacing(spacingHint());
 		attributesView->addChild(attributesGrid);
 		attributesGrid->show();
-		selected_object = NULL;
+		selected_object = nullptr;
 		editObjectButton->setEnabled(false);
 		deleteObjectButton->setEnabled(false);
 	}
@@ -453,7 +453,7 @@ void QalculateDataSetsDialog::deleteObject() {
 	UPDATE_SELECTED_DATASET
 	UPDATE_SELECTED_OBJECT
 	selected_dataset->delObject(selected_object);
-	selected_object = NULL;
+	selected_object = nullptr;
 	updateObjects();
 }
 
diff --git a/src/qalculatedatasetsdialog.h b/src/qalculatedatasetsdialog.h
index a2a6ca3..4dac02d 100644
--- a/src/qalculatedatasetsdialog.h
+++ b/src/qalculatedatasetsdialog.h
@@ -42,7 +42,7 @@ class QalculateDataSetsDialog : public KDialogBase {
 
 public:
 
-	QalculateDataSetsDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateDataSetsDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateDataSetsDialog();
 
 	TQPushButton *newObjectButton, *editObjectButton, *deleteObjectButton, *newDataSetButton, *editDataSetButton, *deleteDataSetButton;
diff --git a/src/qalculatedecimalsdialog.h b/src/qalculatedecimalsdialog.h
index bcc717b..01647e5 100644
--- a/src/qalculatedecimalsdialog.h
+++ b/src/qalculatedecimalsdialog.h
@@ -33,7 +33,7 @@ class QalculateDecimalsDialog : public KDialogBase {
 
 public:
 
-	QalculateDecimalsDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateDecimalsDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateDecimalsDialog();
 
 	TQSpinBox *maxDecimalsBox, *minDecimalsBox;
diff --git a/src/qalculateeditdataobjectdialog.cpp b/src/qalculateeditdataobjectdialog.cpp
index 612b19c..308c5c6 100644
--- a/src/qalculateeditdataobjectdialog.cpp
+++ b/src/qalculateeditdataobjectdialog.cpp
@@ -36,7 +36,7 @@ QalculateEditDataObjectDialog::~QalculateEditDataObjectDialog() {}
 
 DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObject *o) {
 
-	if(!ds) return NULL;
+	if(!ds) return nullptr;
 	if(o) {
 		setCaption(i18n("Edit Object"));
 	} else {
@@ -75,7 +75,7 @@ DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObjec
 		dp = ds->getNextProperty(&it);
 	}
 	if(exec() == TQDialog::Accepted) {
-		bool new_object = (o == NULL);
+		bool new_object = (o == nullptr);
 		if(new_object) {
 			o = new DataObject(ds);
 			ds->addObject(o);
@@ -98,7 +98,7 @@ DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObjec
 		return o;
 	}
 	delete grid;
-	return NULL;
+	return nullptr;
 }
 
 #include "qalculateeditdataobjectdialog.moc"
diff --git a/src/qalculateeditdataobjectdialog.h b/src/qalculateeditdataobjectdialog.h
index ad6237f..0c21489 100644
--- a/src/qalculateeditdataobjectdialog.h
+++ b/src/qalculateeditdataobjectdialog.h
@@ -37,7 +37,7 @@ public:
 	QalculateEditDataObjectDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditDataObjectDialog();
 
-	DataObject *editDataObject(DataSet *ds, DataObject *o = NULL);
+	DataObject *editDataObject(DataSet *ds, DataObject *o = nullptr);
 
 };
 
diff --git a/src/qalculateeditdatasetdialog.cpp b/src/qalculateeditdatasetdialog.cpp
index 2b19c8d..a7784f7 100644
--- a/src/qalculateeditdatasetdialog.cpp
+++ b/src/qalculateeditdatasetdialog.cpp
@@ -44,9 +44,9 @@ extern tree_struct function_cats;
 
 QalculateEditDataSetDialog::QalculateEditDataSetDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Data Set"), Ok | Cancel, Ok, false) {
 
-	names_edit_dialog = NULL;
-	edited_dataset = NULL;
-	property_edit_dialog = NULL;
+	names_edit_dialog = nullptr;
+	edited_dataset = nullptr;
+	property_edit_dialog = nullptr;
 
 	tabs = new KTabWidget(this);
 	setMainWidget(tabs);
@@ -144,7 +144,7 @@ void QalculateEditDataSetDialog::updateDatasetPropertyList() {
 	editPropertyButton->setEnabled(false);
 	deletePropertyButton->setEnabled(false);
 	TQString str;
-	TQListViewItem *i_prev = NULL;
+	TQListViewItem *i_prev = nullptr;
 	for(size_t i = 0; i < tmp_props.size(); i++) {
 		if(tmp_props[i]) {
 			str = "";
@@ -279,7 +279,7 @@ DataSet *QalculateEditDataSetDialog::editDataSet(DataSet *ds) {
 	tabs->setCurrentPage(0);
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_dataset = ds;
 	if(ds) {
@@ -336,16 +336,16 @@ DataSet *QalculateEditDataSetDialog::editDataSet(DataSet *ds) {
 
 	if(exec() == TQDialog::Accepted) {
 		ds = edited_dataset;
-		edited_dataset = NULL;
+		edited_dataset = nullptr;
 		return ds;
 	}
-	edited_dataset = NULL;
+	edited_dataset = nullptr;
 	for(size_t i = 0; i < tmp_props.size(); i++) {
 		if(tmp_props[i]) delete tmp_props[i];
 	}
 	tmp_props.clear();
 	tmp_props_orig.clear();
-	return NULL;
+	return nullptr;
 }
 
 void QalculateEditDataSetDialog::editNames() {
@@ -366,7 +366,7 @@ void QalculateEditDataSetDialog::newProperty() {
 	dp->setUserModified(true);
 	if(property_edit_dialog->editDataProperty(dp, true)) {
 		tmp_props.push_back(dp);
-		tmp_props_orig.push_back(NULL);
+		tmp_props_orig.push_back(nullptr);
 		updateDatasetPropertyList();
 	} else {
 		delete dp;
@@ -375,7 +375,7 @@ void QalculateEditDataSetDialog::newProperty() {
 
 void QalculateEditDataSetDialog::editProperty() {
 	TQListViewItem *i = propertiesView->selectedItem();
-	if(i == NULL) return;
+	if(i == nullptr) return;
 	if(!property_edit_dialog) {
 		property_edit_dialog = new QalculateEditDataPropertyDialog(this);
 	}
@@ -385,12 +385,12 @@ void QalculateEditDataSetDialog::editProperty() {
 }
 void QalculateEditDataSetDialog::deleteProperty() {
 	TQListViewItem *i = propertiesView->selectedItem();
-	if(i == NULL) return;
+	if(i == nullptr) return;
 	if(propertiesItems[i]->isUserModified()) {
 		for(size_t index = 0; index < tmp_props.size(); index++) {
 			if(tmp_props[index] == propertiesItems[i]) {
 				if(tmp_props_orig[index]) {
-					tmp_props[index] = NULL;
+					tmp_props[index] = nullptr;
 				} else {
 					tmp_props.erase(tmp_props.begin() + index);
 					tmp_props_orig.erase(tmp_props_orig.begin() + index);
@@ -414,8 +414,8 @@ void QalculateEditDataSetDialog::nameChanged(const TQString &name) {
 
 QalculateEditDataPropertyDialog::QalculateEditDataPropertyDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Property"), Ok | Cancel, Ok, true) {
 
-	names_edit_dialog = NULL;
-	edited_property = NULL;
+	names_edit_dialog = nullptr;
+	edited_property = nullptr;
 
 	setMainWidget(new TQWidget(this));
 	TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
@@ -517,7 +517,7 @@ bool QalculateEditDataPropertyDialog::editDataProperty(DataProperty *dp, bool ne
 
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_property = dp;
 	if(!newdp) {
@@ -567,10 +567,10 @@ bool QalculateEditDataPropertyDialog::editDataProperty(DataProperty *dp, bool ne
 	}
 
 	if(exec() == TQDialog::Accepted) {
-		edited_property = NULL;
+		edited_property = nullptr;
 		return true;
 	}
-	edited_property = NULL;
+	edited_property = nullptr;
 	return false;
 }
 
@@ -638,7 +638,7 @@ void QalculateEditDataPropertyNamesDialog::setNames(DataProperty *item, const TQ
 		namesView->clear();
 	}
 	if(!names_edited && item && item->countNames() > 0) {
-		TQListViewItem *i_prev = NULL;
+		TQListViewItem *i_prev = nullptr;
 		for(size_t index = 1; index <= item->countNames(); index++) {
 			TQListViewItem *i = new TDEListViewItem(namesView, i_prev);
 			i_prev = i;
@@ -718,7 +718,7 @@ void QalculateEditDataPropertyNamesDialog::itemClicked(TQListViewItem *i, const
 }
 
 void QalculateEditDataPropertyNamesDialog::nameSelectionChanged() {
-	deleteButton->setEnabled(namesView->selectedItem() != NULL);
+	deleteButton->setEnabled(namesView->selectedItem() != nullptr);
 }
 
 
diff --git a/src/qalculateeditdatasetdialog.h b/src/qalculateeditdatasetdialog.h
index c4f3c7a..ffa2c7c 100644
--- a/src/qalculateeditdatasetdialog.h
+++ b/src/qalculateeditdatasetdialog.h
@@ -52,7 +52,7 @@ public:
 	QalculateEditDataSetDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditDataSetDialog();
 
-	DataSet *editDataSet(DataSet *ds = NULL);
+	DataSet *editDataSet(DataSet *ds = nullptr);
 	void updateDatasetPropertyList();
 
 	QalculateEditNamesDialog *names_edit_dialog;
@@ -123,7 +123,7 @@ public:
 	~QalculateEditDataPropertyNamesDialog();
 
 	void saveNames(DataProperty *item, const TQString &str = TQString::null);
-	void setNames(DataProperty *item = NULL, const TQString &namestr = TQString::null, bool names_edited = false);
+	void setNames(DataProperty *item = nullptr, const TQString &namestr = TQString::null, bool names_edited = false);
 	bool isEmpty();
 	void setNamesLE(TQLineEdit *entry, TQLabel *label);
 
diff --git a/src/qalculateeditfunctiondialog.cpp b/src/qalculateeditfunctiondialog.cpp
index 4975656..bb0df6e 100644
--- a/src/qalculateeditfunctiondialog.cpp
+++ b/src/qalculateeditfunctiondialog.cpp
@@ -46,10 +46,10 @@ extern tree_struct function_cats;
 
 QalculateEditFunctionDialog::QalculateEditFunctionDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Function"), Ok | Cancel | Help, Ok, false) {
 
-	names_edit_dialog = NULL;
-	subfunctions_edit_dialog = NULL;
-	edited_function = NULL;
-	argument_edit_dialog = NULL;
+	names_edit_dialog = nullptr;
+	subfunctions_edit_dialog = nullptr;
+	edited_function = nullptr;
+	argument_edit_dialog = nullptr;
 
 	tabs = new KTabWidget(this);
 	setMainWidget(tabs);
@@ -137,7 +137,7 @@ void QalculateEditFunctionDialog::slotHelp() {
 
 void QalculateEditFunctionDialog::argumentSelectionChanged() {
 	TQListViewItem *i = argumentsView->selectedItem();
-	if(i == NULL || (edited_function && edited_function->isBuiltin()) || argumentsItems[i]->type() > ARGUMENT_TYPE_ANGLE) {
+	if(i == nullptr || (edited_function && edited_function->isBuiltin()) || argumentsItems[i]->type() > ARGUMENT_TYPE_ANGLE) {
 		editArgumentButton->setEnabled(false);
 		deleteArgumentButton->setEnabled(false);
 	} else {
@@ -215,7 +215,7 @@ void QalculateEditFunctionDialog::slotOk() {
 	}
 	if(!f->isBuiltin()) {
 		for(; index <= f->lastArgumentDefinitionIndex(); index++) {
-			f->setArgumentDefinition(index, NULL);
+			f->setArgumentDefinition(index, nullptr);
 		}
 	}
 	argumentsItemsEdited.clear();
@@ -254,11 +254,11 @@ MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathF
 	tabs->setCurrentPage(0);
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	if(subfunctions_edit_dialog) {
 		delete subfunctions_edit_dialog;
-		subfunctions_edit_dialog = NULL;
+		subfunctions_edit_dialog = nullptr;
 	}
 	edited_function = f;
 	if(f) {
@@ -279,7 +279,7 @@ MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathF
 		++function_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
@@ -345,7 +345,7 @@ MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathF
 			args = f->minargs() + 1;	
 		}
 		TQString str, str2;
-		TQListViewItem *i_prev = NULL;
+		TQListViewItem *i_prev = nullptr;
 		for(int i = 1; i <= args; i++) {
 			arg = f->getArgumentDefinition(i);
 			if(arg) {
@@ -367,7 +367,7 @@ MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathF
 
 	if(exec() == TQDialog::Accepted) {
 		f = edited_function;
-		edited_function = NULL;
+		edited_function = nullptr;
 		return f;
 	}
 	TQListViewItemIterator it(argumentsView);
@@ -379,8 +379,8 @@ MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathF
 	}
 	argumentsItemsEdited.clear();
 	argumentsItems.clear();
-	edited_function = NULL;
-	return NULL;
+	edited_function = nullptr;
+	return nullptr;
 }
 
 void QalculateEditFunctionDialog::editNames() {
@@ -406,7 +406,7 @@ void QalculateEditFunctionDialog::newArgument() {
 }
 void QalculateEditFunctionDialog::editArgument() {
 	TQListViewItem *i = argumentsView->selectedItem();
-	if(i == NULL) return;
+	if(i == nullptr) return;
 	if(!argument_edit_dialog) {
 		argument_edit_dialog = new QalculateEditArgumentDialog(this);
 	}
@@ -423,7 +423,7 @@ void QalculateEditFunctionDialog::editArgument() {
 }
 void QalculateEditFunctionDialog::deleteArgument() {
 	TQListViewItem *i = argumentsView->selectedItem();
-	if(i == NULL) return;
+	if(i == nullptr) return;
 	if(argumentsItemsEdited[i]) {
 		delete argumentsItems[i];
 	}
@@ -505,7 +505,7 @@ void QalculateEditSubFunctionsDialog::setSubFunctions(UserFunction *f, bool edit
 		subFunctionsView->clear();
 	}
 	if(!edited && f && f->countSubfunctions() > 0) {
-		TQListViewItem *i_prev = NULL;
+		TQListViewItem *i_prev = nullptr;
 		for(size_t index = 1; index <= f->countSubfunctions(); index++) {
 			TQListViewItem *i = new TDEListViewItem(subFunctionsView, i_prev);
 			i_prev = i;
@@ -553,7 +553,7 @@ void QalculateEditSubFunctionsDialog::itemClicked(TQListViewItem *i, const TQPoi
 }
 
 void QalculateEditSubFunctionsDialog::selectionChanged() {
-	deleteButton->setEnabled(subFunctionsView->selectedItem() != NULL);
+	deleteButton->setEnabled(subFunctionsView->selectedItem() != nullptr);
 }
 
 QalculateEditArgumentDialog::QalculateEditArgumentDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Argument"), Ok | Cancel, Ok, true) {
@@ -676,10 +676,10 @@ Argument *QalculateEditArgumentDialog::editArgument(Argument *arg) {
 			case ARGUMENT_TYPE_NUMBER: {
 				typeCombo->setCurrentItem(1);
 				NumberArgument *farg = (NumberArgument*) arg;
-				minButton->setChecked(farg->min() != NULL);
+				minButton->setChecked(farg->min() != nullptr);
 				minIncludeEqualsButton->setChecked(farg->includeEqualsMin());
 				if(farg->min()) minEdit->setText(farg->min()->print(po).c_str());
-				maxButton->setChecked(farg->max() != NULL);
+				maxButton->setChecked(farg->max() != nullptr);
 				maxIncludeEqualsButton->setChecked(farg->includeEqualsMax());
 				if(farg->max()) maxEdit->setText(farg->max()->print(po).c_str());
 				complexButton->setChecked(farg->complexAllowed());
@@ -688,9 +688,9 @@ Argument *QalculateEditArgumentDialog::editArgument(Argument *arg) {
 			case ARGUMENT_TYPE_INTEGER: {
 				typeCombo->setCurrentItem(2);
 				IntegerArgument *iarg = (IntegerArgument*) arg;
-				minButton->setChecked(iarg->min() != NULL);
+				minButton->setChecked(iarg->min() != nullptr);
 				if(iarg->min()) minEdit->setText(iarg->min()->print(po).c_str());
-				maxButton->setChecked(iarg->max() != NULL);
+				maxButton->setChecked(iarg->max() != nullptr);
 				if(iarg->max()) maxEdit->setText(iarg->max()->print(po).c_str());
 				break;
 			}
@@ -771,7 +771,7 @@ Argument *QalculateEditArgumentDialog::editArgument(Argument *arg) {
 		if(arg->type() != ARGUMENT_TYPE_FREE && arg->type() != ARGUMENT_TYPE_MATRIX) arg->setMatrixAllowed(matrixButton->isChecked());
 		return arg;	
 	}
-	return NULL;
+	return nullptr;
 
 }
 
diff --git a/src/qalculateeditfunctiondialog.h b/src/qalculateeditfunctiondialog.h
index 5c8d624..bbaaa43 100644
--- a/src/qalculateeditfunctiondialog.h
+++ b/src/qalculateeditfunctiondialog.h
@@ -51,7 +51,7 @@ public:
 	QalculateEditFunctionDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditFunctionDialog();
 
-	MathFunction *editFunction(TQString category = TQString::null, MathFunction *f = NULL);
+	MathFunction *editFunction(TQString category = TQString::null, MathFunction *f = nullptr);
 
 	QalculateEditNamesDialog *names_edit_dialog;
 	QalculateEditSubFunctionsDialog *subfunctions_edit_dialog;
@@ -96,7 +96,7 @@ public:
 	virtual ~QalculateEditSubFunctionsDialog();
 
 	void saveSubFunctions(UserFunction *f);
-	void setSubFunctions(UserFunction *f = NULL, bool edited = false);
+	void setSubFunctions(UserFunction *f = nullptr, bool edited = false);
 	bool isEmpty();
 
 	TDEListView* subFunctionsView;
@@ -122,7 +122,7 @@ public:
 	QalculateEditArgumentDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditArgumentDialog();
 
-	Argument *editArgument(Argument *arg = NULL);
+	Argument *editArgument(Argument *arg = nullptr);
 
 	KComboBox *typeCombo;
 	KLineEdit *nameEdit, *conditionEdit, *maxEdit, *minEdit;
diff --git a/src/qalculateeditmatrixvectordialog.cpp b/src/qalculateeditmatrixvectordialog.cpp
index 7da4dd7..b188a1c 100644
--- a/src/qalculateeditmatrixvectordialog.cpp
+++ b/src/qalculateeditmatrixvectordialog.cpp
@@ -71,8 +71,8 @@ class QalculateEditMatrixTable : public TQTable {
 
 QalculateEditMatrixVectorDialog::QalculateEditMatrixVectorDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
 
-	names_edit_dialog = NULL;
-	edited_variable = NULL;
+	names_edit_dialog = nullptr;
+	edited_variable = nullptr;
 
 	setMainWidget(new TQWidget(this));
 	TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
@@ -171,10 +171,10 @@ void QalculateEditMatrixVectorDialog::columnsChanged(int i) {
 }
 
 KnownVariable *QalculateEditMatrixVectorDialog::newVector(TQString category) {
-	return editVariable(category, NULL, NULL, false, true);
+	return editVariable(category, nullptr, nullptr, false, true);
 }
 KnownVariable *QalculateEditMatrixVectorDialog::newMatrix(TQString category) {
-	return editVariable(category, NULL, NULL, false, false);
+	return editVariable(category, nullptr, nullptr, false, false);
 }
 
 void QalculateEditMatrixVectorDialog::slotOk() {
@@ -274,12 +274,12 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(TQString category,
 	nameEdit->setFocus();
 
 	if((v && !v->get().isVector()) || (initial_value && !initial_value->isVector())) {
-		return NULL;
+		return nullptr;
 	}
 
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_variable = v;
 
@@ -330,7 +330,7 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(TQString category,
 		++variable_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
@@ -356,7 +356,7 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(TQString category,
 	}
 
 	int r = 4, c = 4;
-	const MathStructure *old_vctr = NULL;
+	const MathStructure *old_vctr = nullptr;
 	if(v) {
 		if(create_vector) {
 			old_vctr = &v->get();
@@ -451,12 +451,12 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(TQString category,
 
 	if(exec() == TQDialog::Accepted) {
 		v = edited_variable;
-		edited_variable = NULL;
+		edited_variable = nullptr;
 		return v;
 	}
 
-	edited_variable = NULL;
-	return NULL;
+	edited_variable = nullptr;
+	return nullptr;
 }
 
 void QalculateEditMatrixVectorDialog::editNames() {
diff --git a/src/qalculateeditmatrixvectordialog.h b/src/qalculateeditmatrixvectordialog.h
index 5b19ced..536a4b9 100644
--- a/src/qalculateeditmatrixvectordialog.h
+++ b/src/qalculateeditmatrixvectordialog.h
@@ -47,7 +47,7 @@ public:
 
 	KnownVariable *newMatrix(TQString category = TQString::null);
 	KnownVariable *newVector(TQString category = TQString::null);
-	KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false, bool create_vector = false);
+	KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = nullptr, MathStructure *initial_value = nullptr, bool force_value = false, bool create_vector = false);
 
 	QalculateEditNamesDialog *names_edit_dialog;
 	KnownVariable *edited_variable;
diff --git a/src/qalculateeditnamesdialog.cpp b/src/qalculateeditnamesdialog.cpp
index a69ac46..2501b67 100644
--- a/src/qalculateeditnamesdialog.cpp
+++ b/src/qalculateeditnamesdialog.cpp
@@ -98,7 +98,7 @@ void QalculateEditNamesDialog::setNames(ExpressionItem *item, const TQString &na
 		namesView->clear();
 	}
 	if(!names_edited && item && item->countNames() > 0) {
-		TQListViewItem *i_prev = NULL;
+		TQListViewItem *i_prev = nullptr;
 		for(size_t index = 1; index <= item->countNames(); index++) {
 			const ExpressionName *ename = &item->getName(index);
 			TQListViewItem *i = new TDEListViewItem(namesView, i_prev);
@@ -242,7 +242,7 @@ void QalculateEditNamesDialog::itemClicked(TQListViewItem *i, const TQPoint &, i
 }
 
 void QalculateEditNamesDialog::nameSelectionChanged() {
-	deleteButton->setEnabled(namesView->selectedItem() != NULL);
+	deleteButton->setEnabled(namesView->selectedItem() != nullptr);
 }
 
 void QalculateEditNamesDialog::nameChanged(const TQString &name) {
diff --git a/src/qalculateeditnamesdialog.h b/src/qalculateeditnamesdialog.h
index cbd7fb1..7ecbed0 100644
--- a/src/qalculateeditnamesdialog.h
+++ b/src/qalculateeditnamesdialog.h
@@ -42,7 +42,7 @@ public:
 	virtual ~QalculateEditNamesDialog();
 
 	void saveNames(ExpressionItem *item, const TQString &str = TQString::null);
-	void setNames(ExpressionItem *item = NULL, const TQString &namestr = TQString::null, bool names_edited = false);
+	void setNames(ExpressionItem *item = nullptr, const TQString &namestr = TQString::null, bool names_edited = false);
 	bool isEmpty();
 	void setNamesLE(TQLineEdit *entry, TQLabel *label);
 
diff --git a/src/qalculateeditunitdialog.cpp b/src/qalculateeditunitdialog.cpp
index 745ea77..69ce5a1 100644
--- a/src/qalculateeditunitdialog.cpp
+++ b/src/qalculateeditunitdialog.cpp
@@ -43,8 +43,8 @@ extern tree_struct unit_cats;
 
 QalculateEditUnitDialog::QalculateEditUnitDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Unit"), Ok | Cancel | Help, Ok, true) {
 
-	names_edit_dialog = NULL;
-	edited_unit = NULL;
+	names_edit_dialog = nullptr;
+	edited_unit = nullptr;
 
 	TQVBox *box = makeVBoxMainWidget();
 
@@ -164,7 +164,7 @@ void QalculateEditUnitDialog::slotOk() {
 			case SUBTYPE_ALIAS_UNIT: {
 				if(i1 != 1) {
 					u->destroy();
-					u = NULL;
+					u = nullptr;
 					break;
 				}
 				if(!u->isBuiltin()) {
@@ -187,7 +187,7 @@ void QalculateEditUnitDialog::slotOk() {
 			case SUBTYPE_COMPOSITE_UNIT: {
 				if(i1 != 2) {
 					u->destroy();
-					u = NULL;
+					u = nullptr;
 					break;
 				}
 				if(!u->isBuiltin()) {
@@ -198,7 +198,7 @@ void QalculateEditUnitDialog::slotOk() {
 			case SUBTYPE_BASE_UNIT: {
 				if(i1 != 0) {
 					u->destroy();
-					u = NULL;
+					u = nullptr;
 					break;
 				}
 				break;
@@ -280,7 +280,7 @@ Unit *QalculateEditUnitDialog::editUnit(TQString category, Unit *u) {
 
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_unit = u;
 	if(u) {
@@ -302,7 +302,7 @@ Unit *QalculateEditUnitDialog::editUnit(TQString category, Unit *u) {
 		++unit_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
@@ -394,11 +394,11 @@ Unit *QalculateEditUnitDialog::editUnit(TQString category, Unit *u) {
 
 	if(exec() == TQDialog::Accepted) {
 		u = edited_unit;
-		edited_unit = NULL;
+		edited_unit = nullptr;
 		return u;
 	}
-	edited_unit = NULL;
-	return NULL;
+	edited_unit = nullptr;
+	return nullptr;
 }
 
 void QalculateEditUnitDialog::editNames() {
diff --git a/src/qalculateeditunitdialog.h b/src/qalculateeditunitdialog.h
index 6e9bd35..9cf41e5 100644
--- a/src/qalculateeditunitdialog.h
+++ b/src/qalculateeditunitdialog.h
@@ -45,7 +45,7 @@ public:
 	QalculateEditUnitDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditUnitDialog();
 
-	Unit *editUnit(TQString category = TQString::null, Unit *u = NULL);
+	Unit *editUnit(TQString category = TQString::null, Unit *u = nullptr);
 
 	QalculateEditNamesDialog *names_edit_dialog;
 	Unit *edited_unit;
diff --git a/src/qalculateeditunknownvariabledialog.cpp b/src/qalculateeditunknownvariabledialog.cpp
index 4f28553..5460100 100644
--- a/src/qalculateeditunknownvariabledialog.cpp
+++ b/src/qalculateeditunknownvariabledialog.cpp
@@ -40,8 +40,8 @@ extern tree_struct variable_cats;
 
 QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
 
-	names_edit_dialog = NULL;
-	edited_unknown = NULL;
+	names_edit_dialog = nullptr;
+	edited_unknown = nullptr;
 
 	setMainWidget(new TQWidget(this));
 	TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
@@ -160,7 +160,7 @@ void QalculateEditUnknownVariableDialog::slotOk() {
 			v->assumptions()->setType((AssumptionType) typeCombo->currentItem());
 			v->assumptions()->setSign((AssumptionSign) signCombo->currentItem());
 		} else {
-			v->setAssumptions(NULL);
+			v->setAssumptions(nullptr);
 		}
 	}
 	v->setCategory(categoryCombo->lineEdit()->text().ascii());
@@ -192,7 +192,7 @@ UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(TQString categ
 
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_unknown = v;
 	if(v) {
@@ -218,7 +218,7 @@ UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(TQString categ
 		++variable_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
@@ -278,11 +278,11 @@ UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(TQString categ
 
 	if(exec() == TQDialog::Accepted) {
 		v = edited_unknown;
-		edited_unknown = NULL;
+		edited_unknown = nullptr;
 		return v;
 	}
-	edited_unknown = NULL;
-	return NULL;
+	edited_unknown = nullptr;
+	return nullptr;
 }
 
 void QalculateEditUnknownVariableDialog::editNames() {
diff --git a/src/qalculateeditunknownvariabledialog.h b/src/qalculateeditunknownvariabledialog.h
index fef254c..d40cc66 100644
--- a/src/qalculateeditunknownvariabledialog.h
+++ b/src/qalculateeditunknownvariabledialog.h
@@ -43,7 +43,7 @@ public:
 	QalculateEditUnknownVariableDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditUnknownVariableDialog();
 
-	UnknownVariable *editVariable(TQString category = TQString::null, UnknownVariable *v = NULL);
+	UnknownVariable *editVariable(TQString category = TQString::null, UnknownVariable *v = nullptr);
 
 	QalculateEditNamesDialog *names_edit_dialog;
 	UnknownVariable *edited_unknown;
diff --git a/src/qalculateeditvariabledialog.cpp b/src/qalculateeditvariabledialog.cpp
index 15ca825..e7bd383 100644
--- a/src/qalculateeditvariabledialog.cpp
+++ b/src/qalculateeditvariabledialog.cpp
@@ -41,8 +41,8 @@ extern tree_struct variable_cats;
 
 QalculateEditVariableDialog::QalculateEditVariableDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
 
-	names_edit_dialog = NULL;
-	edited_variable = NULL;
+	names_edit_dialog = nullptr;
+	edited_variable = nullptr;
 
 	setMainWidget(new TQWidget(this));	
 	TQGridLayout *grid = new TQGridLayout(mainWidget(), 6, 2, 0, spacingHint());
@@ -173,7 +173,7 @@ KnownVariable *QalculateEditVariableDialog::editVariable(TQString category, Know
 
 	if(names_edit_dialog) {
 		delete names_edit_dialog;
-		names_edit_dialog = NULL;
+		names_edit_dialog = nullptr;
 	}
 	edited_variable = v;
 	if(v) {
@@ -200,7 +200,7 @@ KnownVariable *QalculateEditVariableDialog::editVariable(TQString category, Know
 		++variable_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
@@ -242,7 +242,7 @@ KnownVariable *QalculateEditVariableDialog::editVariable(TQString category, Know
 	if(v) {
 		//fill in original parameters
 		set_name_label_and_entry(v, nameEdit, namesLabel);
-		valueEdit->setText(get_value_string(v->get(), false, NULL));
+		valueEdit->setText(get_value_string(v->get(), false, nullptr));
 		nameEdit->setReadOnly(v->isBuiltin());
 		valueEdit->setReadOnly(v->isBuiltin());
 		valueExactButton->setEnabled(!v->isBuiltin());
@@ -274,11 +274,11 @@ KnownVariable *QalculateEditVariableDialog::editVariable(TQString category, Know
 
 	if(exec() == TQDialog::Accepted) {
 		v = edited_variable;
-		edited_variable = NULL;
+		edited_variable = nullptr;
 		return v;
 	}
-	edited_variable = NULL;
-	return NULL;
+	edited_variable = nullptr;
+	return nullptr;
 }
 
 void QalculateEditVariableDialog::editNames() {
diff --git a/src/qalculateeditvariabledialog.h b/src/qalculateeditvariabledialog.h
index 7634268..817a89e 100644
--- a/src/qalculateeditvariabledialog.h
+++ b/src/qalculateeditvariabledialog.h
@@ -44,7 +44,7 @@ public:
 	QalculateEditVariableDialog(TQWidget *parent = 0, const char *name = 0);
 	virtual ~QalculateEditVariableDialog();
 
-	KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false);
+	KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = nullptr, MathStructure *initial_value = nullptr, bool force_value = false);
 
 	QalculateEditNamesDialog *names_edit_dialog;
 	KnownVariable *edited_variable;
diff --git a/src/qalculateexportcsvdialog.cpp b/src/qalculateexportcsvdialog.cpp
index 23e8aa9..93ce6a8 100644
--- a/src/qalculateexportcsvdialog.cpp
+++ b/src/qalculateexportcsvdialog.cpp
@@ -175,8 +175,8 @@ void QalculateExportCSVDialog::exportCSVFile(KnownVariable *v) {
 		matrixVectorEdit->clear();
 		currentResultButton->setChecked(true);
 	}
-	currentResultButton->setEnabled(v == NULL);
-	matrixVectorButton->setEnabled(v == NULL);
+	currentResultButton->setEnabled(v == nullptr);
+	matrixVectorButton->setEnabled(v == nullptr);
 	matrixVectorEdit->setEnabled(false);
 
 	exec();
diff --git a/src/qalculateexportcsvdialog.h b/src/qalculateexportcsvdialog.h
index c8ede48..8a04cfc 100644
--- a/src/qalculateexportcsvdialog.h
+++ b/src/qalculateexportcsvdialog.h
@@ -45,7 +45,7 @@ public:
 	TQRadioButton *currentResultButton, *matrixVectorButton;
 	KURLRequester *fileEdit;
 
-	void exportCSVFile(KnownVariable *v = NULL);
+	void exportCSVFile(KnownVariable *v = nullptr);
 	
 private:
 
diff --git a/src/qalculateexpressionedit.cpp b/src/qalculateexpressionedit.cpp
index f5ae71a..d731a54 100644
--- a/src/qalculateexpressionedit.cpp
+++ b/src/qalculateexpressionedit.cpp
@@ -140,7 +140,7 @@ bool QalculateExpressionEdit::completionEnabled() const {
 
 TQPopupMenu *QalculateExpressionEdit::createPopupMenu() {
 
-	setCompletionObject(NULL);
+	setCompletionObject(nullptr);
 	TQPopupMenu *menu = KLineEdit::createPopupMenu();
 	setCompletionObject(qalculateCompletion);
 	menu->insertSeparator();
@@ -201,7 +201,7 @@ void QalculateExpressionEdit::insertCompletion(TQListBoxItem *li) {
 	setSelection(cstart, cend - cstart + 1);
 	
 	TQString str = completed_text;
-	const ExpressionName *ename = NULL, *ename_r = NULL;
+	const ExpressionName *ename = nullptr, *ename_r = nullptr;
 	ename_r = &item->preferredInputName(false, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) this);	
 	for(size_t name_i = 0; name_i <= item->countNames() && !ename; name_i++) {
 		if(name_i == 0) {
@@ -209,37 +209,37 @@ void QalculateExpressionEdit::insertCompletion(TQListBoxItem *li) {
 		} else {
 			ename = &item->getName(name_i);
 			if(!ename || ename == ename_r || ename->plural || (ename->unicode && (!printops.use_unicode_signs || !can_display_unicode_string_function(ename->name.c_str(), (void*) this)))) {
-				ename = NULL;
+				ename = nullptr;
 			}
 		}
 		if(ename) {
 			if(str.length() <= ename->name.length()) {
 				for(size_t i = 0; i < str.length(); i++) {
 					if(ename->name[i] != str[i]) {
-						ename = NULL;
+						ename = nullptr;
 						break;
 					}
 				}
 			} else {
-				ename = NULL;
+				ename = nullptr;
 			}
 		}
 	}
 	for(size_t name_i = 1; name_i <= item->countNames() && !ename; name_i++) {
 		ename = &item->getName(name_i);
 		if(!ename || ename == ename_r || (!ename->plural && !(ename->unicode && (!printops.use_unicode_signs || !can_display_unicode_string_function(ename->name.c_str(), (void*) this))))) {
-			ename = NULL;
+			ename = nullptr;
 		}
 		if(ename) {
 			if(str.length() <= ename->name.length()) {
 				for(size_t i = 0; i < str.length(); i++) {
 					if(ename->name[i] != str[i]) {
-						ename = NULL;
+						ename = nullptr;
 						break;
 					}
 				}
 			} else {
-				ename = NULL;
+				ename = nullptr;
 			}
 		}
 	}
diff --git a/src/qalculateexpressionedit.h b/src/qalculateexpressionedit.h
index 9154eba..4235e89 100644
--- a/src/qalculateexpressionedit.h
+++ b/src/qalculateexpressionedit.h
@@ -37,7 +37,7 @@ class QalculateExpressionEdit : public KLineEdit {
 
 public:
 
-	QalculateExpressionEdit(bool connected_to_main_win, TQWidget *parent = 0, const char *name = 0);
+	QalculateExpressionEdit(bool connected_to_main_win, TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateExpressionEdit();
 
 	TQValueVector<ExpressionItem*> matched_items;
@@ -87,7 +87,7 @@ class QalculateExpressionEditCompletionBox : public TDECompletionBox {
 
 public:
 
-	QalculateExpressionEditCompletionBox(TQWidget *parent, const char *name = 0);
+	QalculateExpressionEditCompletionBox(TQWidget *parent, const char *name = nullptr);
 	virtual ~QalculateExpressionEditCompletionBox();
 	void insertItemList(const TQValueVector<ExpressionItem*>& list, int index = -1);
 
diff --git a/src/qalculatefunctionsdialog.cpp b/src/qalculatefunctionsdialog.cpp
index ae9175f..ff2e952 100644
--- a/src/qalculatefunctionsdialog.cpp
+++ b/src/qalculatefunctionsdialog.cpp
@@ -40,9 +40,9 @@ extern PrintOptions printops;
 
 QalculateFunctionsDialog::QalculateFunctionsDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
 
-	function_edit_dialog = NULL;
+	function_edit_dialog = nullptr;
 	selected_category = "";
-	selected_function = NULL;
+	selected_function = nullptr;
 
 	TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
 	
@@ -128,7 +128,7 @@ void QalculateFunctionsDialog::updateFunctionTree() {
 		++function_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 	str = "";
 	i2 = i;
@@ -248,7 +248,7 @@ void QalculateFunctionsDialog::newFunction() {
 	if(!function_edit_dialog) {
 		function_edit_dialog = new QalculateEditFunctionDialog(this);
 	}
-	MathFunction *f = NULL;
+	MathFunction *f = nullptr;
 	if(selected_category.isEmpty() || selected_category[0] != '/') {
 		f = function_edit_dialog->editFunction();
 	} else {
@@ -300,7 +300,7 @@ void QalculateFunctionsDialog::functionSelected() {
 		MathFunction *f = functionItems[selected];
 		if(!CALCULATOR->stillHasFunction(f)) {
 			KMessageBox::error(this, i18n("Function does not exist anymore."));
-			selected_function = NULL;
+			selected_function = nullptr;
 			emit functionsChanged();
 			return;
 		}
@@ -479,7 +479,7 @@ void QalculateFunctionsDialog::functionSelected() {
 		applyButton->setEnabled(false);
 		deleteButton->setEnabled(false);
 		deactivateButton->setEnabled(false);
-		selected_function = NULL;
+		selected_function = nullptr;
 		descriptionBrowser->clear();
 	}
 }
diff --git a/src/qalculatefunctionsdialog.h b/src/qalculatefunctionsdialog.h
index 1196fb0..4e6ec5d 100644
--- a/src/qalculatefunctionsdialog.h
+++ b/src/qalculatefunctionsdialog.h
@@ -39,7 +39,7 @@ class QalculateFunctionsDialog : public KDialog {
 
 public:
 
-	QalculateFunctionsDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateFunctionsDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateFunctionsDialog();
 
 	QalculateEditFunctionDialog *function_edit_dialog;
diff --git a/src/qalculateimportcsvdialog.cpp b/src/qalculateimportcsvdialog.cpp
index d09728f..208bf0e 100644
--- a/src/qalculateimportcsvdialog.cpp
+++ b/src/qalculateimportcsvdialog.cpp
@@ -172,7 +172,7 @@ bool QalculateImportCSVDialog::importCSVFile() {
 		++variable_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 
 	catstr = "";
diff --git a/src/qalculateimportcsvdialog.h b/src/qalculateimportcsvdialog.h
index 33e0ed7..437c585 100644
--- a/src/qalculateimportcsvdialog.h
+++ b/src/qalculateimportcsvdialog.h
@@ -38,7 +38,7 @@ class QalculateImportCSVDialog : public KDialogBase {
 
 public:
 
-	QalculateImportCSVDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateImportCSVDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateImportCSVDialog();
 
 	KLineEdit *nameEdit, *titleEdit, *otherDelimiterEdit;
diff --git a/src/qalculateinsertfunctiondialog.cpp b/src/qalculateinsertfunctiondialog.cpp
index 489ec5e..3173f30 100644
--- a/src/qalculateinsertfunctiondialog.cpp
+++ b/src/qalculateinsertfunctiondialog.cpp
@@ -366,7 +366,7 @@ void QalculateInsertFunctionDialog::insertMatrix(int index) {
 	if(mstruct.isVector()) {
 		str = d->editMatrixVector(&mstruct, false);
 	} else {
-		str = d->editMatrixVector(NULL, false);
+		str = d->editMatrixVector(nullptr, false);
 	}
 	if(!str.isEmpty()) {
 		((KLineEdit*) entry[index])->setText(str);
@@ -383,7 +383,7 @@ void QalculateInsertFunctionDialog::insertVector(int index) {
 	if(mstruct.isVector()) {
 		str = d->editMatrixVector(&mstruct, true);
 	} else {
-		str = d->editMatrixVector(NULL, true);
+		str = d->editMatrixVector(nullptr, true);
 	}
 	if(!str.isEmpty()) {
 		((KLineEdit*) entry[index])->setText(str);
diff --git a/src/qalculateinsertfunctiondialog.h b/src/qalculateinsertfunctiondialog.h
index 910b9b5..bded883 100644
--- a/src/qalculateinsertfunctiondialog.h
+++ b/src/qalculateinsertfunctiondialog.h
@@ -30,7 +30,7 @@ class QalculateInsertFunctionDialog : public KDialogBase {
 
 public:
 
-	QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent = 0, const TQString &selected_text = TQString::null, const char *name = 0);
+	QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent = nullptr, const TQString &selected_text = TQString::null, const char *name = nullptr);
 	virtual ~QalculateInsertFunctionDialog();
 
 	TQString functionExpression();
diff --git a/src/qalculateinsertmatrixvectordialog.cpp b/src/qalculateinsertmatrixvectordialog.cpp
index 33bbb14..5f65452 100644
--- a/src/qalculateinsertmatrixvectordialog.cpp
+++ b/src/qalculateinsertmatrixvectordialog.cpp
@@ -151,10 +151,10 @@ void QalculateInsertMatrixVectorDialog::columnsChanged(int i) {
 }
 
 TQString QalculateInsertMatrixVectorDialog::newVector() {
-	return editMatrixVector(NULL, true);
+	return editMatrixVector(nullptr, true);
 }
 TQString QalculateInsertMatrixVectorDialog::newMatrix() {
-	return editMatrixVector(NULL, false);
+	return editMatrixVector(nullptr, false);
 }
 
 void QalculateInsertMatrixVectorDialog::slotOk() {
@@ -260,7 +260,7 @@ void QalculateInsertMatrixVectorDialog::insertSelection() {
 TQString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure *initial_value, bool create_vector, bool is_text_struct, bool is_result) {
 
 	if(initial_value && !initial_value->isVector()) {
-		return NULL;
+		return nullptr;
 	}
 
 	if(initial_value) {
@@ -343,7 +343,7 @@ TQString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure
 			}
 		}
 	}
-	printops.can_display_unicode_string_arg = NULL;
+	printops.can_display_unicode_string_arg = nullptr;
 	matrixstr = "";
 	
 	onSelectionChanged();
diff --git a/src/qalculateinsertmatrixvectordialog.h b/src/qalculateinsertmatrixvectordialog.h
index ac5bff8..6084691 100644
--- a/src/qalculateinsertmatrixvectordialog.h
+++ b/src/qalculateinsertmatrixvectordialog.h
@@ -47,7 +47,7 @@ public:
 
 	TQString newMatrix();
 	TQString newVector();
-	TQString editMatrixVector(const MathStructure *initial_value = NULL, bool create_vector = false, bool is_text_struct = false, bool is_result = false);
+	TQString editMatrixVector(const MathStructure *initial_value = nullptr, bool create_vector = false, bool is_text_struct = false, bool is_result = false);
 
 	TQLabel *elementsLabel;
 	TQRadioButton *matrixButton, *vectorButton;
diff --git a/src/qalculateperiodictabledialog.h b/src/qalculateperiodictabledialog.h
index cd98778..1e07035 100644
--- a/src/qalculateperiodictabledialog.h
+++ b/src/qalculateperiodictabledialog.h
@@ -35,7 +35,7 @@ class QalculatePeriodicTableDialog : public KDialogBase {
 
 public:
 
-	QalculatePeriodicTableDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculatePeriodicTableDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculatePeriodicTableDialog();
 
 	TQGridLayout *grid;
@@ -52,7 +52,7 @@ class QalculateElementInfoDialog : public KDialogBase {
 
 public:
 
-	QalculateElementInfoDialog(DataObject *element, TQWidget *parent = 0, const char *name = 0);
+	QalculateElementInfoDialog(DataObject *element, TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateElementInfoDialog();
 
 	DataObject *e;
diff --git a/src/qalculateplotdialog.cpp b/src/qalculateplotdialog.cpp
index 2ca3d51..60db555 100644
--- a/src/qalculateplotdialog.cpp
+++ b/src/qalculateplotdialog.cpp
@@ -398,8 +398,8 @@ void QalculatePlotDialog::seriesItemRenamed(TQListViewItem *i, const TQString &s
 		MathStructure *x_vector = itemXVector[i], *y_vector = itemYVector[i];
 		if(x_vector) delete x_vector;
 		if(y_vector) delete y_vector;
-		x_vector = NULL;
-		y_vector = NULL;
+		x_vector = nullptr;
+		y_vector = nullptr;
 		generatePlotSeries(&x_vector, &y_vector, itemType[i], str.ascii(), itemXVariable[i].ascii());
 		itemXVector[i] = x_vector;
 		itemYVector[i] = y_vector;
@@ -525,8 +525,8 @@ void QalculatePlotDialog::modifySeries() {
 		MathStructure *x_vector = itemXVector[i], *y_vector = itemYVector[i];
 		if(x_vector) delete x_vector;
 		if(y_vector) delete y_vector;
-		x_vector = NULL;
-		y_vector = NULL;
+		x_vector = nullptr;
+		y_vector = nullptr;
 		generatePlotSeries(&x_vector, &y_vector, type, expression.ascii(), str_x.ascii());
 		i->setText(0, title);
 		i->setText(1, expression);
@@ -567,8 +567,8 @@ void QalculatePlotDialog::applyRange() {
 		MathStructure *x_vector = itemXVector[it.current()], *y_vector = itemYVector[it.current()];
 		if(y_vector) delete y_vector;
 		if(x_vector) delete x_vector;
-		x_vector = NULL;
-		y_vector = NULL;
+		x_vector = nullptr;
+		y_vector = nullptr;
 		generatePlotSeries(&x_vector, &y_vector, itemType[it.current()], it.current()->text(1).ascii(), itemXVariable[it.current()].ascii());
 		itemXVector[it.current()] = x_vector;
 		itemYVector[it.current()] = y_vector;
@@ -765,7 +765,7 @@ void QalculatePlotDialog::generatePlotSeries(MathStructure **x_vector, MathStruc
 	eo.parse_options.read_precision = DONT_READ_PRECISION;
 	if(type == 1 || type == 2) {
 		*y_vector = new MathStructure(CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(str, evalops.parse_options), eo));
-		*x_vector = NULL;
+		*x_vector = nullptr;
 	} else {
 		MathStructure min(CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(minEdit->text().ascii(), evalops.parse_options), eo));
 		MathStructure max(CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(maxEdit->text().ascii(), evalops.parse_options), eo));
diff --git a/src/qalculateplotdialog.h b/src/qalculateplotdialog.h
index b0e2e1c..3fafe6d 100644
--- a/src/qalculateplotdialog.h
+++ b/src/qalculateplotdialog.h
@@ -50,7 +50,7 @@ class QalculatePlotDialog : public KDialogBase {
 
 public:
 
-	QalculatePlotDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculatePlotDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculatePlotDialog();
 
 	TQLabel *xVariableLabel;
diff --git a/src/qalculateprecisiondialog.h b/src/qalculateprecisiondialog.h
index 411dc02..4c64032 100644
--- a/src/qalculateprecisiondialog.h
+++ b/src/qalculateprecisiondialog.h
@@ -33,7 +33,7 @@ class QalculatePrecisionDialog : public KDialogBase {
 
 public:
 
-	QalculatePrecisionDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculatePrecisionDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculatePrecisionDialog();
 
 	TQSpinBox *precisionBox;
diff --git a/src/qalculatepreferencesdialog.h b/src/qalculatepreferencesdialog.h
index 05a1b84..4cb54fa 100644
--- a/src/qalculatepreferencesdialog.h
+++ b/src/qalculatepreferencesdialog.h
@@ -37,7 +37,7 @@ class QalculatePreferencesDialog : public KDialogBase {
 
 public:
 
-	QalculatePreferencesDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculatePreferencesDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculatePreferencesDialog();
 
 	bool editPreferences();
diff --git a/src/qalculateresultdisplay.cpp b/src/qalculateresultdisplay.cpp
index a85c90e..cc285d4 100644
--- a/src/qalculateresultdisplay.cpp
+++ b/src/qalculateresultdisplay.cpp
@@ -232,7 +232,7 @@ QalculateResultDisplay::QalculateResultDisplay(TQWidget *parent, const char *nam
 	setFrameStyle(TQFrame::NoFrame);
 	//setFocusPolicy(TQWidget::TabFocus);
 	paletteChanged();
-	m_under_pointer = NULL;
+	m_under_pointer = nullptr;
 
 	TQToolTipGroup *tgroup = new TQToolTipGroup(viewport());
 	tooltip = new QalculateExpressionToolTip(this, tgroup);
@@ -258,7 +258,7 @@ void QalculateResultDisplay::onAnchorClicked(const TQString&, const TQString&) {
 
 TQPopupMenu *QalculateResultDisplay::createPopupMenu(const TQPoint &pos) {
 
-	m_under_pointer = NULL;
+	m_under_pointer = nullptr;
 
 	TQPopupMenu *menu = TQTextBrowser::createPopupMenu(pos);
 	menu->insertSeparator();
diff --git a/src/qalculateresultdisplay.h b/src/qalculateresultdisplay.h
index 949b9c9..317bdce 100644
--- a/src/qalculateresultdisplay.h
+++ b/src/qalculateresultdisplay.h
@@ -35,7 +35,7 @@ class QalculateResultDisplay : public TQTextBrowser {
 
 public:
 
-	QalculateResultDisplay(TQWidget *parent = 0, const char *name = 0);
+	QalculateResultDisplay(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateResultDisplay();
 
 	TQPopupMenu *createPopupMenu(const TQPoint & pos);
diff --git a/src/qalculatesetbasedialog.h b/src/qalculatesetbasedialog.h
index b2606f6..ec5fde1 100644
--- a/src/qalculatesetbasedialog.h
+++ b/src/qalculatesetbasedialog.h
@@ -34,7 +34,7 @@ class QalculateSetBaseDialog : public KDialogBase {
 
 public:
 
-	QalculateSetBaseDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateSetBaseDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateSetBaseDialog();
 
 	TQVButtonGroup *radiogroup_input, *radiogroup_output;
diff --git a/src/qalculateunitsdialog.cpp b/src/qalculateunitsdialog.cpp
index 8dc2375..c31e9a2 100644
--- a/src/qalculateunitsdialog.cpp
+++ b/src/qalculateunitsdialog.cpp
@@ -45,10 +45,10 @@ extern EvaluationOptions evalops;
 
 QalculateUnitsDialog::QalculateUnitsDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
 
-	unit_edit_dialog = NULL;
+	unit_edit_dialog = nullptr;
 	selected_category = "";
-	selected_unit = NULL;
-	selected_to_unit = NULL;
+	selected_unit = nullptr;
+	selected_to_unit = nullptr;
 	block_unit_convert = true;
 
 	TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
@@ -160,7 +160,7 @@ void QalculateUnitsDialog::updateUnitTree() {
 		++unit_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 	str = "";
 	i2 = i;
@@ -285,7 +285,7 @@ void QalculateUnitsDialog::newUnit() {
 	if(!unit_edit_dialog) {
 		unit_edit_dialog = new QalculateEditUnitDialog(this);
 	}
-	Unit *u = NULL;
+	Unit *u = nullptr;
 	if(selected_category.isEmpty() || selected_category[0] != '/') {
 		u = unit_edit_dialog->editUnit();
 	} else {
@@ -337,7 +337,7 @@ void QalculateUnitsDialog::unitSelected() {
 		Unit *u = unitItems[selected];
 		if(!CALCULATOR->stillHasUnit(u)) {
 			KMessageBox::error(this, i18n("Unit does not exist anymore."));
-			selected_unit = NULL;
+			selected_unit = nullptr;
 			emit unitsChanged();
 			return;
 		}
@@ -361,7 +361,7 @@ void QalculateUnitsDialog::unitSelected() {
 		deactivateButton->setEnabled(false);
 		convertResultButton->setEnabled(false);
 		convertGroup->setEnabled(false);
-		selected_unit = NULL;
+		selected_unit = nullptr;
 	}
 	if(!block_unit_convert) convert();
 }
@@ -468,7 +468,7 @@ void QalculateUnitsDialog::categorySelected() {
 
 	//if no items were added to the menu, reset selected unit
 	if(i == 0) {
-		selected_to_unit = NULL;
+		selected_to_unit = nullptr;
 	} else {
 		//if no menu item was selected, select the first
 		if(h < 0) {
@@ -477,7 +477,7 @@ void QalculateUnitsDialog::categorySelected() {
 			if(it2.current()) {
 				selected_to_unit = unitItems[it2.current()];
 			} else {
-				selected_to_unit = NULL;
+				selected_to_unit = nullptr;
 			}
 		}
 		toCombo->setCurrentItem(h);
diff --git a/src/qalculateunitsdialog.h b/src/qalculateunitsdialog.h
index e40672f..4a8d0c7 100644
--- a/src/qalculateunitsdialog.h
+++ b/src/qalculateunitsdialog.h
@@ -43,7 +43,7 @@ class QalculateUnitsDialog : public KDialog {
 
 public:
 
-	QalculateUnitsDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateUnitsDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateUnitsDialog();
 
 	QalculateEditUnitDialog *unit_edit_dialog;
diff --git a/src/qalculatevariablesdialog.cpp b/src/qalculatevariablesdialog.cpp
index b478058..7474bb9 100644
--- a/src/qalculatevariablesdialog.cpp
+++ b/src/qalculatevariablesdialog.cpp
@@ -41,12 +41,12 @@ extern std::vector<void*> ia_variables;
 
 QalculateVariablesDialog::QalculateVariablesDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
 
-	export_csv_dialog = NULL;
-	variable_edit_dialog = NULL;
-	matrix_edit_dialog = NULL;
-	unknown_edit_dialog = NULL;
+	export_csv_dialog = nullptr;
+	variable_edit_dialog = nullptr;
+	matrix_edit_dialog = nullptr;
+	unknown_edit_dialog = nullptr;
 	selected_category = "";
-	selected_variable = NULL;
+	selected_variable = nullptr;
 
 	TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
 	
@@ -126,7 +126,7 @@ void QalculateVariablesDialog::updateVariableTree() {
 		++variable_cats.it;
 		item->it = item->items.begin();
 	} else {
-		item = NULL;
+		item = nullptr;
 	}
 	str = "";
 	i2 = i;
@@ -233,7 +233,7 @@ void QalculateVariablesDialog::deleteVariable() {
 void QalculateVariablesDialog::editVariable() {
 	UPDATE_SELECTED_VARIABLE
 	CHECK_IF_VARIABLE_STILL_THERE
-	Variable *v = NULL;
+	Variable *v = nullptr;
 	if(selected_variable->isKnown()) {
 		if(((KnownVariable*) selected_variable)->get().isVector()) {
 			if(!matrix_edit_dialog) {
@@ -270,7 +270,7 @@ void QalculateVariablesDialog::newVariable() {
 	if(!variable_edit_dialog) {
 		variable_edit_dialog = new QalculateEditVariableDialog(this);
 	}
-	Variable *v = NULL;
+	Variable *v = nullptr;
 	if(selected_category.isEmpty() || selected_category[0] != '/') {
 		v = variable_edit_dialog->editVariable("");
 	} else {
@@ -297,7 +297,7 @@ void QalculateVariablesDialog::variableDoubleClicked(TQListViewItem*i) {
 	if(!selected_variable)
 		return;
 	CHECK_IF_VARIABLE_STILL_THERE
-	Variable *v = NULL;
+	Variable *v = nullptr;
 	if(selected_variable->isKnown()) {
 		if(((KnownVariable*) selected_variable)->get().isVector()) {
 			if(!matrix_edit_dialog) {
@@ -337,7 +337,7 @@ void QalculateVariablesDialog::variableSelected() {
 		Variable *v = variableItems[selected];
 		if(!CALCULATOR->stillHasVariable(v)) {
 			KMessageBox::error(this, i18n("Variable does not exist anymore."));
-			selected_variable = NULL;
+			selected_variable = nullptr;
 			emit variablesChanged();
 			return;
 		}
@@ -358,7 +358,7 @@ void QalculateVariablesDialog::variableSelected() {
 		deleteButton->setEnabled(false);
 		deactivateButton->setEnabled(false);
 		exportButton->setEnabled(false);
-		selected_variable = NULL;
+		selected_variable = nullptr;
 	}
 }
 
diff --git a/src/qalculatevariablesdialog.h b/src/qalculatevariablesdialog.h
index e3f4188..007ee44 100644
--- a/src/qalculatevariablesdialog.h
+++ b/src/qalculatevariablesdialog.h
@@ -41,7 +41,7 @@ class QalculateVariablesDialog : public KDialog {
 
 public:
 
-	QalculateVariablesDialog(TQWidget *parent = 0, const char *name = 0);
+	QalculateVariablesDialog(TQWidget *parent = nullptr, const char *name = nullptr);
 	virtual ~QalculateVariablesDialog();
 
 	QalculateEditVariableDialog *variable_edit_dialog;
-- 
cgit v1.2.3

