Toolbar overflow in QML - qt

I have a toolbar defined as "toolBar" property of a ApplicationWindow.
When I resize the window I want that toolBar (if it's too large for the current size) handle overflow with a "more" item. After a lot of research I couldn't found anything on the web. I join some screenshot of what I have and what I want.
The second example is something I have done in pure C++.
In my research I also read something about toolbar only handle overflow in MainWindow and that maybe why I can't make it work in ApplicationWindow.
Thanks for your help.

It could be done if you go for a model driven toolbar items.
Then, if the toolbar view is not wide enough to fit everything, you can calculate the index it cuts out at, and implement a drop down menu with another view, this time vertical, that shows only items after the cutout index.
It is not ideal, but since there is no built in support for that, this is by far the easiest and quickest way to get the desired result.

Related

ListView - zoomed out and transparent elements

I have a scrollable and flickable ListView with 5+ elements and I'd like to have the elements which are shown at both ends zoomed out, transparent and slightly moved so the whole list becomes rounded up, sort of getting the shape of a wheel.
I think the two images describe it best:
That's what I have:
And that's what I want:
Since I'm also targeting devices without GL - although deprecated - I'd prefer a QtQuick 1.x version, however I'm happy with all I can get :)
Thanks a lot in advance!
The ListView is not exactly meant to do that.
Have a look at the PathView.
There are a lot of examples from the documentation, maybe you'll find there something very similar to what you want to do.
Otherwise you should put a MouseArea in your delegate and react to the entered and exited signals. Do not forget to update the size of the delegate accordingly to the size of its content if needed, otherwise the items will overlap each other.
That said, I'd maybe use the PathView to do that.

Window flags not helping in mdiarea in Qt

I am using Qt and creating a GUI with multiple sub windows. I am using MDI Area for the same. I want to hide the top toolbar of mdi subwindow but using window flags is not helping.
I have tried writing the code as follows. First I tried for mdiarea and then for subwindow but neither worked.
mdiarea.setWindowsFlags(Qt::FramelessWindowHint);
subwindow.setWindowsFlags(Qt::FramelessWindowHint);
I have also tried using Qt::CustomizedWindowHint but even that is not helping. Please help me with this.
Thank You.
Try this:
mdiArea->addSubWindow(new QLabel("Qt::FramelessWindowHint"), Qt::FramelessWindowHint);
You don't want to set the MDI area itself as a frameless window, because it's a widget you likely have embedded in another window... it most likely already doesn't have a frame.
Your setting the 'subwindow' should work... but addSubWindow(myWidget) actually wraps the widget passed in in the real subwindow, so that's what was going wrong. Qt lets you pass in window flags as the second parameter of addSubWindow() and those flags go to the real subwindow.
Note that with a frameless window, you can't drag the window around to move it, or grab the edges to resize it, because there's nothing for you to grab onto!
If you just want the minimize and maximize buttons gone (but still want the close button), try passing Qt::Dialog instead.
Try also experimenting with these:
addSubWindow(new QLabel("Qt::Tool"), Qt::Tool);
addSubWindow(new QLabel("Qt::Tool|Qt::CustomizeWindowHint"), Qt::Tool|Qt::CustomizeWindowHint);
addSubWindow(new QLabel("Qt::Dialog"), Qt::Dialog);
I think Qt::Tool|Qt::CustomizeWindowHint is probably the best option (no buttons, but still movable and resizable - if you don't want it resizable, give it a fixed size (setFixedSize()).
Edit: Also try: Qt::CustomizeWindowHint|Qt::WindowTitleHint

Qt5: how to resize two UI lists against each other

I would like to be able to resize two QListWidget that sit in a QVBoxLayout, by grabbing the edge in the middle of the two and sliding it up or down. One would shrink, the other would get bigger.
Here is a screenshot of a sample app:
I would like to be able to grab the bar between the two lists and resize them.
This is what it looks like in the Qt layout editor:
I'm not sure if the vertical layout is the good choice, here, there may be another vertical layout that provide this functionality maybe?
Is it even possible with Qt?
You need to use QSplitter. It's available in the form designer.
To add to Riateche's correct answer, you can also use qt-designer to add specify the type of layout (QSplitter) by first selecting the widgets and then right-click to layout->horizontal splitter etc.
Here's a simple tutorial I ran by a few years ago: http://www.youtube.com/watch?v=E7Ud6FonsR4

Force MenuBar to always open downward

I have a MenuBar which opens downwards except when there isn't enough room to open it. For example, it may have 10 items but there's only enough room to display 4-5. Flex then tries to display the menu above the bar, which is completely off the screen. Is there some property or style I'm overlooking to always force it to open downward?
EDIT: Thought I'd give some clarification as to how I plan to circumvent the issue. If I can always force the menubar to be orientated downwards, I can make it into a scrollable menubar displaying only a few items at worst.
I do not have a direct answer. However, the best resource I have ever seen on the menuBar component is here.
http://adobestudionews.net/devnet/flash/articles/creating_as3_components_pt2.html
My guess is it is buried in the renderers.

should I use Navigator or View State?

Hi I want to create an application has this sort of function:
http://looklet.com/create
In this application when you click the button (or some tilelist) on the right the model on the left update accordingly. I wonder how they achieve this. Originally i think it's some sort of image-only pop-up window but then pop-up window seems to update the entire view.
Then I think it might be only change view state, but then I still confused how it can be done using view state.
Flex expert please give me some hint !
Looks like transparent images drawn on Canvas. Each piece must have predefined offset and draw order.
Probably just images placed on one or more Canvas, with the z-order controlled for depth.
The body stays the same, so shirts probably have their own placement properties, as do skirts, underwear, hosiery, etc. as well as backgrounds, faces, etc.

Resources