QTextCursor Error appears before I even do anything

This has got to be a bug. I literally JUST downloaded the software and have never used it and never done anything in it at all. I was following a tutorial for how to add a measurement from SeamlyMe so it would let me do anything at all, and when it came time to replace “0” with a number for my bust circumference (the measurement I chose to use for the tutorial) clicking inside the textbox to type produces the attached error message.

QTextCursor::setPosition: Position ‘2’ out of range

It appears no matter what I do. I can’t get rid of it. I X out of it, I click okay, it keeps coming back. I didn’t even type anything in the box. It seems like the developers should not have set zero as the default value when a value of zero is considered out of range (since no human can have a measurement of zero) because then it produces this error immediately upon trying to take any action and then you can’t proceed because the error is stopping you. I hope this gets the attention of the developers because this definitely looks like a bug to me, and not related to something I did wrong.

One time I got it to close and then tried to type something else and it said

QTextCursor::setPosition: Position ‘3’ out of range

and then I fixed that, and then…

QTextCursor::setPosition: Position ‘4’ out of range

It never stops! You have to fix this so people can use your software.

1 Like

I’m pretty sure there’s nothing wrong with the app. The reported error means there’s an error reading what at the current text… that is, the cursor position.

You need to set in the prefs whether you’re using the comma instead of a period for decimal numbers. I’m on my phone, otherwise I’d post a screecap to show the setting. Switch the setting, and the error will go away. If not, let me know.

1 Like

If this is the issue, it’s just another reason why we’re hoping to eventually have an initial-start preferences wizard/dialog thingamabob!

Installing the latest build in Linux, but not hiding my config file, I do not have this issue.

:unicorn:

2 Likes

Exactly. I have to refresh my brain on how the default is set… not sure if this is something where the default can be set based on locale- or maybe it already is? Also since the error apparently is being thrown in QTextCursor, I can’t provide a better message like “Check the period preference”. Or maybe I could Catch the error before QTextCursor gets it?

I believe it’s an OS and Locale issue… where if you’re in a Locale that uses the comma for the decimal point, you need to set the pref to use the comma. Again though, maybe I can eliminate the need to initialize the setting.

3 Likes

lt’s almost a year later, and someone else created an issue on Github recently with the same QTextCursor issue. I believe the issue is related to any Locale that may be using more than 1 UTF 16 char for the comma. It’s why the routine in the QTextCursor class is thinking the cursor position is beyond the range of the text string.

The good thing is… and more or less why I’m reporting this now is, I’ve been looking at getting the apps to build with QT6. and The QLocale->decimalPoint() routine now returns a QString instead of a qchar… so once we move to Qt6 - this issue, may be a non issue.

5 Likes

Hi, I am currently experiencing this issue and it makes the app unusable :frowning:

I am on a mac and have the most recent patch downloaded from github.

I go to add a measurement in the formula textbox in Seamly2d and I instantly get a pop up that states ‘QTextCursor::setPosition: Position ‘2’ out of range’. This pop-up is impossible to close and i have to force quit to get out of it.

Am i missing something or a setting that I need to change?

2 Likes

Try changing the decimal seperator settiing.

1 Like

Hi,

Unchecked this setting on both Seamly2d and Seamlyme and still no luck

2 Likes

Let me ask… is your Locale one that uses the comma for the decimal point? This is usually where the problem occurs as a locale that uses a 2 char UTF-16 code for the comma throws off the char count to place the cursor at the end of the line.

I’ll check and see if I can find another way to set the cursor postion… problem is I have no direct way to test without spoofing the locale on my system, and I don’t have a Mac to build on - so I can only push a change to Githhub and let it build the Mac release. :roll_eyes:

3 Likes

@theo

I think I might have a fix… if I make a PR and provide you with a link to an artifact build can you download an install the Mac build and see if that solves the problem?

3 Likes

That sounds good to me @Douglas, thank you. Drop me the link over and I’ll get back to you with feedback :slight_smile:

2 Likes

Hey, any update on this so far? :slight_smile:

2 Likes

I’m still looking at the issue. The one place where the Seamly code is calling QTextCursor::setPosition() is ony in the fx editor, and not SeamlyMe or any other tool dialogs formulas… so I don’t think removing that one call is going to help over all . :frowning:

I think the error is happening internally in Qt when calling moveCursor() (which we are using) which is in turn is calling setPosition().

Let me ask do you know what your locale is and what language you have set in the prefs? Of better yet if you can just copy the system info from the About menu and paste it here OR Screencap the System locale info:

I’m almost sure it’s related to the locale & decimal point.

3 Likes

Thank you,

Of course i’ll get that posted on here now

Here it is…

Seamly2D version: Seamly2D 2025.6.16.216 Build revision: Git:280a664dd3ba Build date: Built on Mon Jun 16 2025 at 02:24:44 Qt Version: 5.15.2 CPU: x86_64 Compiler: Clang 14.0 (Apple) 64 bit CPU: x86_64 OS: macOS OS Version: 13.7 Locale: en_GB Country: United Kingdom Language: English Script Name: Latin Decimal Point: . Negative Sign: - Positive Sign: + Direction: Automatic System Codec: UTF-8 Arguments: /Applications/Seamly2D.app/Contents/MacOS/Seamly2D

2 Likes

Hi @theo… while I investigate further here’s something to try… switch your language to American English to take the translations out of the equation. You won’t notice any difference as there is nothing translated yet in the enGB.ts file.

3 Likes

Hey douglas good thinking! It seemed to work for around 5 secs, then it came up with the same error, and now its back to doing the endless loop unless i force quit :confused: I look forward to hopefully hearing from you soon! good luck with the fix

2 Likes

Update:

Super weird, just tried on my girlfriends MacBook and it works perfectly… very strange, and I’m not sure what could cause it to not work on my laptop

Edit:

Unless it is an update that I am yet to try on mine as it’s been a week or so? Going to try again on mine once Im back and have access to my laptop

3 Likes

Hi @Douglas

After coming back to my device, this is still an issue. I have worked out that it only occurs when I click outside of the ‘hitbox’ of the number (see images below). This means that I can’t remove a number and type a new number, as when I clear the textbox, I get the error.

Could this be a hardware issue? Screenshot 2025-07-02 at 15.23.10

2 Likes

FIXED!!

Funnily enough, all I tried was unchecking the decimal point setting, and no issue now! :partying_face:

3 Likes