how do I see qDebug statements on a Windows 11 installation
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Active Member
- Posts: 25
- Joined: Thu Sep 07, 2023 1:17 am
- Location: USA
how do I see qDebug statements on a Windows 11 installation
I have been developing scripts on a linux machine and am now trying to troubleshoot on a Windows 11 installation. I cannot figure out an incantation that permits me to see qDebug, Warnings or Errors.
-
- Premier Member
- Posts: 4879
- Joined: Wed Sep 27, 2017 4:17 pm
Re: how do I see qDebug statements on a Windows 11 installation
That is restricted on a Win system, I other words: You can not ... Not in real time.mrhickman53 wrote: ↑Sat Feb 01, 2025 11:08 pmI cannot figure out an incantation that permits me to see qDebug, Warnings or Errors.
The presented solution is to stream the output of QCAD to a log file and examine that afterwards.
The 'cat' command is reported as not functional.
It may work under PowerShell, otherwise use 'type'.
I have already problems with starting QCAD from a OS command line.
As said, not in real time and then debugging an interactive script is not really a solution via a log file.
Another option (for the time being) is to run QCAD in debugger mode.
The down side is that this mode is not really stable.
Another problem is that you cannot debug interactions with a Dialog because that is always modal.
Again it is Windows that doesn't allow this.
The debuger will be removed completely, see this topics: QCAD Snapshots & Qt6 ; QCAD + Qt6 vs debugger
I then frequently use EAction.handleUserMessage [-Warning, -Info] ("MessageString") to display these things in the Command History in real time.
Regards,
CVH
- andrew
- Site Admin
- Posts: 8769
- Joined: Fri Mar 30, 2007 6:07 am
Re: how do I see qDebug statements on a Windows 11 installation
You might want to install cygwin (especially when coming from Linux) which can show the output when qcad.exe is run.
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
Re: how do I see qDebug statements on a Windows 11 installation
I use Windows and generally run qcad using the command:
This will output your qdebug statement strings to a log.txt file that you can find in the same directory as your qcad.exe.
Code: Select all
qcad.exe 1>log.txt 2>&1 -rescan -enable-script-debugger
-
- Premier Member
- Posts: 4879
- Joined: Wed Sep 27, 2017 4:17 pm
Re: how do I see qDebug statements on a Windows 11 installation
As explained in the 'stream' link but is this in real time?
For interactive scripts for example.
Regards,
CVH
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
Re: how do I see qDebug statements on a Windows 11 installation
Yeah, I was trying to get the full command in here. I used the command in the link originally a long time ago and didn't know that you could have that command and also the debugger going at the same time. When scripting, I would mainly use the debugger, then when I needed qDebugs I'd run the command in the link. It's better to have them both going simultaneously.
It's not as good as just using a Linux terminal and having the ability to watch the qDebug statements popping up in real time. But using the Linux terminal requires (1) installing it and (2) figuring out how to use it which may or may not be worth it depending on what script is being worked on. I'm fairly sure, for interactive scripts, that you can just keep on opening the log.txt file as you click on stuff in the program and see what qDebug output lines have been added to the log.txt file since the last time you opened it up.
-
- Premier Member
- Posts: 4879
- Joined: Wed Sep 27, 2017 4:17 pm
Re: how do I see qDebug statements on a Windows 11 installation
@333onlyhalfevil
Thanks for the info, for give it a try.
Then cygwin is out of the question, Win7 32bit and myself not acquainted with the Linux environment.
EAction.handleUserMessage [-Warning, -Info] ("MessageString") is then my only option outside the debugger mode.
For that my QCAD Command History/Line is docked at the right and displays several history lines.
I can then debug my code in real time, even with a modal dialog.
Regards,
CVH
Thanks for the info, for give it a try.
Scripting in JS, debugger mode (For the time being), NOT at all a stable environment.
Then cygwin is out of the question, Win7 32bit and myself not acquainted with the Linux environment.
EAction.handleUserMessage [-Warning, -Info] ("MessageString") is then my only option outside the debugger mode.
For that my QCAD Command History/Line is docked at the right and displays several history lines.
I can then debug my code in real time, even with a modal dialog.
Regards,
CVH
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
Re: how do I see qDebug statements on a Windows 11 installation
Quick question. When you're on linux and run qcad using ./qcad -rescan -enable-script-debugger, is that supposed to automatically output the qdebug statements by default? or is there another command or settings that needs to be run in order to do it?
-
- Premier Member
- Posts: 4879
- Joined: Wed Sep 27, 2017 4:17 pm
Re: how do I see qDebug statements on a Windows 11 installation
@333onlyhalfevil
I think that you might get an answer when you start a new topic ... Linux related
Regards,
CVH
A bit off-topic.333onlyhalfevil wrote: ↑Mon Mar 10, 2025 6:26 pmWhen you're on linux and run qcad using ./qcad -rescan -enable-script-debugger, is that supposed to automatically output the qdebug statements by default?
I think that you might get an answer when you start a new topic ... Linux related
Regards,
CVH
-
- Full Member
- Posts: 92
- Joined: Fri Apr 28, 2023 12:39 pm
Re: how do I see qDebug statements on a Windows 11 installation
I suppose I could've added more words to make it on topic, however, it is indeed on topic because I'm on a Windows machine. I was trying to get a linux terminal set up within VS Code and I have it and it is working but the qDebug statements don't get printed out, hence the question. I can't try it on linux because I don't have a linux machine. Assuming I can get it to work, what I have will probably be a great option for windows users, assuming they use vs code.