diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index edbd491e..310c5f83 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -50,7 +50,7 @@ from pgadmin.utils.master_password import validate_master_password, \
     set_crypt_key, process_masterpass_disabled
 from pgadmin.model import User
 from pgadmin.utils.constants import MIMETYPE_APP_JS, PGADMIN_NODE,\
-    INTERNAL, KERBEROS, LDAP
+    INTERNAL, KERBEROS, LDAP, QT_DEFAULT_PLACEHOLDER
 
 try:
     from flask_security.views import default_render_json
@@ -852,7 +852,8 @@ def utils():
             pg_libpq_version=pg_libpq_version,
             support_ssh_tunnel=config.SUPPORT_SSH_TUNNEL,
             logout_url=_get_logout_url(),
-            platform=sys.platform
+            platform=sys.platform,
+            qt_default_placeholder=QT_DEFAULT_PLACEHOLDER
         ),
         200, {'Content-Type': MIMETYPE_APP_JS})
 
diff --git a/web/pgadmin/browser/register_browser_preferences.py b/web/pgadmin/browser/register_browser_preferences.py
index 0e464c06..53d77913 100644
--- a/web/pgadmin/browser/register_browser_preferences.py
+++ b/web/pgadmin/browser/register_browser_preferences.py
@@ -10,7 +10,7 @@ import sys
 from flask_babelex import gettext
 from pgadmin.utils.constants import PREF_LABEL_DISPLAY,\
     PREF_LABEL_KEYBOARD_SHORTCUTS, PREF_LABEL_TABS_SETTINGS, \
-    PREF_LABEL_OPTIONS
+    PREF_LABEL_OPTIONS, QT_DEFAULT_PLACEHOLDER
 from flask_security import current_user
 import config
 
@@ -470,7 +470,7 @@ def register_browser_preferences(self):
     self.qt_tab_title = self.preference.register(
         'tab_settings', 'qt_tab_title_placeholder',
         gettext("Query tool tab title"),
-        'text', '%DATABASE%/%USERNAME%@%SERVER%',
+        'text', QT_DEFAULT_PLACEHOLDER,
         category_label=PREF_LABEL_DISPLAY,
         help_str=gettext(
             'Supported placeholders are %DATABASE%, %USERNAME%, and %SERVER%. '
diff --git a/web/pgadmin/browser/templates/browser/js/utils.js b/web/pgadmin/browser/templates/browser/js/utils.js
index 398bceb5..17268a4e 100644
--- a/web/pgadmin/browser/templates/browser/js/utils.js
+++ b/web/pgadmin/browser/templates/browser/js/utils.js
@@ -56,6 +56,7 @@ define('pgadmin.browser.utils',
   pgAdmin['enable_psql'] =  '{{ current_app.config.get('ENABLE_PSQL') }}' == 'True';
   pgAdmin['allow_psql_shell_commands'] =  '{{ current_app.config.get('ALLOW_PSQL_SHELL_COMMANDS') }}'  == 'True';
   pgAdmin['platform'] =  '{{platform}}';
+  pgAdmin['qt_default_placeholder'] = '{{qt_default_placeholder}}'
 
   /* GET Binary Path Browse config */
   pgAdmin['enable_binary_path_browsing'] = '{{ current_app.config.get('ENABLE_BINARY_PATH_BROWSING') }}' == 'True';
diff --git a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js
index 68f1ba81..51b55db7 100644
--- a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js
+++ b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js
@@ -191,6 +191,17 @@ let NewConnectionDialog = {
               self.showNewConnectionProgress[0]
             ).addClass('d-none');
           },
+          get_title: function(qt_title_placeholder, selected_database_name, newConnCollectionModel, response) {
+            qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%DATABASE%'), selected_database_name);
+            if(newConnCollectionModel['role']) {
+              qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['role']);
+            } else {
+              qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['user']);
+            }
+
+            qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%SERVER%'), response.server_name);
+            return qt_title_placeholder;
+          },
           callback: function(e) {
             let self = this;
             if (e.button.element.name == 'dialog_help') {
@@ -210,19 +221,11 @@ let NewConnectionDialog = {
                 }
               });
               let tab_title = '';
-
               var qt_title_placeholder = preferences['qt_tab_title_placeholder'];
-              qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%DATABASE%'), selected_database_name);
-
-              if(newConnCollectionModel['role']) {
-                qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['role']);
-              } else {
-                qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['user']);
-              }
-
-              qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%SERVER%'), response.server_name);
 
