I am developing my Python app with PyQt4 and I want to customize my app interface (QMainWindow, QLineEdit and so forth) in windows like
this view (or something else):
Instead of this (default style on Windows 10):
For all styles except the window frame border use Qt stylesheets (QSS) (Documentation).
For the frame borders it's a bit difficult:
See the Qt window flags example to see what Qt can do with the window frame.
Basically you cannot style the window frame (they take the style from the OS), but you can hide/show buttons and you can show the window completely frameless.
On Windows however, some people hacked into the windows frame bar (Tabs in title bar: what's the secret?). This may be possible to do with Python too.
The most universal approach would be (although this is a bit costly) to not using any OS provided frame (Qt::CustomizeWindowHint) and then inside implement your own styled frame implemented drag and drop of the title bar and border and so forth.
With this you can easily achieve every possible frame border including your example, but you have to re-implement the buttons and the dragging behavior and the response might be a bit less quick than usual. Also the look and feel will then not be OS specific out of the box as it is for Qt's own frame borders.
For example in Linux, the title bar is typically shown differently when maximized - you wouldn't have this then.
Example of custom made frame bar: Customize title bar and window
Related
How do you apply toolbar-like styling to round textured buttons in a custom view?
Here's some more background:
Apple's human interface guidelines say to use controls with round textured styling in the window frame (the toolbar or the bottom bar): http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Controls/Controls.html (under "Window-Frame Controls").
When you use these controls in the window frame, Mac OS X Lion applies a relatively strong gradient to the controls when the window is active (about 95% grey to 80% grey), and almost no gradient at all when the window is inactive (about 95% grey to 93% grey). In other words, when the window is inactive, toolbar controls look flat.
When you use these controls outside of the window frame (say, in a custom view directly below the toolbar), Mac OS X Lion applies different styling. Most important for me, Lion applies a relatively strong gradient to the controls even when the window is inactive, so the controls in the custom view look out of place next to the toolbar controls on an inactive window.
There appears to be some way to get the right look for these controls even in a custom view. For example, the format bar in Pages, and the format bar in Mail when you're composing a message (both right below the toolbar).
Does anyone know how to achieve the correct look for these controls?
I am trying to create an interface for my application using Qt Designer. I want it to have a tabbed, ribbon-style set of controls at the top, and a MDI-style area with docked windows which I plan to show and hide depending on which tab of the ribbon is currently selected. I am just beginning with Qt Designer as well as Qt4 itself for that matter so I'm not quite sure how to setup the window, which widgets and layouts should I use etc.
It's quite obvious there should be a QTabWidget at the top, but I'm not sure about the bottom. Should I use a QFrame? A QMdiArea? A dock widget? What layouts can I use to make sure the tab widget has a fixed height, occupies the whole width of the window at all times and the bottom area scales as the window is resized?
I've read in the manual that splitter layouts allow for manual adjustment of the size of the widgets they contain, but I can't drag the box size of a widget after I place them inside a splitter. Thus I'm unable to setup the area below the ribbon. Anyone, help?
You should look into the QMainWindow and check the multiple utilities it can provide you (Toolbar, StatusBar, DockWidgets, CentralWidget, etc...).
The way I understood your case is that you will always have the MDI Area visible, and that the tab bar will only be used to change the dockWidgets. Here's how I would do it.
The centralWidget of the mainWindow would be a QWidget with a QVBoxLayout containing a QTabBar widget first (up) and a QMdiArea under it. The sizes should be handled automatically.
This will allow the user (or you) to dock widgets on the left, bottom, top or right areas of the mainWindow's central widget. Keep pointers to the dockWidgets to be able to move and show/hide them at will.
Hope this helps.
VTK Designer, which is built on Qt, has a Ribbon-ish interface. You might take a look at the source code for reference.
I am tryimng to make a UI. But in qt, the window size is too short, I want to work in a separate windows like photoshop. Here I am posting the picture. I want to see the middle window(i rounded it by rose color) in full screen size. Can anybody help me?
EDIT:
If I want to create a full screen application, How can I position the widgets in it. It's possible dragging a widget inside a scroll bared window,but is not user friendly. I want it to work like photoshop, like separate windows.
If you want to have more space to work on the design of your widgets, you can open QtDesigner separately and maximize the design area. Panels can be closed and undocked.
Now if you want to maximized only the central widget, there is a trick:
Create a custom widget and work on it in QtDesigner. You will be able to put it in near full screen by increasing its size
Set your custom widget as central widget in your GUI application.
Previous answer before edit:
Hi, If you want to view your widget in fullsreen mode, you can call the ShowFullScreen function. If what you want is to maximize the widget, you can call the ShowMaximized function.
Okay of course i checked the API and there is nothing - at least under this class name.
What i mean is the widget referred to as a bottom bar in the Apple Human Interface Guidline.
Do i have to draw this myself from a NSView, if so how do i get the texture drawn?
alt text http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/art/wn_newwindowparts.jpg
P.S.: I added Toolbar to the tags because it is the closest generic keyword i can find and the bottom bar ist just the opposite as a toolbar.
You're looking for the "content border." This is something you need to set in code with Leopard, but you can set it in Interface Builder in Snow Leopard (note you must be targeting 10.6 or above in order for this to be a valid setting in Interface Builder).
You can conveniently set a large or small border (using the standard Apple-approved sizes). To set this, select your window in Interface Builder, then show the Size inspector. At the bottom of the panel, you'll find the Content Border settings.
Brandin Walkin's excellent BWToolkit (BSD license) provides support for UI in the content border (among many other nice UI elements) and makes using a "bottom bar" much more enjoyable.
I have a tab control in my main page. When I have it in the Design view in Visual Studio, everything looks perfect, the tab control is set to fill the entire page. However when I run the program, and I have it in a maximized browser window, the tab control is still the same size as it originally was. In other words, the tab control does not resize proportionally to the browser window resize.
So I was wondering if there was a way to change a setting on my tab control or maybe some code that would force the tab control to resize along with the browser window?
(Using C#, Silverlight 4.0 in VS2010)
Ok, so after tinkering with this for the last couple days, I've finally found the answer. I feel like a rookie for not doing this sooner, but I got to looking at the title bar on the top of the page and noticed that it stretched across the screen when the browser window was maximized and when it was resized, the title bar shrunk to fit. So I looked at the properties of the title bar and saw that it's horizontal/vertical alignment was set to "stretch." I know, it's a rookie mistake, but it just never occurred to me that "stretch" was an option in the alignment property.
Long story short, change the horizontal alignment property to "stretch," vertical alignment property to "stretch," and then set the height property of the control to "auto" and the width property to "auto" and you've got yourself an auto-resized control.