Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Push buttons display in a "nice" layout, full-screen...
Qt 6.11 is out! See what's new in the release blog

Push buttons display in a "nice" layout, full-screen...

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    My intention is to provide a GUI with two sections, one of which displays k buttons, where k is the number of .txt files in a specific folder. I would be glad to know that there is a way to to simply add buttons (largest possible), still "nicely" arranged in a full screen window. In other words, I would like to only add push buttons, and these would be automatically arranged for me (no specification of coordinates and sizes).

    The initial window should be full screen, and buttons should be as large as possible. Any description on how this might be achieved, with pointers to existing examples, is highly appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you thinking about something like the "Graphics View Flow Layout Example" ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Well, I was thinking about having buttons of the same size that is determined according to the screen size. So, the buttons could be placed in a grid that occupies the whole screen. Any example in this direction is highly appreciated (and thanks for the provided example, I have it)

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          The sample code produced almost the desired result, thanks. There are some issues that still need to be addressed:

          1. in main.cpp, I state view->showMaximized(); but that results in maximization of the "background" window, while the one where buttons are stays in the size that is dependent on the number of buttons. How could I maximize the "actual" window where buttons are.

          2. where could the button size be manipulated (method name)?

          [quote author="SGaist" date="1413979802"]Hi,

          Are you thinking about something like the "Graphics View Flow Layout Example" ?[/quote]

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            I just remembered you also have the "Flow Layout Example" that only uses widget.

            1. I can't tell since I don't know your code

            2. resize, setFixedSize

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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
            • Unsolved