Appmaker panel & canvas height - google-app-maker

I have a long form in a panel with lots of controls, however the Canvas/panel editor has a limited height of about 1000px and refuses to scroll to allow adding more controls.
I am able to make the panel 2000px and enable overflow to get the panel itself to scroll once the app is deployed, but how do I manage to drag/drop new controls/widgets?
TIA

At the bottom of the canvas is a round control which allows it to be extended beyond the default and therefore allows long controls.

A page's main panel should have a dimension property in the property editor, that specifies height and width. I'm able to set it to much larger values (e.g. 5000 pixels).
Once the main panel is large enough, you should be able to scroll down in it and drop new widgets where you need them to be.
It's also easy to accidentially drop in new panels and then stuff new widgets into the wrong panel, so make sure the panel structure is really what you believe it is (e.g. via the structure editor).

Related

Maintaining state when switching tabs in Jetpack Compose

In Jetpack Compose if I use a Structure that has tabs at the the top of the screen and I want to change the view in the body but maintain the state of each body's content, is this done by simply having multiple bodies and hiding/showing each one as you click on the tabs by setting each with View.visibility = VISIBLE or GONE? Or is this done differently using Compose?
By maintaining state, this would include the scroll position of the content on each body.
Just stuff everything into your viewmodel. That's my way

Resizing Layout equal to MainWindow

