
- 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.
3.0 KiB
3.0 KiB
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ó)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Cài đặt Qt6 và CMake
# 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)
# 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
# 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
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@6
make -j$(sysctl -n hw.ncpu)
Chạy IDE
Từ terminal
./build/dtc-ide.app/Contents/MacOS/dtc-ide
Hoặc mở như ứng dụng macOS
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
- Mở project: File → Open Project hoặc Ctrl+Shift+O
- Tạo file mới: File → New hoặc Ctrl+N
- Build project: Build → Build Project hoặc Ctrl+B
- Chạy project: Build → Run hoặc Ctrl+R
- Terminal: Sử dụng terminal tích hợp ở dưới cùng
- Đổi theme: View → Toggle Theme hoặc Ctrl+T
Shortcuts
Cmd+N
: Tạo file mớiCmd+O
: Mở fileCmd+S
: Lưu fileCmd+Shift+O
: Mở projectCmd+B
: Build projectCmd+R
: Run projectCmd+D
: Debug (Phase 2)Cmd+T
: Toggle theme
Troubleshooting
Lỗi "Qt6 not found"
# 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
# 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
# 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
- Fork repository
- Tạo feature branch
- Commit changes
- Push và tạo Pull Request
License
MIT License - Xem file LICENSE để biết thêm chi tiết.