Skip to content

Devicesettings UI#19

Merged
jgeudens merged 6 commits intomasterfrom
dev/devicesettings
Apr 2, 2026
Merged

Devicesettings UI#19
jgeudens merged 6 commits intomasterfrom
dev/devicesettings

Conversation

@jgeudens
Copy link
Copy Markdown
Member

@jgeudens jgeudens commented Apr 2, 2026

Summary by CodeRabbit

  • Refactor

    • Refactored the device settings dialog for improved code maintainability.
  • Chores

    • Added automated build, test, and quality check workflow configurations for development processes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Warning

Rate limit exceeded

@jgeudens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5fa0eeb-ea29-4382-b7af-a6c23c1993ce

📥 Commits

Reviewing files that changed from the base of the PR and between a522ed6 and 05fa21f.

📒 Files selected for processing (8)
  • .claude/agents/build.md
  • .claude/agents/code-reviewer.md
  • .claude/agents/quality.md
  • .claude/agents/test-runner.md
  • CLAUDE.md
  • src/dialogs/devicesettings.cpp
  • src/dialogs/devicesettings.h
  • src/dialogs/devicesettings.ui

Walkthrough

This change introduces a three-agent workflow for build, test, and quality checks operations, replacing the previous single-agent approach, and refactors the DeviceSettings dialog to remove Qt Designer-generated UI code in favour of programmatic layout composition.

Changes

Cohort / File(s) Summary
Agent workflow definitions
.claude/agents/build.md, .claude/agents/quality.md, .claude/agents/test-runner.md
New agent configuration files defining distinct workflows for CMake/Ninja builds, ctest execution, and code quality checks (clang-format, clang-tidy, clazy), each specifying tool, model, and reporting expectations.
Developer documentation
CLAUDE.md
Updated project documentation to describe the new three-agent workflow (@agent-build, @agent-test-runner, @agent-quality) and revised communication/ folder description; changed required sequence to build → tests → quality checks.
Dialog refactoring
src/dialogs/devicesettings.h, src/dialogs/devicesettings.cpp, src/dialogs/devicesettings.ui
Removed Qt Designer UI generation approach from DeviceSettings dialog; replaced Ui::DeviceSettings pointer with direct AddableTabWidget member; deleted .ui file and converted to programmatic layout composition.

Possibly related PRs

  • Dev/tooling #12: Updates developer tooling scripts and .claude configuration patterns that the agent definitions in this PR depend upon (run_clang_tidy.sh, run_clazy.sh, run_precommit.sh).
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Devicesettings UI' is vague and does not clearly convey the main changes in the pull request, which involve refactoring the DeviceSettings widget to remove Qt Designer UI files and replace them with programmatic layout management, while also adding agent configuration files. Use a more descriptive title that captures the primary refactoring, such as 'Remove DeviceSettings UI file and refactor to programmatic layout' or 'Refactor DeviceSettings to use programmatic layout instead of Qt Designer UI'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/devicesettings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/dialogs/devicesettings.h (1)

4-4: Prefer a forward declaration for AddableTabWidget in the header.

DeviceSettings only stores a pointer, so this include can move to the .cpp to reduce header coupling and rebuild scope.

Proposed refactor
-#include "customwidgets/addabletabwidget.h"
 `#include` "models/settingsmodel.h"
 `#include` <QWidget>

 // Forward declaration
 class DeviceForm;
+class AddableTabWidget;
 `#include` "devicesettings.h"

