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. Positioning new on complete application
QtWS25 Last Chance

Positioning new on complete application

Scheduled Pinned Locked Moved Unsolved General and Desktop
layout issuespositioning
5 Posts 2 Posters 571 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.
  • B Offline
    B Offline
    Beatler
    wrote on 3 May 2021, 10:52 last edited by
    #1

    Hello, everyone,
    I have complete application, all widgets on it are positioned with layouts, everything is working fine, but I have to add new widget: popup notification (something like windows 10 notification that pops in the right corner of the screen, but I don't want to use windows toasts, because these notifications have to be binded right to this app). So the problem is to position this widget: I can place it in right position on empty form by adding it to QGridLayout to cell (1;1) and two spacesrs to cells (0;1) and (1;0), but the problem is I can't add that layout to existing form with QVBoxLayout on CentralWidget.
    So is there a way to have two equal layouts binded to the same Widget? Actually I can position this new popup widget manually, but in that case I have to add special logic for form resizing, and it seems like this is not the best solution.

    P 1 Reply Last reply 3 May 2021, 11:06
    0
    • B Beatler
      3 May 2021, 10:52

      Hello, everyone,
      I have complete application, all widgets on it are positioned with layouts, everything is working fine, but I have to add new widget: popup notification (something like windows 10 notification that pops in the right corner of the screen, but I don't want to use windows toasts, because these notifications have to be binded right to this app). So the problem is to position this widget: I can place it in right position on empty form by adding it to QGridLayout to cell (1;1) and two spacesrs to cells (0;1) and (1;0), but the problem is I can't add that layout to existing form with QVBoxLayout on CentralWidget.
      So is there a way to have two equal layouts binded to the same Widget? Actually I can position this new popup widget manually, but in that case I have to add special logic for form resizing, and it seems like this is not the best solution.

      P Offline
      P Offline
      Pl45m4
      wrote on 3 May 2021, 11:06 last edited by
      #2

      @Beatler said in Positioning new on complete application:

      but the problem is I can't add that layout to existing form with QVBoxLayout on CentralWidget.

      I dont see any reason why you cant do that :)
      You can have multiple (sub-)layouts in one main layout.

      Using cascading VBox and HBox layouts is often the better choice anyway.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Beatler
        wrote on 3 May 2021, 11:25 last edited by
        #3

        I need to avoid changing the existing layout. So I have centralWidget, Vertical Layout on it (lets call it MainLayout) and many sublayouts, but I need to add one more layout to centralWidget, not sub layout for MainLayout.

        P 1 Reply Last reply 3 May 2021, 11:34
        0
        • B Beatler
          3 May 2021, 11:25

          I need to avoid changing the existing layout. So I have centralWidget, Vertical Layout on it (lets call it MainLayout) and many sublayouts, but I need to add one more layout to centralWidget, not sub layout for MainLayout.

          P Offline
          P Offline
          Pl45m4
          wrote on 3 May 2021, 11:34 last edited by Pl45m4 5 Mar 2021, 12:13
          #4

          @Beatler said in Positioning new on complete application:

          I need to add one more layout to centralWidget

          That's not possible. A widget can only have one base layout at a time.

          Why not use a HBox layout, move all your current stuff (the VBox layout) to the left and use the right for your popup widget?
          (Use can set a stretch to get 90%/10% of your available space, for example.)


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          B 1 Reply Last reply 3 May 2021, 12:19
          1
          • P Pl45m4
            3 May 2021, 11:34

            @Beatler said in Positioning new on complete application:

            I need to add one more layout to centralWidget

            That's not possible. A widget can only have one base layout at a time.

            Why not use a HBox layout, move all your current stuff (the VBox layout) to the left and use the right for your popup widget?
            (Use can set a stretch to get 90%/10% of your available space, for example.)

            B Offline
            B Offline
            Beatler
            wrote on 3 May 2021, 12:19 last edited by
            #5

            @Pl45m4
            "That's not possible. A widget can only have one base layout at a time."
            This is what I want to know, I will look for another solution, probably I will use absolute positioning inside centralWidget.

            "Why not use a HBox layout, move all your current stuff (the VBox layout) to the left and use the right for your popup widget?"
            Cuse I can't change overall positioning in this app. My popup notification must pop above all contents and not to affect existing content. So this widget is not visible most of the time, under some circumstances it becomes wisible, and after few seconds it will disappeare.

            1 Reply Last reply
            0

            4/5

            3 May 2021, 11:34

            • Login

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