Yes. It is possible. I don't remember exactly how (I haven't done it for a long time).
I'm not sure I wrote it all down correctly. I haven't worked with Pi for a long time.
Something like this:
First:
Development & Cross-Compilation: You develop the code on the host (Ubuntu in VirtualBox). Qt Creator is configured to use a cross-compiler (e.g., g++-arm-linux-gnueabihf) and Qt libraries compiled for the ARM architecture (your Raspberry Pi).
Deployment: Qt Creator automatically copies the compiled executable and necessary libraries (including Qt) to the Raspberry Pi via SSH when starting debugging/the application. This is configured using "Devices" and "Kits" in Qt Creator.
Execution on Target: The executable runs on the Raspberry Pi itself.
Debugger (GDB): Qt Creator on the host launches a GDB server (gdbserver) on the Raspberry Pi via SSH. This server attaches to your running application. The main GDB debugger on the host (Ubuntu) communicates with gdbserver over the network.
Remote Debugging: You see the source code on the host, set breakpoints, inspect variables, and step through code. The host GDB controls the program's execution on the Pi via gdbserver and receives information (variable values, call stack, etc.).
Second (How to See the GUI):
- X11 Forwarding over SSH:
VNC / RDP to Raspberry Pi
Physical Monitor on Pi
Third:
Configure a "Device": Go to Tools -> Options -> Devices. Add a new "Generic Linux" device. Specify the Pi's IP, username, password/key. Enable X11 Forwarding (usually a checkbox "Forward X11 connection" or parameter -X in SSH extra options).
Configure Compiler: Specify the path to the ARM cross-compiler (e.g., /usr/bin/arm-linux-gnueabihf-g++).
Configure Qt Version: Specify the path to the Qt libraries compiled for ARM (copied or built for the Pi).
Configure a Kit: Create a new Kit. Select:
Device: Your newly created device (Raspberry Pi).
Compiler: Your ARM compiler.
Qt Version: Your ARM Qt.
Debugger: Qt Creator usually auto-finds gdb-multiarch or similar on the host. gdbserver on the Pi is used automatically.
Open your project, select the created Kit, set breakpoints, and start debugging (F5).
Upd.
I don`t remember how to configure Linux on VBox ;( But I think it is not a problem. It was simple.