+#include "customwidgets/addabletabwidget.h"
 `#include` "customwidgets/deviceform.h"
 `#include` "models/device.h"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/dialogs/devicesettings.h` at line 4, DeviceSettings currently includes
"customwidgets/addabletabwidget.h" but only holds an AddableTabWidget*; replace
that include with a forward declaration `class AddableTabWidget;` in the
DeviceSettings header and move the original include into the corresponding .cpp
file; ensure any places in the header (constructors, member declarations) only
use the pointer type (AddableTabWidget*) so the forward declaration suffices and
include "customwidgets/addabletabwidget.h" in the .cpp where methods accessing
the full type (e.g., DeviceSettings constructor/destructor or any methods using
AddableTabWidget members) are implemented.
src/dialogs/devicesettings.cpp (1)

57-57: Use qobject_cast for QObject downcasts in Qt code.

DeviceForm is a Qt widget type that inherits from QWidget; qobject_cast is the idiomatic Qt-safe cast for this pattern and does not depend on RTTI.

Proposed fix
-        auto tabContent = dynamic_cast<DeviceForm*>(_pDeviceTabs->tabContent(i));
+        auto tabContent = qobject_cast<DeviceForm*>(_pDeviceTabs->tabContent(i));
-    auto tabContent = dynamic_cast<DeviceForm*>(_pDeviceTabs->tabContent(index));
+    auto tabContent = qobject_cast<DeviceForm*>(_pDeviceTabs->tabContent(index));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/dialogs/devicesettings.cpp` at line 57, Replace the non-Qt RTTI
dynamic_cast used when retrieving tab content with the Qt-safe qobject_cast:
change the cast of _pDeviceTabs->tabContent(i) to qobject_cast<DeviceForm*> and
ensure the usage points to the DeviceForm type and _pDeviceTabs->tabContent
method; this removes the dynamic_cast dependency and uses Qt's QObject-based
run-time type checking for QWidget-derived classes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/agents/build.md:
- Line 11: The current configure command (the shell line containing "mkdir -p
build && cmake -GNinja -S . -B build") omits Qt discovery and required build
settings; update that invocation to pass -DCMAKE_PREFIX_PATH (pointing to the Qt
installation or CI-provided Qt location), set the C++ standard and Qt
requirement (e.g. -DCMAKE_CXX_STANDARD=20 and a Qt6-related CMake cache
variable), enforce Ninja with -G Ninja (already present), and add strict
compiler flags via -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" so the build
becomes reproducible and fails on warnings.

In `@src/dialogs/devicesettings.cpp`:
- Around line 8-10: Add a short Doxygen comment immediately above the
DeviceSettings::DeviceSettings(SettingsModel* pSettingsModel, QWidget* parent)
constructor in the .cpp describing that it constructs a DeviceSettings widget,
the purpose of the parameters (pSettingsModel for the settings model and parent
for the QWidget parent), and any important behavior (initializes _pDeviceTabs
and stores _pSettingsModel). Use the standard brief Doxygen format (/// or /**
*/) so the public constructor is documented per coding guidelines.

---

Nitpick comments:
In `@src/dialogs/devicesettings.cpp`:
- Line 57: Replace the non-Qt RTTI dynamic_cast used when retrieving tab content
with the Qt-safe qobject_cast: change the cast of _pDeviceTabs->tabContent(i) to
qobject_cast<DeviceForm*> and ensure the usage points to the DeviceForm type and
_pDeviceTabs->tabContent method; this removes the dynamic_cast dependency and
uses Qt's QObject-based run-time type checking for QWidget-derived classes.

In `@src/dialogs/devicesettings.h`:
- Line 4: DeviceSettings currently includes "customwidgets/addabletabwidget.h"
but only holds an AddableTabWidget*; replace that include with a forward
declaration `class AddableTabWidget;` in the DeviceSettings header and move the
original include into the corresponding .cpp file; ensure any places in the
header (constructors, member declarations) only use the pointer type
(AddableTabWidget*) so the forward declaration suffices and include
"customwidgets/addabletabwidget.h" in the .cpp where methods accessing the full
type (e.g., DeviceSettings constructor/destructor or any methods using
AddableTabWidget members) are implemented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3a97cb1-7c87-4a7d-b446-66b3761f41ac

📥 Commits

Reviewing files that changed from the base of the PR and between 5265f61 and a522ed6.

📒 Files selected for processing (7)
  • .claude/agents/build.md
  • .claude/agents/quality.md
  • .claude/agents/test-runner.md
  • CLAUDE.md
  • src/dialogs/devicesettings.cpp
  • src/dialogs/devicesettings.h
  • src/dialogs/devicesettings.ui
💤 Files with no reviewable changes (1)
  • src/dialogs/devicesettings.ui

@jgeudens jgeudens force-pushed the dev/devicesettings branch from a522ed6 to 05fa21f Compare April 2, 2026 19:21
@jgeudens jgeudens merged commit 4dfd93e into master Apr 2, 2026
10 checks passed
@jgeudens jgeudens deleted the dev/devicesettings branch April 2, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant