I use ubuntu with LXDE and I wonder if I could add some extra buttons to the standard set of minimize, maximize, close. Is it possible? Shall I dig in X11 sources or of smth else?
X11 does not know anything about window manager. Most probably your question is WM-specific, but you can try to look at ICCCM for generic solution
Window titlebars, borders, and other decorations are created by the window manager in X11, not the X server or libraries, so you'd need to look at the LXDE window manager sources for that.
Related
I need to make buttons that look like standard window title buttons with their icons (close/minimize) in the current operating system (win / osx / linux). Is there a possibility in qml?
You take screenshots (or google for images) of those buttons in their different states (enabled, pressed, highlighted, normal e.t.c), than you style your Buttons to show the right image at the right time.
Which set you need to choose, depends on the OS, which you can query with
Qt.platform.os
Depending on the usecase, it might be worth to investigate the possibility to use real Windows, if you are planning on building some kind of subwindows. Might prove complicated, though.
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.
As I am putting more widgets on top of more layouts in my application, the space where I design the GUI is getting also bigger for the Qt-creator interface.
I have many buttons and frames which are out of reach. I cannot see them (or click them, of course). I don't know how they look until I run the whole application for debugging.
Is there is a way to zoom out/in the main frame (the whole playground) so that I can see my full GUI design on the UI of Qt IDE?
P.S.: I am working on macBook 13"
Zooming is not possible. You can use Tools -> Form Editor -> Preview.
If the viewport gets too small the QtCreator shows scrollbars which allow to move the part of interest into view.
Note, on some system configurations the scollbars may be very small and hard to handle.
You can use this steps
Tool-->options-> Text editor ->zoom
Text editor
Is there a way to customize toolbar in Xcode 4? Reorder buttons, remove default and add new? Also I want to turn off text under toolbar buttons, since I run Xcode 4 on 13" Macbook where every pixel is precious.
To turn off text underneath the buttons just cmd+click on the top right button (on the level with the traffic lights). This is a global thing.
The rest you're stuck with I'm afraid.
According to: http://pilky.me/view/16 toolbar customization is gone, and unlikely to return :(
As Elibud says toolbar customisation is no longer available, I use a 13" Macbook and, minimise them. I am running Xcode V3, it's a bit easier to see all the windows as you can move all the menus around and open Interface Builder separately.
My QT app has multiple windows and sometimes, even though the windows are already open but burried under other windows, the user will select an option to open one from the mainwindow menubar in which case I want to simply bring it up and make it the current one. Now using QWidget->raise makes this window go on top of all other windows but it doesnt select it and that is what I need to do. I tried QWidget->setFocus but that doesnt do anything. In the mean time I am using a combination of QWidget->close followed by QWidget->show but I would like to know if there is a command to use with ->raise.
I tried:
pMission->raise();
pMission->setFocus(Qt::ActiveWindowFocusReason);
but it didnt work so i used:
pMission->close();
pMission->show();
Have you ever tried QWidget::activateWindow?
From help file, this function is going to
Sets the top-level widget containing this widget to be the active window.
An active window is a visible top-level window that has the keyboard input focus.
On MacOS Lion with Qt 4.8.0, raise() was the only one that worked for me. activateWindow() and setFocus() did not.
(I don't have enough karma to make this a comment on Mason's answer)