The QToolBar class, part of the Qt framework, provides a movable panel that acts as a container for a set of controls.
Questions tagged [qtoolbar]
108 questions
3
votes
1 answer
How to Remove a widget from a QToolBar?
I'm building my App interface with Qt at the moment.
But one question arises...
I have a QToolbar to which I added a QToolButton with the QToolbar->addWidget method.
The problem is that I want to remove this button later on.
How can I achieve that…

Miky Mike
- 341
- 6
- 17
3
votes
1 answer
Can a QToolbar be added to a QDockWidget?
I have setup my app to have various dock windows within the main window. I am also able to add a toolbar to the main window. However, I would ideally like to add the QToolBar inside one of the QDockWindow instances (or the QWidget that it houses) as…

Alan Spark
- 8,152
- 8
- 56
- 91
3
votes
1 answer
How to add actions menu in a toolbar?
I want to add a menu from an item in a toolbar.
For example, from the following code:
import sys
from PyQt5.QtWidgets import QAction, QMainWindow, QApplication
class Menu(QMainWindow):
def __init__(self):
super().__init__()
…

TheCrystalShip
- 249
- 2
- 4
- 12
3
votes
1 answer
Set priority between vertical and horizontal QToolBar positioning
I've searched for quite a long time, but I haven't managed to find a solution to this problem:
In QtCreator, I have a main window with 2 QToolBars, one vertical (Qt::LeftToolBarArea) and one horizontal (Qt::BottomToolBarArea).
The idea is to have a…

Simone Mariottini
- 125
- 1
- 11
3
votes
2 answers
PyQt how to make a toolbar button appeared as pressed
I want to make a specific button in PyQt toolbar appeared as pressed(with blue background). Suppose when I hit the toolbar button I want it to be appeared as pressed
import sys
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import *
from…

Burhan Asif
- 228
- 5
- 13
3
votes
1 answer
Show shortcut in tooltip of QToolBar
I have QActions added to a QToolBar using addAction().
I want the toolbar button tooltips to show the shortcuts. e.g. Copy (Ctrl+C).
Of course, i could statically set
action->setTooltip(QString("%1 (%2)").arg(action.toolTip(),…

Tim Hoffmann
- 1,325
- 9
- 28
3
votes
3 answers
QToolBar Change Height
In my project I have a QToolBar with default size and size policy. I want to increase the height of the toolbar to 36px.
So far I have tried:
Setting a stylesheet property to the toolbar: height: 36px;
Setting the toolbar object's size policy to…

mrg95
- 2,371
- 11
- 46
- 89
3
votes
0 answers
Re-dock two QToolbars back in the same QToolbarArea
I'm working on a Qt project, where I need to get the toolbar positions at run-time. I used QMainWindow::toolBarArea(QToolBar *toolbar) to get the current docked area of the toolbar. And then I can use that later with QMainWindow::addToolBar (…

Praneeth Peiris
- 2,008
- 20
- 40
3
votes
1 answer
How do I add controls other than buttons/actions to toolbars in Qt, such as text boxes and combo boxes?
From the screenshot featured on this page http://www.kde.gr.jp/~ichi/qt/designer-manual-3.html it seems like this functionality was available in Qt3. Was it removed in Qt4?

Jake Petroules
- 23,472
- 35
- 144
- 225
3
votes
1 answer
Add a toolbar to the left side of the main window in PySide
I'm building a GUI using Pyside. I'm trying to add a toolbar to the left side of my main window. This code works for adding a toolbar on top:
toolbarBox = self.addToolBar('boxAdjustment')
However, I want to customize it to locate at the left side.…

Amin Suzani
- 567
- 6
- 19
2
votes
1 answer
QToolbar force shrink
Qt toolbars shrink and display an 'extend' button when there isn't enough space.
Is there anyway to create a toolbar pre-shrunk? I want to display just the first label so I can use a large number of toolbars as floatable popup-menus (or a linear…

Martin Beckett
- 94,801
- 28
- 188
- 263
2
votes
1 answer
How to customize QToolButtons from QToolBar in Qt?
I am having QToolBar with various tool buttons on it. I want to customize those buttons with some simple effects like, it should be seen that button is pressed, after pressing it should change its icon color or background color etc.
I tried but I…

tushar
- 313
- 4
- 10
2
votes
1 answer
How to make the tool buttons in a toolbar only select one at a time?
I have five tool buttons in a QToolbar via toolbar.addAction() and if I choose one of them I would like to make the others not looking checked.
Example: If I choose the 'A' button and the program is now in the 'A' mode, others can't work.

於二號
- 53
- 4
2
votes
1 answer
Breadcrumbs navigation using QToolBar and QListView
I have JSON data something like this
{"books":{
"web":{
"front-end":{
"html":["the missing manual", "core html5 canvas"],
"css":["css pocket reference", "css in depth"],
"js":["you don't know js", "eloquent…

Ruchit
- 661
- 1
- 6
- 19
2
votes
1 answer
How to change the icon of a QAction on a QToolBar when checked/unchecked?
I've created a QToolBar:
QToolBar* pQToolbar = new QToolBar();
QAction* pAction = pQToolbar->addAction("CoordinateType");
pAction->setObjectName("CoordinateType");
pAction->setIcon(QIcon("global.png"));
pAction->setCheckable(true);
Then I tried to…

zwcloud
- 4,546
- 3
- 40
- 69