Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preferences: Tweak layout builder #2401

Merged
merged 1 commit into from
Nov 26, 2018
Merged

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Nov 25, 2018

The code for building the preferences window layout from the available settings items was always trying to add extraWidget to the item's layout_hbox, but since extraWidget is only set on param["type"] == "browse" items, most of the time extraWidget is undefined. This was causing a flurry of (harmless) log messages whenever the prefs window was opened:

QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/

This change wraps an if(extraWidget): around the code adding it to the layout, so it will only be attempted when the extraWidget exists.

The code for building the preferences window layout from the
available settings items was always trying to add `extraWidget`
to the item's `layout_hbox`, but since `extraWidget` is only
set on `param["type"] == "browse"` items, most of the time
`extraWidget` is undefined. This was causing a flurry of (harmless)
log messages whenever the prefs window was opened:
```
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
QLayout: Cannot add a null widget to QHBoxLayout/
```

This change wraps an `if(extraWidget):` around the code adding
it to the layout, so it will only be attempted when it exists.
@DylanC
Copy link
Collaborator

DylanC commented Nov 26, 2018

@ferdnyc - Nice little fix. LGTM. 👍

@DylanC DylanC merged commit e8633bf into OpenShot:develop Nov 26, 2018
@ferdnyc ferdnyc deleted the prefs-layout branch November 26, 2018 20:11
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.

2 participants