+ // Get the default palette.
+ defaultPalette = javaScriptWidgetPointer->palette();
+
+ // Populate the highlighted palette.
+ highlightedPalette = defaultPalette;
+
+ // Get the default highlight color.
+ QColor highlightColor = defaultPalette.color(QPalette::Highlight);
+
+ // Set the highlight color to be partially transparent.
+ highlightColor.setAlpha(64);
+
+ // Set highlighted background color.
+ highlightedPalette.setColor(QPalette::Window, highlightColor);
+