make a auto adjustable QTextBrowser - c++

hello i need make a auto adjustable QTextBrowser.
It's means the height of the QBrowserText depend of the number of rows it contained, somebody can help me please ?

Look at this page: http://qt-project.org/forums/viewthread/10240/
They used QDockWidget.
And here: http://www.mimec.org/node/383

Related

Glass: setText size limitation ? How to display full screen text

I've just updated my glasses to XE12. Since then the Card doesn't behave in the same way as before.
I want to display a card of text. Here is my current code, I had to change "setFullScreenImages" by "setImageLayout()" as it was deprecated.
card = new Card(this);
card.setText("Ce chocolat contient :\nSucre, beurre de cacao, cacao (min 31.5%), lait en poudre entier, liqueur de cacao, lécithine, vanilline.");
card.setImageLayout(ImageLayout.FULL);
card.addImage(R.drawable.card_chocolate_background);
card.setFootnote("Info produit");
The result I got with XE11 was:
The result with XE12:
Can someone tell me how to display the text correctly ? I have a demo tomorrow and I'm a bit stucked with this autoupdate.
Thanks !
This was indeed a change in the full-screen image layout in XE12, to match other card styles used on Glass.
If you're just using the Card to generate views, you can duplicate the old look with a custom layout for the time being. If you need it to insert static cards, on the other hand, you'll either need to use the new layout or switch to ImageLayout.LEFT to fit some more text on the card. You may want to follow issue 315 on our issue tracker, since it sounds like that functionality would help you with creating more customized layouts.

How to customize Sitecore workflow Comment box

I am working in Sitecore 7 and want to customise the comments textbox. I need following functionality:
Instead of Single line, I want to replace it with multiline.
Is it possible to have rich text box instead of single line to allow users to put more meaningful comments and those are visible in History too.
You have to modify a lot to do it. When you approve button is called this command :
<command name="item:workflow" type="Sitecore.Shell.Framework.Commands.Workflow,Sitecore.Kernel"/>
with some parameters
Inside this class you have next method :
protected void Run(ClientPipelineArgs args)
{
...
where you find next lines of code that is called to show single line input :
...
if (!flag1 && flag2 && !flag3)
{
SheerResponse.Input("Enter a comment:", "");
args.WaitForPostBack();
}
Yes, this is possible, but you'll have to essentially recreate and replace some basic functionality to do it. And worse... it will require use of SheerUI, which is not documented anywhere from Sitecore that I know of. You have to figure it out by disassembling existing code. If you look at Sitecore's implementation of say, the Approve action, you'll see there is a SheerUI call to get the comment text. (not looking at it right now, so I don't know exactly where this is) You'll need to replace this with a SheerUI call to load your own custom dialog. How do you do this? Well... man, wouldn't documentation on this be nice?

xsl:fo - Add "z-index" to a text on top of an image

I have a problem.
I need to set some kind of z-index, like you can use on the web in HTML/CSS.
Because I have a text on an image, and therefore I want to be sure that it looks good when printing.
Is there some "z-index" code I can use on theese fo:block elements?
Thanks!
/Daniel
XSL-FO defines z-index property:
http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#z-index
You have to check your formatting agent whether does support this property.

Change QML font.pointSize in C++

I have managed to change the "color" property of QML text with C++ using this:
theText->setProperty("color", "red");
but if I try
theText->setProperty("font.pointSize", 20);
then nothing happens(it's not that size), I've tried this with other things that include a "." but none seem to work, I think the "." may be part of the problem. I'd really appreciate if someone could help me change the QML font size using C++.
Look for actual property name. And as far as i know there is no sub-properties in QObjects... So you need something like this:
QFont f = theText->property("font").value<QFont>();
f.setPointSize(20);
theText->setProperty("font",f);

Customize page number when printing a QTextDocument

I'm trying to print the content of a QTextEdit. For that I'm using QTextDocument::print(QPrinter*). Doing that, a page number is automatically added at the right bottom of the page.
Is there any way to change its format / move it / get rid of it?
Thanks.
As far as I know that is hard coded into Qt, so you can't change it.
Have a look at QTBUG-1688. There you see that this fact has already been reported, but they don't seem to work on it. So you will have to do it yourself, I think.
If you need that, there is an way. You can use
void QTextDocument::drawContents ( QPainter * p, const QRectF & rect = QRectF() )
Add your desired footer using this.. Obviously it isn't a good one but if you need it for sure, make use of it.
I haven't give a try though. But it should work.