The whole reason PJ::ProgressBar exists is to expose a `PJ--ProgressBar` QSS selector. QSS type selectors match on metaObject()->className(), so if Q_OBJECT were ever dropped this would silently fall back to "QProgressBar" and the bespoke style would stop applying. Pin the class name so that regression is a red test, not an unnoticed visual change.
| 17 | // and the bespoke style would stop applying. Pin the class name so that |
| 18 | // regression is a red test, not an unnoticed visual change. |
| 19 | TEST(ProgressBarTest, ClassNameDrivesQssSelector) { |
| 20 | PJ::ProgressBar bar; |
| 21 | EXPECT_STREQ(bar.metaObject()->className(), "PJ::ProgressBar"); |
| 22 | } |
| 23 | |
| 24 | // Sensible defaults so the widget reads like the mockup without per-instance |
| 25 | // setup: centred caption, text shown. |