-              tab_title = qt_title_placeholder;
+              tab_title = this.get_title(qt_title_placeholder, selected_database_name, newConnCollectionModel, response);
+              let qt_default_placeholder = pgAdmin['qt_default_placeholder'];
+              let conn_title = this.get_title(qt_default_placeholder, selected_database_name, newConnCollectionModel, response);
 
               if(!newConnCollectionModel['role']) {
                 newConnCollectionModel['role'] = null;
@@ -247,6 +250,7 @@ let NewConnectionDialog = {
                   'server': newConnCollectionModel['server'],
                   'database': newConnCollectionModel['database'],
                   'title': _.escape(tab_title),
+                  'conn_title': _.escape(conn_title),
                   'user': newConnCollectionModel['user'],
                   'role': newConnCollectionModel['role'],
                   'server_name': _.escape(response.server_name),
diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
index 8ff0cef6..d2ebf592 100644
--- a/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
+++ b/web/pgadmin/tools/datagrid/static/js/datagrid_panel_title.js
@@ -23,7 +23,7 @@ function isServerInformationAvailable(parentData) {
   return parentData.server === undefined;
 }
 
-export function getPanelTitle(pgBrowser, selected_item=null, custom_title=null, parentData=null) {
+export function getPanelTitle(pgBrowser, selected_item=null, custom_title=null, parentData=null, conn_title=false) {
   var preferences = pgBrowser.get_preferences_for_module('browser');
   if(selected_item == null && parentData == null) {
     selected_item = pgBrowser.treeMenu.selected();
@@ -38,10 +38,14 @@ export function getPanelTitle(pgBrowser, selected_item=null, custom_title=null,
 
   const db_label = getDatabaseLabel(parentData);
   var qt_title_placeholder = '';
-  if (custom_title) {
-    qt_title_placeholder = custom_title;
+  if (!conn_title) {
+    if (custom_title) {
+      qt_title_placeholder = custom_title;
+    } else {
+      qt_title_placeholder = preferences['qt_tab_title_placeholder'];
+    }
   } else {
-    qt_title_placeholder = preferences['qt_tab_title_placeholder'];
+    qt_title_placeholder = pgAdmin['qt_default_placeholder'];
   }
 
   var title_data = {
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 33547223..21640658 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -110,7 +110,7 @@ define('tools.querytool', [
       this.set_server_version(opts.server_ver);
       this.trigger('pgadmin-sqleditor:view:initialised');
       this.connection_list = [
-        {'server_group': null,'server': null, 'database': null, 'user': null, 'role': null, 'title': '&lt;' + gettext('New Connection') + '&gt;'},
+        {'server_group': null,'server': null, 'database': null, 'user': null, 'role': null, 'conn_title': '&lt;' + gettext('New Connection') + '&gt;'},
       ];
     },
 
@@ -184,9 +184,9 @@ define('tools.querytool', [
         data_list.forEach((option, index) => {
           var opt = '';
           if ('is_selected' in option && option['is_selected']) {
-            opt = '<li class="connection-list-item selected-connection" data-index='+ index +'><a class="dropdown-item" href="#" tabindex="0">'+ option.title +'</a></li>';
+            opt = '<li class="connection-list-item selected-connection" data-index='+ index +'><a class="dropdown-item" href="#" tabindex="0">'+ option.conn_title +'</a></li>';
           } else {
-            opt = '<li class="connection-list-item" data-index='+ index +'><a class="dropdown-item" href="#" tabindex="0">'+ option.title +'</a></li>';
+            opt = '<li class="connection-list-item" data-index='+ index +'><a class="dropdown-item" href="#" tabindex="0">'+ option.conn_title +'</a></li>';
           }
           $('#connections-list').append(opt);
         });
@@ -2284,7 +2284,7 @@ define('tools.querytool', [
               'sid': connection_details['server'],
               'title': connection_details['title'],
             };
-            self.set_editor_title(_.unescape(self.handler.url_params.title));
+            self.set_editor_title(_.unescape(connection_details['conn_title']));
             self.handler.setTitle(_.unescape(self.handler.url_params.title));
             let success_msg = connection_details['server_name'] + '/' + connection_details['database_name'] + '- Database connected';
             alertify.success(success_msg);
@@ -2295,6 +2295,7 @@ define('tools.querytool', [
                 'database': connection_details['database'],
                 'user': connection_details['user'],
                 'title': connection_details['title'],
+                'conn_title': connection_details['conn_title'],
                 'role': connection_details['role'],
                 'is_allow_new_connection': true,
                 'database_name': connection_details['database_name'],
@@ -2672,10 +2673,8 @@ define('tools.querytool', [
 
           var server_data = pgWindow.default.pgAdmin.Browser.treeMenu.findNode(tree_data.slice(0,2));
           var database_data = pgWindow.default.pgAdmin.Browser.treeMenu.findNode(tree_data.slice(0,4));
-
-
-
-          self.gridView.set_editor_title(_.unescape(url_params.title));
+          let conn_title = panelTitleFunc.getPanelTitle(pgWindow.default.pgAdmin.Browser, null, null, null, true);
+          self.gridView.set_editor_title(_.unescape(conn_title));
           let connection_data = {
             'server_group': self.gridView.handler.url_params.sgid,
             'server': self.gridView.handler.url_params.sid,
@@ -2683,6 +2682,7 @@ define('tools.querytool', [
             'user': server_data.data.user.name,
             'role': null,
             'title': _.unescape(url_params.title),
+            'conn_title': _.unescape(conn_title),
             'is_allow_new_connection': false,
             'database_name': _.unescape(database_data.data.label),
             'server_name': _.unescape(server_data.data.label),
diff --git a/web/pgadmin/utils/constants.py b/web/pgadmin/utils/constants.py
index 5fd94230..ee2797f5 100644
--- a/web/pgadmin/utils/constants.py
+++ b/web/pgadmin/utils/constants.py
@@ -31,6 +31,9 @@ UNAUTH_REQ = "Unauthorized request."
 SERVER_CONNECTION_CLOSED = gettext(
     'Not connected to server or connection with the server has been closed.')
 
+# Query tool placeholder
+QT_DEFAULT_PLACEHOLDER = '%DATABASE%/%USERNAME%@%SERVER%'
+
 # Data Types
 DATATYPE_TIME_WITH_TIMEZONE = 'time with time zone'
 DATATYPE_TIME_WITHOUT_TIMEZONE = 'time without time zone'
