Can Qt build menu bars with a widget that allows to write the menu entry to select, and the menu bar tries to guess what the user is looking for providing a list of candidate entries?
I am sure this can be implemented manually, but I am wondering if this is a feature that Qt provides out of the box.
See the image for an example (from Visual Studio 2022).
Related
I want to create a custom Qt/QML menu like the main menu in Firefox:
As you can see, the menu can exceed the boundaries of the main window if it is bigger than the main window. Is there any way to achieve such behavior in Qt? I tried with the native Menu QML component, but this only gives me a default OS context menu with very vew customization options. I want full control over how the menu looks like and its contents (i.e. the same possibilities I have for a normal QML component or widget).
Qt Quick Controls 1 has Menus that are native and hence are not limited to window bounds.
Qt Quick Controls 2 does not yet have support for native Menus. You can track that here.
Qt Labs Platform has a native menu.
However, I doubt that any of these options will be sufficient in your case, as native menu support means utilising whatever the OS provides, which is probably not flexible enough to implement the menu shown in the image.
As mentioned by #hyde, one option may be to create a Window and implement your menu in there.
I'm relatively newbie to qt creator doing embedded cpp work. I was wondering if there is a way for the class view side bar to show the active class I'm working on in the editor window? I also tried to do a search using locator "c MyClass" to show MyClass, the locator manages to find MyClass, however when I click it, it opens in editor window, it is tracked in the Project sidebar but it is not tracked in the Class View SideBar. Am I missing any settings?
Qt Creator 3.4.1
Based on Qt 5.4.2
Is there is a way in Qt Creator for the class view side bar to show the active class
I'm working on in the editor window?
Yes, choose Outline in the hierarchy menu on the left. Mind that you can use Split button (find it by hovering over the second from the right top button there) for having more than one type of project hierarchy there.
I would like to create an application using Qt (PyQt5 specifically) that has a photo editor like interface. More specifically, I would like it to have:
No main window
Free-floating toolbar
Free-floating context window
Startup dialog
Edit-windows
The idea is to have the toolbar and context window persist for as along as the application is running. The user then opens one or multiple documents (e.g. images in the photo editor example) and uses the options in the toolbar to modify the document(s).
My first question is; does this type of application interface have a specific name, something akin to MDI or SDI? I've been searching for "photo editor interface" and variations on that, but haven't been able to find a search string that seems to hit the mark. For instance, I've tried "build a photo editor type interface with Qt" but it doesn't yield anything useful.
The second question I have is, what is the best way to build a Qt application that doesn't spawn a main window? It seems like I could kludge an assortment of dialogs together to make this happen, but I would really like to use a lot of the functionality of QMainWindow (toolbars, menus, top-level management of the application). Is there a way to launch QMainWindow, display the menu and toolbar, but suppress the main window?
I plan to primarily use this application on OSX, but would also like it to perform well on Windows and Linux.
QMenuBar has explicit support for OSX to have the menu bar behave as expected: http://doc.qt.io/qt-5/qmenubar.html#qmenubar-on-os-x
I think it'll also work on Ubuntu's Unity, which tries to have similar style, but there may be some details you need to take care of. Other desktops should work as expected.
As to how to have individual windows: any Qt widget will be a top level window if it has no parent, so that is an easy way to create windows. If you want to have parent windows (for example to control window stacking order automatically), there's a window flag for that. So you don't need to use QDialog (not sure if you were implying that in your question).
You want to read QWidget documentation carefully to get an idea how all this works.
I'm reading Qt Designer manual. And found following para saying;
"Qt Designer provides a scratch pad feature that allows you to collect
frequently used objects in a separate category. The scratch pad
category can be filled with any widget currently displayed in a form
by dragging them from the form and dropping them onto the widget box.
These widgets can be used in the same way as any other widgets, but
they can also contain child widgets. Open a context menu over a widget
to change its name or remove it from the scratch pad."
I was searched for scratch pad, but nothing found.
Try dragging a widget (it can have nested child widgets in) from the form editor onto the list of stock widgets on the left, it should add the dragged widget into a new subgroup "Scratchpad". The scratch pad will only appear then.
The scratch pad category can be filled with any widget currently
displayed in a form by dragging them from the form and dropping them
onto the widget box.
It is a little ambiguous, but by "widget box" they mean this guy:
The JavaFX 2.1 Release Notes states that this release includes,
UI enhancements, including controls for Combo Box, Stacked Chart, and application-wide menu bar.
What does the "application-wide menu bar" mean? What does it imply?
Looked for UI Components but could not find any reference to it.
I believe the comment refers to the new JavaFX 2.1 ability to set a menu bar to act as a system level application menu bar. For example, on Mac, it would be the menu bar at the top of the screen.
I think the added property is MenuBar.useSystemMenuBarProperty.
Windows (and some Linux window managers) don't have the same concept, so I don't think the property does anything on those platforms.