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
2
votes
2 answers
How to make QToolButton go beyond the edge of QToolbar?
How can I make the button go beyond the edge of QToolbar?
Below is the code as I create the toolbar:
mainwindow.h
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0)
private:
QToolBar*…

e.n.shirokov
- 259
- 2
- 12
2
votes
1 answer
QToolBar item margin
I have added several items to the QToolBar using addAction method. Is there a way to control a spacing inside item? I mean spacing between item text (or icon) and item border

Mikhail Zimka
- 694
- 1
- 9
- 20
2
votes
1 answer
How to disable right-click in PyQt5 and widget issue
I have a simple code that is making a window with toolbars.
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import sys
class AnaPencere(QMainWindow):
def __init__(self):
super().__init__()
self.widget = QWidget(self)
…

GLHF
- 3,835
- 10
- 38
- 83
2
votes
0 answers
Simple ribbon: autosizing toolbars and tabs
I'm trying to implement simple tabbed interface with Qt5. I use QTabWidget with QToolBars placed inside its tabs and I add QActions to the QToolBars:
The toolbar and the widget below are within a vertical layout. I'd like toolbars to autosize their…

Vercetti
- 437
- 1
- 6
- 17
2
votes
1 answer
Simple ribbon: how to use QActions within QTabBar?
I'm trying to implement simple tabbed interface with Qt5. I use QTabWidget with QToolBars placed inside its tabs and I add QActions to the QToolBars.
That works but causes the following issue: any action remains accessible only while its parent tab…

Vercetti
- 437
- 1
- 6
- 17
2
votes
1 answer
QToolBar - disable margins
When I call setIconSize(QSize(16, 16)) on QToolBar, it leaves margins from all sides, mainly bottom. setContextMargins(0, 0, 0, 0) does not help. Other toolbars I have are set up in the form of main window and look fine, but this one is supposed to…

LogicStuff
- 19,397
- 6
- 54
- 74
2
votes
3 answers
QToolBar: styling 'show more' button
Does anyone have idea on how to style this rectangular button -which is a default child of a QToolbar?
First two images show the button when the graphical interface is on normal screen mode. It appears; since toolbar icons don't have enough…

baci
- 2,528
- 15
- 28
2
votes
1 answer
C++ Stretching QLineEdit across center of Toolbar
I four QToolBars which are placed as such:
addToolBar(new BarLeft());
addToolBar(new SearchBar());
addToolBar(new BarRight());
addToolBarBreak();
addToolBar(new BottomBar());
The left bar has a few icons on it. The right one has a few icons on it…

Matt Eskridge
- 1,019
- 10
- 24
2
votes
1 answer
Python PyQt QtoolbuttonPopup mode
From what i understood from the internet resources, I could create a Popup menu of QActions on the Qtoolbar by using Qtoolbuttonpopup mode.
So, I created a QMenu and added a few QActions to it by using QMenu.addAction.
After that i have created a…

Chris Aung
- 9,152
- 33
- 82
- 127
2
votes
1 answer
QToolBar position (How to make it stay at a fixed position)
I initially needed to display two QToolBars in such a way, they are in two rows. I found the solution for that problem through this:
How to set the line where a QToolBar is displayed?
In my program there are a few QToolBars in the first row, they…

warunanc
- 2,221
- 1
- 23
- 40
1
vote
1 answer
QIcon not showing in QToolBar
I'm a beginner in Qt, currently reading this : https://zetcode.com/gui/qt5/menusandtoolbars/
When I declare QActions in a QToolBar, the QPixmap objects (turned into QIcons) are not showing :
No icons, only text
However, the QPixmap images are…

MatthieuHAMEL
- 11
- 3
1
vote
1 answer
Showing when a button has been pushed in Qt
I'm using Qt with C++, and I want to make a button that keeps looking pushed down after it is pushed and released. I'm currently making buttons on a QToolBar and doing something like toolBar->addAction (icon, tr("Text"));. This makes buttons on…

Gravity
- 2,696
- 1
- 20
- 29
1
vote
1 answer
How to force QMenuBar to have the same background color as QToolBar
My menu bar is placed inside my toolbar :) And I wan't both of them to have the same background color. In some color themes menubar background is different then in toolbars (lighter). How do I sync them and at the same time maintain current theme…
user666491
1
vote
1 answer
Keep QToolbar showing always all items
lets consider the following screenshot:
You can see that the top toolbar displays 2 rows; however to do so , in need to click on the >> at the top right (circled in red) and keep hovering hover the toolbar area, which can get a bit annoying.
Is…

jim jarnac
- 4,804
- 11
- 51
- 88
1
vote
1 answer
Show the status of icons in toolbar using qt in C++
I would like to show the status of icons in toolbar (whether they are activated). For example, When I click Bold, Italic or Underline icon in Microsoft word, it will be shaded, and switch to normal status when I click it again.
It's not necessary to…

Jiawei Lu
- 509
- 6
- 16