Skip to content

Adding multiple widgets to a FlexLayout doesn't seem to work #846

Closed

Description

@JellyBrick

Describe the bug

LyricsViews (https://github.com/HelloWorld017/alspotify/blob/master/app/components/LyricsView/index.js): Working

NowPlayingView (https://github.com/HelloWorld017/alspotify/blob/master/app/components/NowPlayingView/index.js): Not Working (working without LyricsView)

When I use FlexLayout:

image

When I use QBoxLayout instead of FlexLayout:

image

To Reproduce

Steps to reproduce the behavior:

  • Add multiple widgets to FlexLayout

(https://github.com/HelloWorld017/alspotify/blob/master/app/views/MainWindow.js)

class MainWindow extends QMainWindow {
	constructor() {
		super();
		this.setWindowTitle('Alspotify');
		this.setWindowFlag(WindowType.FramelessWindowHint, true);
		this.setWindowFlag(WindowType.WindowStaysOnTopHint, true);
		this.setWindowFlag(WindowType.WindowTransparentForInput, true);
		this.setWindowFlag(WindowType.SubWindow, true);
		this.setAttribute(WidgetAttribute.WA_NoSystemBackground, true);
		this.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);

		const layout = new FlexLayout();
		const widget = new QWidget();
		widget.setObjectName('Root');
		widget.setLayout(layout);

>		layout.addWidget(new LyricsView());
>		layout.addWidget(new NowPlayingView());

		this.setCentralWidget(widget);

Expected behavior

NodeGUI 0.24.0 (Windows 10)

(https://github.com/HelloWorld017/alspotify/blob/master/README.md)
image


Desktop (please complete the following information):

  • OS: Linux/KDE Plasma 5.22.1 & Windows
  • NodeGUI version: 0.32.0
  • OS Version: Gentoo Linux kernel 5.12.10 / Windows 10

Additional context

Activity

  1. changed the title [-]Adding multiple widgets to the FlexLayout doesn't seem to work[/-] [+]Adding multiple widgets to a FlexLayout doesn't seem to work[/+] on Jul 7, 2021
  2. a7ul commented on Jul 9, 2021

    @a7ul
    Collaborator

    Not sure but I dont see a call to
    this.setCentralWidget(widget);
    anywhere so the widget just gets initialized and destroyed ?

  3. JellyBrick commented on Jul 17, 2021

    @JellyBrick
    Author

    Not sure but I dont see a call to
    this.setCentralWidget(widget);
    anywhere so the widget just gets initialized and destroyed ?

    https://github.com/HelloWorld017/alspotify/blob/3ca4e4ece319e47662f572e8aeca161c6e391e49/app/views/MainWindow.js#L34

  4. JellyBrick commented on Jan 17, 2023

    @JellyBrick
    Author

    It caused by 3fe8f17
    #814

    I resolved it by using resize and setMinimumSize methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions