Skip to content

frontend: Refactor Idian widgets - #13765

Open
Warchamp7 wants to merge 4 commits into
obsproject:masterfrom
Warchamp7:idian-refactor
Open

frontend: Refactor Idian widgets#13765
Warchamp7 wants to merge 4 commits into
obsproject:masterfrom
Warchamp7:idian-refactor

Conversation

@Warchamp7

Copy link
Copy Markdown
Member

Description

Refactors the Idian widgets based after some slight usage in other PRs.

This has been extracted out from #13433

Motivation and Context

The idian widgets were built when we had a much lower understanding of how Qt expects you to build custom complex widgets and without a direct use-case.

They were also built far too rigid for what every attempted use of them thus far has necessitated. These changes break them into simpler 'pieces' and provide getters for internals that are intended to be accessed.

How Has This Been Tested?

Included in #13433

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Warchamp7 Warchamp7 added the area/ui-ux Anything to do with changes or additions to UI/UX elements. label Aug 7, 2026
Comment thread frontend/widgets/OBSBasic.hpp
Comment thread shared/qt/idian/components/ExpandButton.cpp Outdated
Comment thread shared/qt/idian/include/Idian/Row.hpp
@Warchamp7
Warchamp7 force-pushed the idian-refactor branch 3 times, most recently from 3374529 to 0734aa1 Compare August 12, 2026 20:07
The idian widgets were built when we had a much lower
understanding of how Qt expects you to build custom
complex widgets and without a direct use-case.

They were also built far too rigid for what every attempted
use of them thus far has necessitated. These changes break
them into simpler 'pieces' and provide getters for internals
that are intended to be accessed.
@Warchamp7
Warchamp7 requested a review from PatTheMav September 4, 2026 17:31
@github-project-automation github-project-automation Bot moved this to Ready For Review in 33.0 Release Tracker Sep 4, 2026
@github-project-automation github-project-automation Bot moved this from Ready For Review to Requires Changes in 33.0 Release Tracker Sep 4, 2026
@Warchamp7 Warchamp7 moved this from Requires Changes to Ready For Review in 33.0 Release Tracker Sep 4, 2026
namespace idian {
ExpandButton::ExpandButton(QWidget *parent) : InlineButton(parent)
{
widgetUtils = new Utils(this);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the reason not to use smart pointers here? It doesn't seem that Utils needs to use Qt's parent-owner ownership model (which has been outdated for over a decade) and we should not perpetuate it in unrelated code.

The only place parent-owner ownership is permitted is for widgets and Qt objects, anything else needs to use smart pointers with clear lifetime and ownership rules.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No good catch. Originally I wrote the Utils class as a QObject, but then had to convert it to a normal class to be able to use it for multiple inheritance (Qt only allows a class to inherit from a single QObject with multi inheritance).

These new Utils calls technically all leak that object since they're no longer cleaned up by Qt. I will convert them to smart pointers.

@Warchamp7
Warchamp7 requested a review from PatTheMav September 9, 2026 16:43

@RytoEX RytoEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nits. CI failure is unrelated.

Comment on lines +21 to +22
#include <QStyleOptionButton>
#include <QPainter>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#include <QStyleOptionButton>
#include <QPainter>
#include <QPainter>
#include <QStyleOptionButton>

// Convenience function to add a widget to the rows layout.
void addWidget(QWidget *widget) { layout()->addWidget(widget); }

// Convenience function to add a widget to the rows layout and then set it as the buddy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Convenience function to add a widget to the rows layout and then set it as the buddy.
// Convenience function to add a widget to the row's layout and then set it as the buddy.

Comment on lines +21 to +22
#include <Idian/RowList.hpp>
#include <Idian/RowInfo.hpp>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#include <Idian/RowList.hpp>
#include <Idian/RowInfo.hpp>
#include <Idian/RowInfo.hpp>
#include <Idian/RowList.hpp>

@github-project-automation github-project-automation Bot moved this from Ready For Review to Requires Changes in 33.0 Release Tracker Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux Anything to do with changes or additions to UI/UX elements.

Projects

Status: Requires Changes

Development

Successfully merging this pull request may close these issues.

3 participants