
- Added ProjectManager class to handle project operations including opening, closing, building, and running projects. - Introduced SyntaxHighlighter class for syntax highlighting in C and C++ files. - Developed TerminalWidget for command execution and output display. - Created TextEditor with line numbering and auto-indentation features. - Established main application entry point in main.cpp. - Designed UI layout for MainWindow using Qt Designer.
155 lines
3.0 KiB
Markdown
155 lines
3.0 KiB
Markdown
# Hướng dẫn Build và Sử dụng DTC C/C++ IDE
|
|
|
|
## Yêu cầu hệ thống
|
|
|
|
### macOS
|
|
- macOS 10.15 (Catalina) trở lên
|
|
- Xcode Command Line Tools
|
|
- Qt6 framework
|
|
- CMake 3.20 trở lên
|
|
|
|
## Cài đặt Dependencies
|
|
|
|
### 1. Cài đặt Homebrew (nếu chưa có)
|
|
```bash
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
```
|
|
|
|
### 2. Cài đặt Qt6 và CMake
|
|
```bash
|
|
# Cài đặt Qt6
|
|
brew install qt@6
|
|
|
|
# Cài đặt CMake
|
|
brew install cmake
|
|
|
|
# Cài đặt Xcode Command Line Tools
|
|
xcode-select --install
|
|
```
|
|
|
|
### 3. Thiết lập biến môi trường (tùy chọn)
|
|
```bash
|
|
# Thêm vào ~/.zshrc hoặc ~/.bashrc
|
|
export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@6:$CMAKE_PREFIX_PATH"
|
|
export PATH="/opt/homebrew/opt/qt@6/bin:$PATH"
|
|
```
|
|
|
|
## Build IDE
|
|
|
|
### Cách 1: Sử dụng script tự động
|
|
```bash
|
|
# Clone dự án
|
|
git clone <repository-url>
|
|
cd ide-c_c++
|
|
|
|
# Build
|
|
./build.sh
|
|
|
|
# Chạy
|
|
./run.sh
|
|
```
|
|
|
|
### Cách 2: Build thủ công
|
|
```bash
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@6
|
|
make -j$(sysctl -n hw.ncpu)
|
|
```
|
|
|
|
## Chạy IDE
|
|
|
|
### Từ terminal
|
|
```bash
|
|
./build/dtc-ide.app/Contents/MacOS/dtc-ide
|
|
```
|
|
|
|
### Hoặc mở như ứng dụng macOS
|
|
```bash
|
|
open build/dtc-ide.app
|
|
```
|
|
|
|
## Tính năng chính
|
|
|
|
### Phase 1 (Đã hoàn thành)
|
|
- ✅ Text editor cơ bản với syntax highlighting
|
|
- ✅ File tree browser
|
|
- ✅ Terminal tích hợp
|
|
- ✅ CMake project detection
|
|
- ✅ Build system integration
|
|
- ✅ Dark/Light theme toggle
|
|
|
|
### Cách sử dụng
|
|
|
|
1. **Mở project**: File → Open Project hoặc Ctrl+Shift+O
|
|
2. **Tạo file mới**: File → New hoặc Ctrl+N
|
|
3. **Build project**: Build → Build Project hoặc Ctrl+B
|
|
4. **Chạy project**: Build → Run hoặc Ctrl+R
|
|
5. **Terminal**: Sử dụng terminal tích hợp ở dưới cùng
|
|
6. **Đổi theme**: View → Toggle Theme hoặc Ctrl+T
|
|
|
|
### Shortcuts
|
|
- `Cmd+N`: Tạo file mới
|
|
- `Cmd+O`: Mở file
|
|
- `Cmd+S`: Lưu file
|
|
- `Cmd+Shift+O`: Mở project
|
|
- `Cmd+B`: Build project
|
|
- `Cmd+R`: Run project
|
|
- `Cmd+D`: Debug (Phase 2)
|
|
- `Cmd+T`: Toggle theme
|
|
|
|
## Troubleshooting
|
|
|
|
### Lỗi "Qt6 not found"
|
|
```bash
|
|
# Kiểm tra Qt6 đã cài đặt
|
|
brew list | grep qt
|
|
|
|
# Nếu chưa có, cài đặt:
|
|
brew install qt@6
|
|
|
|
# Thiết lập CMAKE_PREFIX_PATH
|
|
export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@6"
|
|
```
|
|
|
|
### Lỗi CMake
|
|
```bash
|
|
# Cập nhật CMake
|
|
brew upgrade cmake
|
|
|
|
# Hoặc cài đặt phiên bản mới nhất
|
|
brew install cmake
|
|
```
|
|
|
|
### Lỗi build
|
|
```bash
|
|
# Xóa build directory và build lại
|
|
rm -rf build
|
|
./build.sh
|
|
```
|
|
|
|
## Roadmap tiếp theo
|
|
|
|
### Phase 2 (Sắp tới)
|
|
- [ ] LLDB debugger integration
|
|
- [ ] Code completion với clangd
|
|
- [ ] Project templates
|
|
- [ ] Git integration
|
|
|
|
### Phase 3 (Tương lai)
|
|
- [ ] Plugin system
|
|
- [ ] Code formatting (clang-format)
|
|
- [ ] Documentation viewer
|
|
- [ ] Custom keybindings
|
|
|
|
## Đóng góp
|
|
|
|
1. Fork repository
|
|
2. Tạo feature branch
|
|
3. Commit changes
|
|
4. Push và tạo Pull Request
|
|
|
|
## License
|
|
|
|
MIT License - Xem file LICENSE để biết thêm chi tiết.
|