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
Forum Updated to NodeBB v4.3 + New Features

Positioning new on complete application

Scheduled Pinned Locked Moved Unsolved General and Desktop
layout issuespositioning
5 Posts 2 Posters 611 Views 1 Watching
  • 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 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.

    Pl45m4P 1 Reply Last reply
    0
    • B Beatler

      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.

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on 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 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.

        Pl45m4P 1 Reply Last reply
        0
        • B Beatler

          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.

          Pl45m4P Online
          Pl45m4P Online
          Pl45m4
          wrote on last edited by Pl45m4
          #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
          1
          • Pl45m4P Pl45m4

            @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 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

            • Login

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