Vertical Spacer doesn't stretch past sizeHint in Form layout - qt-designer

I am trying to design a form in which some elements stay at the bottom of the Form Layout when the window size is increased, and others stay at the top. Using a Vertical Spacer between the top and bottom elements almost works, but the Vertical Spacer only stretches up to the Height value of its SizeHint (see screenshots below).
Simply increasing the SizeHint to some large has the unwanted side effect that the preferred size of the overall window then also becomes very large, so the "Adjust Size (Ctrl+J)" command makes the window unacceptably large.
If I use a Vertical Layout instead of a Form Layout, the stretcher behaves as I expect it to, increasing indefinitely and respecting the SizeHint when using "Adjust Size", but of course I lose the behaviour of the form layout (the alignment of the TextLabels).
What can I do to make the Vertical Spacer stretch past its SizeHint in a Form Layout?

Use multiple layouts, not only one.
Set vertical layout for your window.
Add horizontal layout, fill it with QLabel and QLineEdit. Add Vertical Spacer.
Add another horizontal layout, fill it with QLabel and QLineEdit.
Add horizontal layout, fill it with Vertical Spacer and two QPushButtons.
If I understood you correctly, you should get what you wanted :)
Another way is to use QGridLayout.
Set QLabels to 0,0 and 1,0
Set QPushButtons to 2,1 and 2,2
Set QLineEdits to 0,1 and 1,1
Drag QLineEdits so that they span from column 1 to column 2
And Vertical Spacer between row 0 and 1.

Related

Extend two colors bars across full width of browser?

I have two boxes filled with colors, a green one on the left, and gray one on the right. They go right up against each other in the middle of the screen, and I would like each one to extend the width of the browser, so the green one extends all the way to the left, and the gray one extends all the way to the right, no matter how wide the browser gets. How can I do this?
the width property supports percentage values, which are relative to the size of the window it exists in.
See:
http://learnlayout.com/percent.html
http://www.w3schools.com/cssref/pr_dim_width.asp

Top vertical align in line-height (or vertical spacing without line-height)

I have a multi-line title side by side to an icon. I would like to keep the line-height of that title at about 1.6 . If I do so though, the text does not align on top because it stays vertically centered to the line. The result is that the top of the icon is not aligned with the top of the text. If I use line-height 1 the problem does not occur because the middle vertical alignment of a text in a line of the same size is the same as the top alignment.
You can see what I mean in this code pen.
Any idea?
You can add a negative top margin to your title.
Defining both your font size and the margin in em will allow you to achieve alignment regardless of what font size is inherited.

Excel chart grid size and multiple colors (no VBA)

I would like to ask for your help on two major problems I have with an Excel (2003) chart:
1) I would like to create a chart which has got 25 grids (5 on the x axis and 5 on the y axis). The number of grids must not change, i.e. data should have no impact on the size, length and number of grids (several different worksheets are used as input to the chart). How can I create such a chart without having different grid lenghts depending on data?
2) I need a chart which has 25 grids, with each grid being colored differently, e.g. for example 3 grids in the upper right corner are red, 3 grids in lower left corner are green, inbetween all grids are colored white. I have read some articles on creating charts with a quadrant background, i.e. 4 grids, each having a different color. But I would like to know how I can create multi colored background for 25 grids?
Many thanks in advance!!
Regards,
Since you don't want to use VBA, there are a number of hand steps that are needed to create the grid chart you are looking for. For the most part, these steps can be taken in any order.
Enter what will be the horizontal column labels in a 1 x 5 cell range in your worksheet.
In the 5 x 5 cell range immediately below, enter the value 1 in each cell.
Selecting the 6 x 5 cell range, insert a 100% Stacked Column chart into the worksheet. You will now have a chart with of bars with five horizontal bands, each of a different color.
Delete the legend.
Select one of the bands to format and set its Gap Width to "No Gap."
Insert a chart title and horizontal and vertical axis titles, if any.
Select each band (data series) and set its fill color to solid fill white and its border color to solid line black.
Select the chart area and set its height and width to identical values.
Lock the chart area's aspect ratio.
Select and set the fill color of each data point (grid cell) that you want in a contrasting color.
(I am unaware of any way to dynamically set the colors of the grid cells based upon different data values, other than via VBA.)
If you want to change the font size of the labels of one of the axes, be sure to set the other axis to the same size to preserve the square grid layout.
Set the major tick mark type of the vertical axis to None, and the font color of the vertical axis labels to white.
At this point, you may want to shift the plot area to the left so that there is more white space between the right borders of the plot area and the chart area.
Select the chart area and then insert a text box over the vertical axis label area.
Enter into the text box the vertical axis labels that you want to show, with a blank line between each label, and with the font size and color of your choice.
Move the text box vertically so that, by eye, the first of labels in the text box is by eye aligned vertically with the center of the top row of the grid.
Select the blank line between the first two labels in the text box and change the line's font size so that, again by eye, the second label is aligned vertically with the center of the second grid row. Continue with the three remaining labels.
If you want finer control of the alignment of the labels, insert a second line between the each pair of labels and set the font size for the second lines in a smaller font than the first lines.
This text box is the only element of the chart that will not automatically resize if you change the size of the chart.
Other than any minor tweaking of the font sizes or alignment of the chart title and the axis labels, the chart is done:

Which is the best way to plot graph in iphone?

I saw some Core-plot sample. Is there anything equivalent that will do my task easily? I also want to know feasibility with Core-plot in iPhone. (any issues with core-plot)
I want to have multi-colored vertical bar chart. Is it possible to customize Core-plot framework. Using only one barplot can we have multiple segment on it.
Thank you.
Naveen Thunga
To make a stacked bar plot, you need to make multiple plots, one for each segment. On all but the bottom plot, set barBasesVary to YES. The datasource will ask for a third field called CPTBarPlotFieldBarBase which is the base value for the bar. You will have to do the stacking calculations yourself.
The horizontal lines can be drawn using an additional bar plot. Give the bars a short height (tip - base). You can make the width wider than the others if you want--each plot is independent.
The space between the bars depends on several factors. By default, bar widths are specified in data coordinates. For example, if the bar locations are one unit apart, a bar width of 0.5 will make the bar width and the space between the bars equal; a bar width of 0.75 will make the space 1/3 of the bar width. The actual width in pixels depends on the size of the graph and how many bars are visible (determined by the plot range along that axis). If barWidthsAreInViewCoordinates is YES, then bar widths are given in pixels which keeps them the same apparent width as the plot range changes, but the space between them will change with the plot range.

Vertical or diagonal scrolling on UIScrollView

In my case the method scrollViewDidEndDecelerating can detect just horizontal scrolling in UIScrollView and i want to know how to detect diagonal or vertical scrolling.
To detect the direction of the scroll in, say, scrollViewDidScroll:, look at how scrollView.contentOffset.x (horizontal) and scrollView.contentOffset.y (vertical) have changed from their prior values. If they've both changed, then it's a diagonal scroll.

Resources