@zespy , hello!
I've been trying to do exactly same thing - print text with QText2DEntity.
And, unfortunately, that code doesn't work for me. I've been variating all parameters for a while and haven't reach any result - just nothing appears on screene.
Is it possible to add any other example or\and example project?
And thank's you for this thread, it's still biggest conversation about QText2DEntity usage
@aha_1980 Thanks for the answer . I will try your sugestions and see how it goes. I've done all this text to ASCII in console codeblocks C++ but it seems that i need a gui to it. I am not as good in Class'es and things like that. I will try it anyways. An example could be more than good for one letter . i could do the rest alone :P . Have a good night
@raven-worx Didn't know about those methods, just tested it, for the lower case letter "g":
QFontMetricsF::leftBearing() returns: -4.17188
QFontMetricsF::rightBearing() returns: 0.6875
But even if I add the (negated) leftBearing to the total text width it still doesn't cover the tail entirely, so what's wrong here?
are you sure?!
Those values seem to be correct / make sense according to your posted screens.
Make sure that you add the absolute value (qAbs() for example). Also keep in mind that those values are only correct for the given font-size and that you can't add negative values to a image width.
I guess you are just doing incorrect calculations. Can you show the code of the calculation?
instead of converting the unicode string to the escaped characters send it directly in binary form. When you have a QString already you can call QString::toUtf8() and send the returned QByteArray directly. On the client its enough to do QString::fromUtf8( receivedUtf8ByteArray.constData() )
It depends how you implemented the transfer.
But theoretically it should be enough to replace your unicode escaping code on the server with this approach.
You can use QSqlQuery to run the select statements and loop the resultset with next() like in VRonin´s example. If you comma seperate the columns like in VRonin´s example you can open this file in excel.
One more option, if your on windows is to use ODBC Excel Driver to generate the Excel file. With this you can use QSqlQuery to create tables and insert rows.
The application runs in RAM, with all the qt dll useful for the deployment. Is it possible that a RAM corruption can cause a problem related to interface (font corruption, background image corruption...)?
So as it turns out, compiling Qt 5.5 from git seems to solve this problem. I tried my demo program, as well as Maroon, and both display text by default (without having to set renderType to Text.NativeRendering).
Dang it. That's what I get for trying a pre-release version. Thanks for the suggestion.
I found addiotional regularity: problematic delegates have the same picture as last top delegate hidden during scroll down within ListView.
It seems scrolling out delegate from visible area forces it's image repaint in other delegates, which are in visible area.
This repaint seems to hide the text element, declered with z-order above the image.
Reset the visible property (visible=false, visible=true) at end of each scrolling (using onMovementEneded) solves the problem.
But, i don't want to pay the repaint price of such solution as my application is running on embedded device.
Based on the documentation, QtDeclarative has already been deprecated in favor of the two new classes: Qt Quick and Qt QML. QQuickPaintedItem can be use as convenient way to port QDeclarativeItem-based classes that use the QPainter API.
I've been searching on the internet how to render text on QSG nodes but to no avail. I'm still stuck into this problem. :(
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.