Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Implement the coding part of this UI Integration?
Forum Updated to NodeBB v4.3 + New Features

How to Implement the coding part of this UI Integration?

Scheduled Pinned Locked Moved Solved General and Desktop
23 Posts 4 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J jsulm
    20 Feb 2023, 07:56

    @Aviral-0 said in How to Implement the coding part of this UI Integration?:

    Launches the application but I see no stackedwidget in it.

    Probably because ui->page page of your stacked widget is shown and not the other you're adding.
    I already told you: if your app crashes use debugger to see why. I guess ui->page has no layout, so ui->page->layout() returns nullptr. Add a layout to it then.

    J Online
    J Online
    JonB
    wrote on 20 Feb 2023, 09:05 last edited by JonB
    #21

    @Aviral-0
    @jsulm said in How to Implement the coding part of this UI Integration?:

    Probably because ui->page page of your stacked widget is shown and not the other you're adding.

    I think ui->stackedWidget->addWidget(logDisplay) adds logDisplay as another widget page after the page one you show in your screenshot, but does not make the new one be the one shown.

    After the addWidget() try

    ui->stackedWidget->setCurrentWidget(logDisplay);
    

    Is that what you expected to see?

    Having said that. I am not at all convinced you want that page already in your QStackedWidget? Depending on what you want, either get rid of that or go something like:

    ui->page->setLayout(new QVBoxLayout);
    ui->page->layout()->addWidget(LogDisplay);
    
    A 1 Reply Last reply 20 Feb 2023, 09:26
    0
    • A Aviral 0 has marked this topic as solved on 20 Feb 2023, 09:21
    • J jsulm
      20 Feb 2023, 09:02

      @Aviral-0 said in How to Implement the coding part of this UI Integration?:

      Do you have any idea what I am doing wrong here

      What do you expect this code to do?
      You added a layout to ui->page. Then you added logDisplay as another page. But you wanted to have logDisplay on ui->page, right? Can you please read more carefully? I wrote before:

      // Or, if ui->page has a layout:
      LogDisplay *logDisplay = new LogDisplay();
      ui->page->layout()->addWidget(logDisplay);
      

      So, don't you think your code should be like:

      // Or, if ui->page has a layout:
      LogDisplay *logDisplay = new LogDisplay();
      ui->page->setLayout(new QHBoxLayout);
      ui->page->layout()->addWidget(logDisplay);
      
      A Offline
      A Offline
      Aviral 0
      wrote on 20 Feb 2023, 09:22 last edited by
      #22

      @jsulm It worked, thankyou

      1 Reply Last reply
      0
      • J JonB
        20 Feb 2023, 09:05

        @Aviral-0
        @jsulm said in How to Implement the coding part of this UI Integration?:

        Probably because ui->page page of your stacked widget is shown and not the other you're adding.

        I think ui->stackedWidget->addWidget(logDisplay) adds logDisplay as another widget page after the page one you show in your screenshot, but does not make the new one be the one shown.

        After the addWidget() try

        ui->stackedWidget->setCurrentWidget(logDisplay);
        

        Is that what you expected to see?

        Having said that. I am not at all convinced you want that page already in your QStackedWidget? Depending on what you want, either get rid of that or go something like:

        ui->page->setLayout(new QVBoxLayout);
        ui->page->layout()->addWidget(LogDisplay);
        
        A Offline
        A Offline
        Aviral 0
        wrote on 20 Feb 2023, 09:26 last edited by
        #23

        @JonB Thankyou for your help too! really appreciate efforts!

        1 Reply Last reply
        0

        21/23

        20 Feb 2023, 09:05

        • Login

        • Login or register to search.
        21 out of 23
        • First post
          21/23
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved