Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » GetSmartTextSize() fails with QTF text
GetSmartTextSize() fails with QTF text [message #61431] Sat, 08 February 2025 00:12 Go to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello,

While investigating a bug in GraphCtrlI just found a bug in GetSmartTextSize()

The following code:
	String s = "\1[1= 13h27:42&][1= 9 Jan&][1*= 0]";
	Size sz = GetSmartTextSize(s);
	RDUMP(s);
	RDUMP(sz);

	s = "[1= 13h27:42&][1= 9 Jan&][1*= 0]";
	sz = GetSmartTextSize(s);
	RDUMP(s);
	RDUMP(sz);


Displays:
s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (1073741850, 54)    ===> With QTF text: X size is not correct 

s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (191, 18)


Note: In QTF designer, the string is displayed correctly

[Updated on: Sat, 08 February 2025 00:14]

Report message to a moderator

Re: GetSmartTextSize() fails with QTF text [message #61432 is a reply to message #61431] Sun, 09 February 2025 23:17 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
Hello Didier,

Have you tried to rebuild all and clear the Upp's cache. Sometimes that can be the cause.
With the U++ nightly (on Linux) I get:

s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (46, 48)
s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (186, 17)


Best regards,
Oblivion


Re: GetSmartTextSize() fails with QTF text [message #61433 is a reply to message #61432] Mon, 10 February 2025 07:53 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
Hello Didier

Running it in Windows11 with CLANG I get this in the .log:

s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (52, 45)
s = [1= 13h27:42&][1= 9 Jan&][1*= 0]
sz = (178, 15)


Best regards
Iñaki
Re: GetSmartTextSize() fails with QTF text [message #61440 is a reply to message #61433] Wed, 12 February 2025 21:16 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Koldo,

Thank you for you're feedback.
I will try erasing cache.

Although in all the years working with Upp, I only encountered this issue recently.
Is this du to Clang or a Bug in Upp Builder: sometimes modified files are not detected correctly and build doesn't get correctly refreshed

Since this 'clean cache problem' seems to be more present, maybe there should be an "Erase cache" button in TheIde ?

[Updated on: Wed, 12 February 2025 22:31]

Report message to a moderator

Re: GetSmartTextSize() fails with QTF text [message #61474 is a reply to message #61440] Thu, 20 February 2025 09:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
index.php?t=getfile&id=7047&private=0

Although we definitely should track these dependency issues down.
Re: GetSmartTextSize() fails with QTF text [message #61479 is a reply to message #61474] Thu, 20 February 2025 22:12 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

The --rebuild all-- does not fix the issue (I use it very often when I have a doubt or as a habit)
Ide used to track dependencies very well and I was very confident about it. But since some time now (maybe a year or more) I regularly stumble on this problem (On linux AND on windows).
Even some collegues stumbled on it : the problem was comming from the cache.

I have to admit that I do not have a clear knowledge of where all the meta-data is saved but there should at least be a paragraph that talks about it (excuse me if there is one that I have no knowledge about)

I think this problem should be taken very seriously as it could push away Upp users very quickly if they have no confidence on the build system (I have already pushed away some work because I am getting tired of tracking down build problems that happen without any obvious reason)

Re: GetSmartTextSize() fails with QTF text [message #61480 is a reply to message #61431] Thu, 20 February 2025 22:56 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1210
Registered: August 2007
Senior Contributor
Quote:
Ide used to track dependencies very well and I was very confident about it. But since some time now (maybe a year or more) I regularly stumble on this problem (On linux AND on windows).
Even some collegues stumbled on it : the problem was comming from the cache.


I can confirm this from my experience. For some time (I don't know when it started exactly) I am getting build system cache issues that cause apps to behave erratically or directly crash.

This is mostly harmless as it is easily noticable when the app stops working and crashes immediately after start for no apparent reason. However, sometimes it can introduce nasty bugs that gets triggered only when certain action is taken later.

By the way, One very visible cache update issue is with TheIDE's layout editor: Unless I rebuild all, TheIDE does not rebuild the package after I modify the layouts. I am always forced to rebuild all (rebuilding the package doesn't work either).

(This happens on Linux)

Best regards,
Oblivion



[Updated on: Thu, 20 February 2025 22:56]

Report message to a moderator

Re: GetSmartTextSize() fails with QTF text [message #61481 is a reply to message #61479] Thu, 20 February 2025 23:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 20 February 2025 22:12
Hello Mirek,

The --rebuild all-- does not fix the issue (I use it very often when I have a doubt or as a habit)


OK, so what can be different? (it works just fine for me).

Maybe you can post complete testcase?

Quote:

I think this problem should be taken very seriously as it could push away Upp users very quickly if they have no confidence on the build system (I have already pushed away some work because I am getting tired of tracking down build problems that happen without any obvious reason)


That is strange, I am not having any problems besides after git pull, where it is understandable...

Mirek
Re: GetSmartTextSize() fails with QTF text [message #61482 is a reply to message #61480] Thu, 20 February 2025 23:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Oblivion wrote on Thu, 20 February 2025 22:56
Quote:
Ide used to track dependencies very well and I was very confident about it. But since some time now (maybe a year or more) I regularly stumble on this problem (On linux AND on windows).
Even some collegues stumbled on it : the problem was comming from the cache.


I can confirm this from my experience. For some time (I don't know when it started exactly) I am getting build system cache issues that cause apps to behave erratically or directly crash.


This is mostly harmless as it is easily noticable when the app stops working and crashes immediately after start for no apparent reason. However, sometimes it can introduce nasty bugs that gets triggered only when certain action is taken later.

By the way, One very visible cache update issue is with TheIDE's layout editor: Unless I rebuild all, TheIDE does not rebuild the package after I modify the layouts. I am always forced to rebuild all (rebuilding the package doesn't work either).

(This happens on Linux)
[/quote]

OK, ok. I am not having problems at all; however as layouts are included, it can have something to do with include dependencies and with the way how sources are arranged (and included...).

Perhaps you can produce some package using layout that demonstrates the issue? (Or just tell me if it happens with some example).

There must be something you guys do and I do not...

What do you mean by "cache" BTW? (well, information about files IS cached in PPInfo, I was actually fixing things there this week - can you test with fresh ide?)

Mirek
Re: GetSmartTextSize() fails with QTF text [message #61483 is a reply to message #61482] Fri, 21 February 2025 20:35 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

For a test case : impossible, it happens without any obvious reason and sometimes goes away whitout any reason

Quote:
What do you mean by "cache" BTW
there is user/.cache directory (not git cache dir) that the Ide uses to store build results

Quote:
This is mostly harmless as it is easily noticable when the app stops working and crashes immediately after start for no apparent reason. However, sometimes it can introduce nasty bugs that gets triggered only when certain action is taken later
A crash is very visible, but when the build problem doesn't imply (quick) application crash then you always have a question in the back of you're head "Is my application correctly build ??"


A few weeks ago I had a case where it was impossible to build (rebuild all didn't work, nor clear package), modifying .cpp or .h didn't work either, so I tried to:
  1. Stop Ide, erase some config files, cache dir, ... everything I could find
  2. Restart Ide and try to build (so that Ide would build new files)
  3. If not successful build, go back to (1) to try to pin down what was causing the problem
I never found the problem ==> I solved the problem by doing a fresh install of all Upp Sad

My guess is that:
* I missed some files used by Ide (Where could they be ??)
* The problem comes from the way I update Ide:
...* Update upp sources from git (latest version) (maybe the git versions I get weren't stable enough ??)
...* build Ide
...* replace current Ide bin file (sometimes changing ide bin name)
...==> maybe old files are not read correctly by by new Ide (or old files incompatible with new Ide) ?


[Updated on: Fri, 21 February 2025 20:42]

Report message to a moderator

Re: GetSmartTextSize() fails with QTF text [message #61509 is a reply to message #61483] Thu, 27 February 2025 23:44 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

I think I found something interesting: when compiling in "verbose", all paths to UppHub packages get included although I have only included one in my application package dependencies.

So if I have same packages present in UppHub and in another nest (both nests present in nest config paths) ... things will probably get nasty
Re: GetSmartTextSize() fails with QTF text [message #61510 is a reply to message #61509] Fri, 28 February 2025 00:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 27 February 2025 23:44
Hello Mirek,

I think I found something interesting: when compiling in "verbose", all paths to UppHub packages get included although I have only included one in my application package dependencies.

So if I have same packages present in UppHub and in another nest (both nests present in nest config paths) ... things will probably get nasty


Ah, that is actually by design. Seems the design might be wrong...
Re: GetSmartTextSize() fails with QTF text [message #61514 is a reply to message #61509] Fri, 28 February 2025 12:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 27 February 2025 23:44
Hello Mirek,

I think I found something interesting: when compiling in "verbose", all paths to UppHub packages get included although I have only included one in my application package dependencies.

So if I have same packages present in UppHub and in another nest (both nests present in nest config paths) ... things will probably get nasty


Well, while I doubt this really can cause problems (or fix your problems), but just to be sure I have now tried to fix the builder so that only nests with packages that are used are in include path now. Please test.
Re: GetSmartTextSize() fails with QTF text [message #61515 is a reply to message #61514] Fri, 28 February 2025 23:54 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Thank you Mirek,
I will update my Ide and keep an eye on the build problem
Re: GetSmartTextSize() fails with QTF text [message #61517 is a reply to message #61515] Sun, 02 March 2025 15:04 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

I just updated my Ide and UppHub packages compilation is now broken (not my packages specifically but all packages).


Re: GetSmartTextSize() fails with QTF text [message #61519 is a reply to message #61517] Sun, 02 March 2025 18:50 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
The include paths for UppHub packages lacks the Package directory: it only points the UppHub nest directory
Re: GetSmartTextSize() fails with QTF text [message #61521 is a reply to message #61519] Mon, 03 March 2025 08:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Didier wrote on Sun, 02 March 2025 18:50
The include paths for UppHub packages lacks the Package directory: it only points the UppHub nest directory


It was always this way. That is why we

#include <CtrlLib/CtrlLib.h>

and not just

#include <CtrlLib.h>

Doing ontherwise would cause a lot of troubles...

The change I have done is to remove unused nests.
Re: GetSmartTextSize() fails with QTF text [message #61523 is a reply to message #61521] Mon, 03 March 2025 22:57 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 728
Registered: November 2008
Location: France
Contributor
Hello Mirek,

I wasn't clear enough, now you have to :
#include <Scatter/ScatterCtrl/ScatterCtrl.h>

Sorry Koldo for taking you're package as example, but I had to take someone elses package Wink

The following Upphub applications do not compile any more because of the same type of include path error :
- Bobcat
- SatterCtrl_demo
- StackCtrlExample ( UppHub/StackCtrl/examples/StackCtrlExample/main.cpp:1:10: fatal error: 'StackCtrl/StackCtrl.h' file not found )

I stopped testing other UppHub packages Smile


Re: GetSmartTextSize() fails with QTF text [message #61524 is a reply to message #61523] Tue, 04 March 2025 07:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Didier wrote on Mon, 03 March 2025 22:57
Hello Mirek,

I wasn't clear enough, now you have to :
#include <Scatter/ScatterCtrl/ScatterCtrl.h>

Sorry Koldo for taking you're package as example, but I had to take someone elses package Wink

The following Upphub applications do not compile any more because of the same type of include path error :
- Bobcat
- SatterCtrl_demo
- StackCtrlExample ( UppHub/StackCtrl/examples/StackCtrlExample/main.cpp:1:10: fatal error: 'StackCtrl/StackCtrl.h' file not found )

I stopped testing other UppHub packages Smile




I am not sure what went wrong in your case, but further testing proved that the change was a bad idea - some packages seems to just include stuff from elsewhere without actually adding it to the project (e.g. Scatter includes Eigen without using it). So reverted...

Which means it will be adding all paths to all hub nests again - and it is as it should be.
Re: GetSmartTextSize() fails with QTF text [message #61525 is a reply to message #61524] Tue, 04 March 2025 08:04 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
No problem, but please remember that ScatterDraw do include Eigen Smile
My unittest is stopped for some days for maintenance. After that I will test if the include have to be changed.


Best regards
Iñaki

[Updated on: Tue, 04 March 2025 08:06]

Report message to a moderator

Previous Topic: Stream Load serialization fired twice
Next Topic: SSL.h
Goto Forum:
  


Current Time: Mon Jun 09 23:30:55 CEST 2025

Total time taken to generate the page: 0.06294 seconds