Layout items on QToolBox page to expand with page - qt

In Qt Designer, how do you lay out the items on the pages of a QToolBox so that they expand with the toolbox? I have tried adding a table-view widget on a QToolBox page. Please see image:
But when the QToolBox is expanded along with my application main window, the table-view does not expand with the toolbox page.
Is there something I am missing ?

To answer my own question, first I had to have a layout on the desired page of the toolbox.
Then I had to highlight the toolbox itself in the object inspector pane (while the page I want to layout on is active AND has a layout object !!).
Then I chose the desired layout from the toolbox context menu (i.e. right mouse click on the toolbox object and choose Layout). This changed the layout on the active page. Not sure why this worked but it worked.
Thanks #ekhumoro for pointing me in the right direction.

You need to click on the toolbox page to select it, and then set a layout on the page itself. Each page in the toolbox will need its own layout set in this way.
If you look in the Object Inspector, you will see that each page has a QWidget automatically added to it. The layout for each toolbox page is actually set on that container widget, which then holds whatever other widgets you add to the page. Once the layout has been set properly, you should see the icon in the Object Inspector change to the appropriate layout icon.

Related

Is there a way to create two independent layouts in Qt Designer?

I am new to Qt Designer so this question may be stupid but I'm really stucked.
I'm creating an app using Qt Designer and PyQt5. My app contains a few screens and I want to switch between them by clicking the button.
The first screen consists of a button (button_1) and a label (label_1) placed in a vertical layout. The second screen also consist of a button (button_2) and a label (label_2), but these are different widgets with different size and content. And I want to place button_2 and label_2 in a horizontal layout.
Previously I didn't use layouts. I just created one .ui file and put button_2 and label_2 above button_1 and label_1. They were overlapping but it didn't affect the performance because I made the button_2 and label_2 invisible when button_1 and label_1 are shown and vice versa. But now I need to make the window resizable, and I need to put the widgets in a layout.
The first thought was to create two separate .ui files and set them using loadUi command when it comes to switching between screens. But I need to use just one .ui file. Is this possible? How can I create two independent layouts? Or maybe there is another way to solve my proble. Any help is very much appreciated.
I think that in this case your best option is to use a QStackedWidget as a container for your labels and buttons. To create a stacked widget in Qt Designer you can drag a Stacked Widget from the container group on the left to the parent widget. This will create a stack with two pages. Each page can then be set up independently. Whatever layout you and widgets you add to a particular page will only be visible when that page is shown. You can add additional pages if you like by right-clicking on the stacked widget and selecting Insert Page from the context menu.
To navigate between the pages in Qt Designer you can choose the correct widget in the tree in the Object Inspector, use the two black arrows in the top-right corner of the stacked widget, or use the context menu of the stacked widget. To navigate between the pages in your python script you would need to use QStackedWidget.setCurrentIndex().

How to add child my view on top-level window? (Xamarin.forms)

I'm making app with using Xamarin.forms.
I'm creating my own tabbar.
But for that, I have to attach this tabs on most high depth windows.
for example, If new navigation page is pushed on iOS, it must be on that.
How to access most top depth's layout? (I want to add child my tabs on that)
1) Make your tabbar a ContentView
2) On each of your page add the tabbar as the last child of your Content (being an AbsoluteLayout for example)

How to have common control in QTabWidget

I want to use a common control (QTreeView) in two different tab pages in QTabWidget.
how to do this ?
I added a tabwidget and controls in tab pages in Qt designer.
using qt creator version 2.4.1 in Win 7.
You can't have the same QTreeView in two different QTabWidget pages. When you add any widget to a layout, that layout takes ownership of the widget. Since there can only be one owner, you're stuck with one parent per widget.
But you can fake it. Give your main page a grid layout. Put a QTabBar running along the top, your QTreeView on the left (or wherever), and a QStackedLayout on the right. Connect the tab bar and the stacked layout so changing tabs in the bar changes the visible page in the stack layout.
That should be just what you're looking for - just be prepared to fight with QTabBar to get it to display like you want it to...
Alternatively, just live with having two separate tree views - they'll both be viewing the same model, after all, so the bulk of the data won't be duplicated. Saves you a fight with QTabBar, too.
Hope that helps!

Searching for ASP.NET autohide docking panel

In few words: I need panel that works like Visual Studio panels (for example Solution Explorer) with 'Auto Hide' turned on.
More detailed question:
I'm searching for docking panel in ASP.NET that can be docked to any edge of its parent programatically - for example dock it to left border (I don't need to change it manually in browser). Then it is minimalized to title only and after mouse hover it is expanded without resizing its parent - it should be displayed over parent panel.
Do you know any component that works in this way?
Have a look at Telerik RadDock or Zee Web Dock.
You want to look at JQuery UI and this article in case you want to roll out your own implementation.

Asp.net ajax combobox doesn't display correctly when inserted inside a tab control

I have a display problem when I try to use a ajax combobox inside a tab control:
when my tab control loads on the page where the combobox is, everything works fine; however, if it loads on a another page, the you change to the page which contains the combobox, the right button (which opens the list of the combobox) isn't displayed at all.
Has someone been through this behavior? And maybe found a solution ?
Thanks in advance !
Use Firebug in FireFox (this tool is very good if you dont use it) and right-click the area where your drop arrow should be, then select "Inspect Element". At the bottom of your browser screen, you will see a couple windows. One window will detail teh styles being applied to the arrow area.
Look for a style that is making visibility of either a <td> or <img> to be hidden. The Ajax ComboBox control, sadly, is laid out in a table.

Resources