QTextCursor::setPosition: Position '8' out of range

I tried to draw my my first line but I can’t. QTextCursor::setPosition: Position '8' out of range is displayed after clicking Length input. Analogous message is displayed when Angle input is clicked. There is nothing I can do about it - after clicking OK message reappears. I can only kill the program from process manager.

Operating system: Linux Mint 21.1 Cinnamon
Installation: flatpak Seamly2D net.seamly.seamly2d v2023.1.16.230
1 Like

Because you’ve used the comma instead of the decimal point. In other words you’ve turned 11 into 11 thousand… out of range.

Have you set your prefs to account for using the comma instead?

1 Like

The preference is found under the Language tab in the General panel of the Application Preferences dialog.

I am very curious about if that has an effect, since I am unable to duplicate the issue over here. If I try changing a “.” to a “,” I don’t get any errors, I’m just not allowed to press OK before I fix it.

:unicorn:

1 Like

Because you’ve used the comma instead of the decimal point. In other words you’ve turned 11 into 11 thousand… out of range.

Actually I did not enter this value. It was already there after I had drawn some random “point” with mouse.

I have unchecked Decimal separator, now this window has values with decimal point but that makes no change:

obraz

2 Likes

AppImage version works exactly the same.

1 Like

Hmmm… on 2nd look - it appears related to line edit textbox, and for some reason it can’t set the cursor to the end of the text… 7 chars - next position is 8.

Couple questions do you know what build date of the app is it?

What language is set, and have you tried English?

I’d like to see what happens if you try to load a pattern. I’d attach one, but I don’t have easy access to one via the phone.

1 Like

I just downloaded the newest version and tried it on Linux Mint 20.3. It worked as it should. I could not reproduce the problem. It can be either related to the newest Mint 21 version, or to our computers differing in some other essential feature.

2 Likes

Good to know it’s probably not something new in the latest release… but then this is the 1st time I’ve seen this error - and I’ve gotten a lot of strange ones coding the app. I pretty much always use this tool in testing new features. I’d like to see what happens with another tool - one that you can start with the base point- maybe an arc?

Or I’m thinking the language… like a char issue.

1 Like

Well I have determined from the original pic the language is set to Polish? I will try playing around later tonight changing the language to see if I can reproduce the error.

1 Like

This is what application prints out on start:

$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=seamly2d --file-forwarding net.seamly.seamly2d

Seamly2D: Setting QT_MAC_WANTS_LAYER=1 and QSG_RENDER_LOOP=basic
Gtk-Message: 08:52:30.086: Failed to load module "xapp-gtk3-module"
Qt: Session management error: Could not open network socket
Checked locale: "pl_PL"
DEBUG:Log file /home/xxxxxxx/.var/app/net.seamly.seamly2d/config/Seamly2DTeam/seamly2d-pid2.log was locked.
DEBUG:Clearing old logs
DEBUG:Version: "0.6.0.1"
DEBUG:Build revision: Git:19110d130bf4
DEBUG:"Based on Qt 5.15.7 (GCC 12.1.0, 64 bit)"
DEBUG:Built on Jan 16 2023 at 06:40:50
DEBUG:Command-line arguments: ("seamly2d")
DEBUG:Process ID: 2
DEBUG:Checked locale: "pl_PL"
DEBUG:Initialize Tool Options Property editor.
DEBUG:Initialize Groups manager.
DEBUG:Can't get tag Groups.
DEBUG:Updating recent file actions.
DEBUG:Value 100.000000

DEBUG:Autosaving every 1 minutes.
DEBUG:Reading settings.

After reinstalling from scratch (flatpak uninstall --delete-data net.seamly.seamly2d) these are the default setting of application: obraz

Changing this to GUI Language=American English and Label language=American English makes no changes.

Unchecking Decimal separator makes no change according to error.

Starting with different tool - arc produces the same error: obraz

In ‘Point at distance and angle’ dialog ‘Point label’ input does not exhibit issue (I can click on this input and write whatever I want), only ‘Length’ and ‘Angle’ are affected: obraz

BUT: trying on the other computer with Mint 21.1 which I use as a multimedia computer it works fine :confused:

2 Likes

Now I discovered that clicking with mouse exactly on the digits does not trigger the error, while clicking somewhere on the white area of the input box triggers it immediately: obraz

Moreover if I click on the digits, the cursor shows in the input, then subsequent pressing right arrow moves the cursor to the right and eventually already known setPosition: Position ‘8’ out of range message` pops out.

2 Likes

That would seem to indicate it’s a computer related issue.

I have no clue why this would be happening. And yes after checking the code again, it’s going to happen with every formula text box as when a box gains focus a base class function is called to set the cursor to the end of the text. I think if it were a code issue, everyone would be having the issue.

2 Likes

Correct. The Formulas use a QPlainTextEdit box, while the point name use a QLineEdit box. The formula boxes call a function that sets the cursor to the end of tge text, the LineEdits don’t.

2 Likes

This sounds to me like a bug in Qt. At the very least it seems related to something in Qt that functions in an unacceptable way given the configuration of the specific computer.

1 Like

Is there any chance to bump qt version up to check if it maybe helps?

Is the qt library provided with the application (within flatpak or appimage) or does it use system-wide qt version? I’d expect the former but not sure.

1 Like

Could be. I looked at the code again last night, and it’s not even calling setPosition()… it’s calling movePosition()… which is probably calling setPosition internally.

The builds I believe are using Qt 5.15.2… the max LTS free ver.

I’m assuming the Qt libs are being packaged with the distribution the same as the Windows ver.

1 Like