Using richtext in QTextEdit - c++

What is exactly richtext and how do I format data in richtext in QTextEdit?

The internal rich text format is tag/attribute-based, and is similar to HTML using in-line CSS style="xxx" attributes. The default export/import format (using toHTML/setHTML) is a subset of HTML. See this link:
http://doc.trolltech.com/4.6/richtext-html-subset.html
Note that CSS classes are not supported internally and are converted to their representing attributes at import.

QTextEdit can display text that is formatted with additional layout and style information (i.e. enriched) which can be set either programatically or by using a subset of HTML.
The Rich Text Processing documentation gives you an overview and pointers to more in-depth information.

If you're looking for a WYSIWYG toolbar for the QTextEdit, you'll end up disappointed. There is no default one (although the SDK contains an example app). So you should either make the toolbar yourself or find one.

Related

SharePoint design manager: how to insert a RichHtmlField?

I have created a site column of type Multiple lines of text and added it to a content type.
I have then created a page layout with the design manager using this content type.
The field inserted in the page layout is always a NoteField but I would like a RichHtmlField.
I don't know how to configure the field in the Snippet Gallery.
I have tried to specified the type of text to allow for the site column:
Rich text (Bold, italics, text alignment, hyperlinks)
Enhanced rich text (Rich text with pictures, tables, and hyperlinks)
It doesn't matter what I choose, I always end up with a NoteField.
Apparently, instead of choosing a site column of type Multiple lines of text, choosing the type Publishing HTML (Full HTML content with formatting and constraints for publishing) brings the rich editor needed. Still seems weird though.

Sitecore 8 implement tooltip on RTE authored content

We have a requirement to implement tooltips for words that are authored in Sitecore RTE.
The idea behind is that user should be able to hover over the word and see it's description/meaning.
Is this possible to achieve in sitecore? Did a quick search on marketplace but could not find any modules.
Below are some options to consider for achieving what you described.
Inject Tooltip HTML in a renderField pipeline
In this option, you would extend the renderField pipeline. First, you will need to ensure that you are dealing with a rich-text field, and if so, locate terms and replace them with the necessary markup that is required for the tooltip. This could be as simple as wrapping the word in an <abbr> or perhaps a <span> element with a CSS class. The list of terms and tooltip content could be sourced from items in Sitecore or a custom Sitecore Dictionary. Caching the terms would be essential as this pipeline processor is invoked frequently every time a field is rendereded.
Progressive enhancement with JavaScript
This approach is almost entirely based on the client-side. Terms could be located and replaced fairly easily with the help of JQuery. If the list of terms is of a reasonable size, they could be bootstrapped into a JavaScript variable. Once terms are located and enhanced, a separate, asynchronous call to a REST endpoint could be made when hovering or clicking the term. The API would accept a term and respond with the term's definition.
HTML Snippet in RTE Editor
Sitecore RTE editor can be extended with additional buttons. One of these options allows you to insert predefined snippets of HTML. The RTE editor also has a setting to specify a CSS file to style the content within the field (<setting name="WebStylesheet" value="/css/yourstylesheet.css" />). Styling would be necessary in order to target the description markup and make it visible to be edited, whereas, on the public site, the description markup would normally be hidden by default until the term is clicked on or hovered over.
Dynamic Link Replacement
http://www.layerworks.com/blog/sitecore-token-replacement

Sitecore 8 - Adding images, callouts and videos in RTF field

I am working on a requirement in Sitecore 8 according to which there is a Rich text field and the content author can not only add html data but can also add predefined call outs/renderings/images directly in page editor mode.
Is there any way I can achieve this ? Please help.
We achieve this using Components in Experience Editor. As you create pages, we created components for Image, Video, Text and any Callouts. You will be able to drop components on the page based on specified placeholder settings. In my opinion it is the cleanest approach.
It sounds like 'snippets' is the way to go for you. There are some posts on the web about how to add snippets to RTF fields:
http://davetayls.me/blog/2011/02/07/adding-rich-snippets-to-sitecore-rich-text-editors/
http://sitecoreblog.blogspot.ca/2010/11/richtext-editor-add-code-snippet-or.html
http://learnsitecore.cmsuniverse.net/en/Editors/Articles/2009/06/How%20to%20use%20snippets.aspx

How to Specify fonts for Text fields using muPDF

I am using muPDF library to add fields in existing PDF Documents.
I have successfully added a checkbox by defining its appearance.
But Text Fields are a problem as they need a Font Resource.
I cant figure out how to add fonts in a PDF document.
muPDF does have functions that deal with fonts, but I am unable to use them in a proper manner.
So i need to know how to load a font in a PDF document and how to reference them to my Text Field in the default appearance(DA).
----------------------------------------------------------EDIT------------------------------------------------------------------
Currently I am using the function pdf_set_free_text_details in pdf-annot-edit.c
But it only sets the predefined fonts . i wish to use other fonts as well
If this is not the right place to ask this question, then please if somebody could redirect me to the correct place. MuPDF only has a bug report site as far as i know.
Pass any of the font types specified on pdf-font.c as a string.
For eg: "Courier", "CourierNew", etc..

Customized Rich Text Editor in Sitecore to generate BBCode tags instead of HTML

I am currently creating a mobile site using Sitecore, where I cannot use HTML as markup instead need to use BML as markup language for mobile. Please let me know the following in this regard:
We have a field called Description and its of type RICH TEXT. Here we cannot use the normal Rich Text Editor given by the Sitecore as it generates HTML. So can anyone tell me if I can create a customized RICH TEXT Editor with a button Say "Mobile Bold" and which should generate tags for mobile instead of normal HTML <b></b> tags .
As you all know we can change the RICH TEXT Editor from Default to FULL by setting the source attribute of the field to /sitecore/system/Settings/Html Editor Profiles/Rich Text Full. So in the similar way can I create one more item in the Core DB as /sitecore/system/Settings/Html Editor Profiles/MobileRichTextFull and include customized buttons to it so as to generate BML tags as described above. If this is possible let me know what are all the settings need to be done and steps to be followed for the same.
do you want the users to edit BML directly, or are you able to transform HTML to BML?
For the latter, you'd better solve this in the presentation layer/pipeline.
HTML Agility Pack will be your friend when going for this last solution.
Otherwise, look at Teleriks resources about the editor.