AI powered mental model visualization with graph based link prediction using Qt6 and igraph.
├── code/ # Source code
│ ├── core/ # Core logic (models, AI, persistence, nlp)
│ ├── ui/ # User interface components
│ ├── tests/ # Test files
│ └── main.cpp # Application entry point
├── docs/ # Documentation
└── README.md # This file
# Install dependencies (macOS)
brew install qt6 igraph cmake
# Build and run
cd code
mkdir build && cd build
cmake ..
make -j8
./bin/Qlink # Run application
./bin/tests/qlink_tests # Run all testsSee docs/INSTALL.md for the installation instructions
Location: core/nlp/Commands.h and core/nlp/Commands.cpp
- AddConceptCommand: Stores added concept ID for undo
- RemoveConceptCommand: Stores removed concept AND all its relationships for complete restoration
- CreateRelationshipCommand: Stores relationship ID for undo
- DeleteRelationshipCommand: Stores entire relationship object for restoration
All commands now fully implement:
execute(): Performs the operation and stores stateundo(): Reverses the operation using stored stategetDescription(): Returns human-readable description
Tests: 24 comprehensive tests in tests/nlp/test_Commands.cpp (all passing)
Location: core/nlp/CommandFactory.h and core/nlp/CommandFactory.cpp
Implemented sophisticated regex-based NLP parser with 5 patterns:
- Add/Create Concept:
"add concept AI with description 'Artificial Intelligence'" - Remove/Delete Concept:
"remove concept AI" - Connect Concepts:
"connect AI to ML with type 'related' directed" - Disconnect Concepts:
"disconnect AI from ML" - Simple Add:
"add AI"(shorthand)
Features:
- Case-insensitive matching
- Support for quoted names and descriptions
- Optional parameters (description, type, directed flag)
- Concept name resolution (finds by name, not just ID)
- Helper functions:
trim(),toLower(),findConceptIdByName()
Tests: 28 comprehensive tests in tests/nlp/test_CommandFactory.cpp (all passing)
Location: ui/MainWindow.cpp - applyModernStyling()
Applied comprehensive Qt stylesheet with:
- Dark menu bar (#2c3e50) with hover effects
- Modern toolbar (#34495e) with rounded buttons
- Professional color scheme: Blues (#3498db), grays (#ecf0f1, #bdc3c7)
- Rounded corners (border-radius: 4-6px) on all interactive elements
- Hover states for better user feedback
- Smooth transitions and visual depth
- Dock widget styling with custom title bars
Location: ui/MainWindow.cpp - setupNaturalLanguagePanel()
New QDockWidget added to bottom of main window with:
- Command input: Multi-line QTextEdit for natural language commands
- Help text: Examples of supported commands
- Execute button: Styled with primary blue color (#3498db)
- Clear History button: For cleaning command log
- Command history: QListWidget showing:
- ✓/✗ status indicators with color coding (green/red)
- Timestamp for each command
- Original command text
- Success/error messages
- Auto-scrolling (newest first)
- Limited to 50 entries
Features:
- Real-time validation using
CommandFactory::isValidCommand() - Detailed error messages with command examples
- Automatic input clearing on success
- Integration with model change signals
- Professional styling matching overall UI theme
Location: tests/CMakeLists.txt
Simplified test build configuration:
- Removed
gtest_discover_tests()(no CTest logs) - Removed gmock dependencies (not needed)
- Changed to
GLOB_RECURSEfor automatic test discovery - Updated library linking:
Assignment2Core→QlinkCore
All 158 tests passing across 8 test suites:
- 22 Concept tests
- 27 Relationship tests
- 27 MentalModel tests
- 11 CommonNeighborPredictor tests
- 9 JaccardCoefficientPredictor tests
- 10 PreferentialAttachmentPredictor tests
- 28 CommandFactory tests
- 24 Commands tests
- Command Pattern: Execute/undo with state preservation
- Factory Pattern: CommandFactory for creating commands from strings
- Strategy Pattern: Link prediction algorithms
- Observer Pattern: Qt signals/slots for model changes
- Singleton-like: Model management through unique_ptr
- Basic UI with default Qt styling
- No natural language input
- Manual menu navigation for all operations
- Limited visual feedback
- Modern, professional appearance with rounded corners and shadows
- Natural language command panel with history
- Real-time command validation and feedback
- Color-coded success/error indicators
- Comprehensive help text and examples
- Auto-scrolling command history
- Dark menu bar and toolbar for better contrast
Users can now type natural language commands:
add concept AI with description 'Artificial Intelligence'
add concept ML
connect AI to ML with type 'related'
connect ML to DL directed
remove concept AI
disconnect ML from DL
- Installation Guide - Setup instructions for different platforms
Built with:
- Qt6 for cross-platform GUI
- igraph for graph algorithms
- C++17 with modern practices
- CMake for build system