Material UI Grid remove vertical alignment, keep order (so that pressing tab still works) - css

Using Material-UI's standard grid system,
the starting position of a new grid item after all 12 "space units" are used is determined by the longest element inside those 12 "space units".
How can I break that kind of alignment?
In this codesandbox you see what I mean - I want the last box to start right beneath the first left box, instead of being vertically aligned to the longest item (which is the right box)
Edit: The order of the boxes cannot change. This is a simplified version of the real code. If I change the order of the boxes, the order when pressing the tab key changes. But I want tab to jump from Box1 to Box2 (all Boxes are components which contain various input fields)

I think you just need to put the box 3 inside the same Grid as box 1
codesandbox

Related

text in component does not auto-resize border-box

I want to set up a component with a coloured background rectangle and a text, that is ready to be resized in width and also automatically resizes its height based on the length of the text.
For now I can only resize the height of the component manually, but would prefer if the component can do this automatically, like HTML does.
I added a constraints top, left&right to the text layer. And constraints top&bottom and left/right to the background layer.
Have a look at the component, the current and expected instance.
Does anyone have a helping hand on this?
Press F then click/drag to create your colored background rectangle.
Press T to create your text layer inside the frame and add constraints to it as follows: top & bottom and left & right.
Select Auto Height in the right-side panel under Text.
See detail.
Readjust the width of the text layer to your preferred size and center it inside the frame.
Select the frame layer (parent) which should contain the text layer inside of it (child).
Press Shift A to transform the selected frame into Auto Layout. Notice the icon changed.
Now, to resize, select the text layer and drag ā€˜nā€™ drop.
See result.

Text shrinking when cell selected in Material UI Table

I'm trying to figure out which piece of CSS is making the text shrink by a very tiny but noticeable amount in the cells when you select one of them
Here's a code sandbox. Just click on one of the cells to focus it and you'll see what I mean:-
https://codesandbox.io/s/material-ui-table-virtualized-t2xkt
NOTE: when you select a cell, it replaces the plain div with a customised Material UI TextField
Which CSS property do I need to adjust to ensure that the text size and position stays uniform when the cell is focused or not focused?
You were right it was the padding. Solved it by remove a pixel from the padding-top in the div within the table cell when not focused

Creating auto-scaling Qt UI using Layouts

I'd appreciate advise on to how create a Qt UI consisting of four layouts and has the following properties.
Any increases in the height of the UI is absorbed by the layouts, as shown below
Any further decreases in the height of the UI is absorbed by the contents of a specific layout, e.g. the two large buttons as shown below
1# Create new UI form base on QWidget: File -> New file or project -> Qt -> Qt Designer form class -> select Widget form templates, next, next, select project and finish
2# Add Vertical layout from left bar
3# After that click right somewhere on UI form, where is not just added layout, "Lay out" -> "Lay out in a grid"
4# You can adjust layout margin on right menu (I'm always setting 5 points)
5# Add four Horizontal layout
6# Add Button and text and what you need
7# Add Vertical spacers between Horizontal layout
8# Final result:
I prepared quick code what fits your problem, please take a look: https://github.com/troyane/StackOverflow-pro/tree/master/creating-auto-scaling-qt-ui-using-layouts
Grab that code and take a look at next moments (you can open mainwindow.ui in QtCreator):
centralWidget has next layoutStretch param: 1,2,1,1 -- it means, that we'll have next correlation among all items placed into this vertical layout.
TextLabel and both SmallButtons has Fixed VerticalPolicy
Both BigButtons has Minimum vertical policy and set minimumSize's Height to 100. UPD: Also maximumSize->height parameter is 250 px. So, it is guarantee that both BigButtons will not grow more than 250 px on height.
Take a look at another answer, there you can find lots of literature to read about Layouts.
You can put two vertical spacers in each layout. One should be placed at top most and the other one at the bottom :

How to overlapping report items in BIRT?

For some reason I need to overlap 2 report elements in BIRT. For example I need to put 2 labels one on top of another. Is this possible in BIRT? I am using BIRT 4.3. Normally when we place elements in report designer each item is occupying one full row. Some times i need to overlap elements and sometimes i need to place elements side by side. side by side can be achieved with Grid but I am not sure how to overlap report items? Please help and thanks in advance.
You can put two labels in the same cell of a graph or table, then define when to "hide element" with the "Visibility" property.
OR
In order to have both display at the same time, you can use a grid to define where the top label will go, then add the back label as an image using the background (advanced property)

QT - Place Buttons on Bottom Right

I am trying to place a set of buttons so that they are anchored to the bottom right of the screen. My problem is that whenever I resize the screen, the buttons are not anchored to the bottom right, but stay in its current position.
I have placed two Push Buttons inside a Horizontal Layout. I then placed this layout inside a Grid Layout, which contains a Horizontal and Vertical Spacer. I have modified the Grid Layout layoutSize property to SetMaximumSize.
What am I doing incorrectly, so that I can get my buttons to be anchored to the bottom right?
You have almost everything just right here, but you probably overlooked something that is really easy to miss when you first start using Qt Designer.
Your grid layout is sitting inside your widget with a fixed size and position. It too needs to be managed by a layout. If you take a look at the Object Inspector on the top right (that contains your hierarchy) you will probably see your top level widget with a red icon. This indicates that it contains no layout. You have two options to fix this...
Have your existing grid layout placed into another main layout (like a vertical layout). You would simply right click on your top level widget in the Object Inspector -> Lay Out -> [Choose a main layout type].
Have your grid be the main layout. To do this you would need to remove the grid layout and have your child items arranged exactly how you have them in that picture. Then follow the previous option, right clicking on the top level widget (or the blank background) and choose Lay out -> Grid. This will pop your widgets into a Grid at a best visual fit (which you can then fix if needed), and your grid will be the top level layout.
That grid layout will make placing other widgets quite hard. Try this instead:
Add (from left to right) horizontal spacer and the two buttons.
Multiselect them all.
Select "Lay Out Horizontally" (Ctrl-H) from the Qt Designer's (or Qt Creator's) top toolbar (not from the widget box in the left!).
Add vertical spacer on top of the previous widgets.
Select the main window by clicking it (none of the added widgets are now selected).
Select "Lay Out Vertically" (Ctrl-L) from the top toolbar.
Done.
It seems that you're doing it correctly. Just forgot to apply a layout to your central widget, right? The Grid layout should be arranged in your central widget. The more convenient way is to remove grid layout widget and lay out the central widget in a grid ;-)

Resources