I'm new to Qt Designer, and I am working on a main window where I want to have two list widgets off to the right, laid out in a vertical splitter, and then a larger text browser widget to the left, which is then itself in a splitter with the list widgets. So the relative sizes of the list widgets can be resized vertically, and the horizontal space between the text browser and the other two widgets can also be resized.
I tried first laying out the two widgets on the right in a vertical splitter, and then selecting the layout, like so:
The problem is, now that the two list widgets are in the splitter layout, I can't then add that layout to any other larger layouts. All the options appear grayed out. If I just do a standard horizontal or vertical layout, it is possible to then make larger layouts out of smaller ones. So how is this to be done when using splitter layouts? Thanks!
Look's like you are selecting two ListWidgets instead splitter. To combine layouts you need to select one splitter which contains ListWidgets and then TextBrowser. In this case Lay Out Horizontaly in splitter will be available.
Here video demonstration (1.25 MB)
Related
I'm trying to build a screen where there is a fixed widget at the top of the screen and another widget which is fixed to the bottom of the screen and in between is a scrollable widget.
I want to have the content inside the scrollable widget scroll underneath the two fixed widgets (both with a transparent blur), to indicate that there is more content underneath.
Here is an image of what I am trying to do.
I am currently using a Stack for this, however I am having to manually adjust the padding in the SingleChildScrollView to offset for the top and bottom widgets, but I would like to have this be much more flexible and have the widgets be any size and not have to update the padding.
I've found other examples where the bottom widget is part of the scrollable content but that isn't quite what I am looking for.
Does anyone know of a way to do this, without having to manually provide the padding?
I have a window in mono gtk#, which has lot of VBoxes & HBoxes. These boxes contain some buttons, labels, and some other widgets also. Now I need to make this window alone to transparent.
I created one drawingArea by referring zetcode page.
But inside this drawing area I'm not able to do the arrangements of my widgets, one Move function is available, but it is not much use for me. So how do I do widget arrangement neatly inside a drawingArea?
I have a view controller laid out in a storyboard using size classes and autolayout. I've added a couple pages of text inside the text view. When I present the controller containing this text view using form sheet style on iPad, the text within the textview is scrolled down, cutting out first 4-5 lines.
How can I make sure that UITextView rearranges it's contents so first line of text is displayed at the top (where it is expected to be)?
Here's what I see in storyboard. When presented, the word "test" is hidden off the top of the textview (where the word play is).
It's a bug with size classes, but here is a workaround:
If your scene in storyboard is bigger than on the device (simulated metrics "freeform"), the auto layout will size down the view and changes the scrolling of the text view.
If you preview the scene with the smallest simulated metrics (iPhone 3.5-inch landscape!), the text view will keep size or grow and the scrolling is ok.
I would like to create a Qwidget with a large number of square QPushButtons. I would like those buttons to be organised into a mosaic layout. Whenever the window is resized, the mosaic widget should be resized and the buttons re-ordered accordingly to fill in the width. Buttons that cannot fit within the area, can be viewed by scrolling the widget vertically.
Is there a Qt4 Layout that allows me to do this easily? What is the best / easiest way to achieve this? Thanks.
You could use the flow layout (from Qt examples) inside a resizable QScrollArea.
Use a QGridLayout in a QScrollArea.
I'm new to Macs and iOS, I got my app running on webOS, Android, and WPF/Windows. In all cases the size of, say, a 'widget' to display a bunch of text, can change depending on the dimension of the text to be displayed, as well as the position can be up against another widget. As the text size changes, the position will change so that all the widgets are crammed together nicely.
I've been searching for this capability in IOS4 in books and on-line, and it's starting to look like in iOS, you have to actually calculate the size of the text to be displayed in ViewText and then change the dimensions of ViewText, which of course then bumps other Views around to accommodate this size change. It sounds like a nightmare. Isn't there some other way to do this (like all the other GUIs can do) to size based on content, and to position relative to other Views like stacking them all together whatever size they are?
Same with ScrollView, it looks like the size of the window you actually see has to be manually specified as well, instead of, say, taking up the entire viewable window and then you can populate the ScrollView with a bunch of sub-views, some of which are below the initially viewable area? I tried this in Xcode4, but so far, haven't gotten it to work.
Similarly with creating an object with a NIB and instantiating that NIB onto an existing View, how does it determine where to position this NIB onto the existing screen?
Thanks!
Paul,
For the scrollview you need to set the bounds so it fills the screen or the area you wish it to occupy, it will then automatically generate scrollbars based on the layout within it. In the land of iOS you do have to do extensive layout work such as positioning and sizing your controls but you can also use the UIAutoResize (if I remember correctly) masks such as if they are anchored to a size, fill the area, etc. It's a little complicated to learn initially but you'll get the hang of it.
As for text you just need to use the right control, I believe what you want is a UITextView and set the options on it as needed.
When you view a XIB it's going to layout initially as you have it, again, you need to position your controls AND set their anchors (autoresize masks) so they adjust based on the screen size (phone vs. pad) and orientation: landscape vs. portrait.
HTH