When I run my program it will display all content properly, and when I resizing the main window, the layout along with all associated widgets remain fixed, rather than resizing with the main window. I used to increase my all widget and listWidget respect to window computer resolution size but still this not one work properly.
I used this one code finding the system height and width.
QWidget widget;
widget.resize(widget.width(), widget.minimumHeight());
QRect rec = QApplication::desktop()->screenGeometry();
int h = rec.height();
int w = rec.width();
// Increasing the listwidget size
ui->listWidget->setFixedHeight(h);
ui->listWidget->setFixedWidth(w);
//increasing the button size
ui->pushButton->setFixedHeight(h0.2);
ui->pushButton->setFixedWidth(w0.2);
At this link you will find two screenshots that illustrate my problem.
Please resolve to solve my problem. Thanks very much in advance.
When defining the layout of your windows and forms in Qt Designer you have to define each element of your form in advance, in order to have a working layout.
This solution is based on the screenshots provided in the comments to the question. Follow these steps:
Add an empty widget to the central area of your form, if there is nothing there. It will be used as a placeholder for the controls you will add later, and of course you can replace it with whatever widget you want. But you need it there to define a proper layout.
In the property panel, set the horizontal QSizePolicy of this widget to MinimumExpanding.
Add an horizontal spacer to the left side of your progress bar.
Define a minimum/maximum width for the white widget on the left (I guess it's a text area). As an example set the maximum width to 200
pixels.
Make the same for the QTabWidget on the right.
Give a minimum height to the Groupbox on top.
Then give the grid layout to the MainWindow.
You should get something similar in the designer view (I use a dark theme, yours will have different colors of course):
If you complete all steps you should have a nicely resizing window.
For the future: remember to integrally define your layouts, also using placeholder widgets when needed, read carefully the documentation about the widgets size policies (there are several, you need to play with them to fully understand each one) and keep in mind that Qt uses a container based approach which is different, as an example from those used by the .Net framework that relies on the concept of anchors.
EDIT : to answer questions in the comments
You will need to add a layout to any widget that contains other widgets, e.g. adding controls to your groupbox will require to give it a grid, horizontal or vertical layout in order to scale nicely on resize. Again use spacers and size policies to make it look the way you want. If you need to add or remove controls, or change their positions, you may need to brake the layout, rearrange and then set it again.
You can also select groups of widgets and give them a layout e.g. vertical, than another group and set them horizontal and so on... then give a grid layout to the container widget to build a compound layout.
There are endless possibilities, you just need to practice and go through trial and error as for everything else...
You can also do it all programmatically, check the Qt widgets documentation for this. But for complex layouts I would not go that way: it's a lot of code... and you have to compile and run to test every modification.
Using the QtCreator, within the designer you can simply right-click on the parent-widget and add a Grid-Layout.
This one resizes it's children to it's dimensions.

Add fixed sized items to grid layout in correct row

I am trying to create a grid layout of images kind of like how google images does it.
I want to add fixed sized images left to right, top to bottom but I am having trouble is figuring out when adding another image to a row would make it not fit and then decide that that images should be placed in a new row.
Also when the window resizes it should move images into/from rows based on how many it can fit in.
Ive got a scroll area with a grid layout in it which is fine if I know what can fit, but I can't figure out how to make it move items if say the window width is shrunk, and say an item needs to be moved down 1 row which moves other etc.
Assuming you are using QWidgets I'd suggest you to use QListView which does the layouting for free, if you want more control on how items are displayed use a QItemDelegate. For QListView the view mode should be set to QListView::IconMode so that you have a grid of items and not a list.
But if you are using QtQuick things are much easier, a GridView with Image delegates would do what you want really quickly and using GPU power to build you UI.

How to resize DevExpress controls

I have a DevExpress LayoutControl set inside a WinForms Form. I would like the LayoutControl to resize horizontally when the form is resized, or at least make the LayoutControl resizable by the user.
I have seen on DevExpress's page suggestions to change the SizeConstraintsType property to "default". I have also tried to anchor the control to the right and left of its parent. I have worked on increasing the MaxSize, also. Does anyone know how to do this?
I just basically want to do the equivalent to (in HTML) <table width=100%>. Does anyone know how to do this?
Thanks in advance!
The Developer's Express LayoutControl is a very nice tool, but has a couple gotchas.
The LayoutControl itself should resize just fine docked inside any container control like a form, a user control or a panel control. In many cases the layout control is one of the first things you put on your form/control because everything else goes inside it to be "layedout". So you should set the "Dock" property of the layout control to "Fill" or to the desired edge of the form/control you want it to dock to.
The "gotcha" here is that layout control's internal logic may limit its external dimensions or any internal item if it is capable of doing so and the layout items want to be a particular size. This is actually simpler than it sounds.
For example lets say you have a label control inside your layout control. A label control by default will size itself to fit the width of its text. In turn the layout control will try to accommodate the label's desired size by shrinking/growing the size of the layout item. So this one label control could be messing with your layout controls resizing. I chose label as the example because it is the most common control to mess up your layout design.
The way I fix this is to change the label's "AutoSizeMode" property to "vertical" (if you want text wrapping) or "none" (if you want to force it be the size the layout control wants it to be). This free up the layout control to make the width decisions.
Also if you are allowing the layout control to be resized by the end user (say with DevExpress' SplitterControl) the layout will again try to become its optimal size and not allow the SplitterControl to move away from this optimal size if the other controls are more easily resized (like a grid, tree, list, etc...). In this case adding an "EmptySpaceItem" to the layout control will allow it to fill any empty space when being resized. To add an EmptySpaceItem to your layout, right click the layout control in the Visual Studio designer and select "Customize Layout". The customize dialog will have a list of items you can drag onto the layout control including the EmptySpaceItem.

How to layout out a component differently depending on the amount of space available?

I am trying to build a sort of button bar in Flex - something like the horizontally laid-out bookmark bar you'd see in most modern web browsers, where when you run out of horizontal space, you can click on the arrows button(>>) to get a drop-down to see the rest of the items which did not fit into the horizontal space. Problem is, how can I know how much horizontal space is available for me to tell how many buttons to render into the button bar? This need doesn't appear to be support by the general layout manager framework.
You can check the width of the parent container, and if that is less than the combined widths of your objects that you've attached with AddChild or AddElement, then you don't have enough space and need use your arrow functionality.

Resources