Questions tagged [qtoolbar]

The QToolBar class, part of the Qt framework, provides a movable panel that acts as a container for a set of controls.

Documentation can be found here (Qt4) and here (Qt5).

108 questions
1
vote
1 answer

How to set a center aligned QLabel to toolbar in Qt

I'm new to qt and exploring it .I want to have a text which is center aligned in my Mainwindow's toolbar.Below is my code inside my MainWindow constructor: QLabel* label=new QLabel("Hello World"); label->setAlignment(Qt::AlignHCenter); QHBoxLayout…
george
  • 339
  • 3
  • 12
1
vote
1 answer

How to change the color of a QAction that is in a toolbar?

I have a toolbar or there are several QActions. I would like to change the color of the QAction when it is selected so that the user can see the chosen action. The problem is that QAction is not a QWidget so we can not use stylesheet. Is there a way…
user8632386
1
vote
0 answers

One QMenu for all QToolButton

I've created QToolBar which contains few QToolButton. Each QToolButton has QMenu which is one for all. And this menu has few actions. Ugly example: QToolBar bar; QMenu menu; QAction action1; menu.addAction(action1); QAction…
1
vote
1 answer

Drag and drop from QToolBar to QGraphicsView is not working as expected

I am working on a project using Qt C++ . I have a QToolBar which contains some QButtons (read as QAction) and a QGraphicsView (the whole bottom part). It looks like this. Now, I want to drag a QButton (read as QAction) from the QToolBar into…
Surajeet Bharati
  • 1,363
  • 1
  • 18
  • 36
1
vote
0 answers

QToolButton Not Appearing/Overlapping

I am dynamically adding QToolButtons to my toolbar that inherits from QToolBar. I have a list of tuples (widget, callback) that contain what should be added to the toolbar. In theory, I want to group them by the requesting object and separate the…
GretaVan
  • 11
  • 1
1
vote
2 answers

Make QToolBar transparent

Is it possible to make a QToolBar widget background transparent? Behind it I have a QOpenGLWidget and I'd like to only see the toolbar's icons.
manatttta
  • 3,054
  • 4
  • 34
  • 72
1
vote
2 answers

Issue with Qt Toolbar extension button

I have to add a toolbar in Qt like the Windows file system explorer one under menu bar (I'm under Windows 7) , that means when the window width is reduced, icons which don't have enough place to be displayed are automatically hidden and put into a…
wperrad
  • 41
  • 4
1
vote
2 answers

How to get coordinates of QToolBar icons in PyQt4 application?

I'd like to know how to set position of QCalendarWidget just below the button of ToolBar. Currently, when user clicks a icon button inside red box, then the below Calendar() instance is created and the instance is shown in the middle of…
user1913171
  • 283
  • 4
  • 14
1
vote
1 answer

QToolbar in QMainWindow - signal toolbar about its position change

I would like to be able to detect any change in both the position and orientation of a toolbar which is part of a main window. The toolbar has a QPushButton called nodes_button and is part of a main window. I am using both the default QMainWindow…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
1
vote
0 answers

QToolbar OS X no hover effect

I have spotted a strange behavior of QToolbar on OS X. I have a toolbar with actions, each action has icon: That's good. Unfortunately, when mouse pointer is above an action the action is not highlighted: Tooltip successfully appears and when I…
Xanx
  • 545
  • 1
  • 5
  • 17
1
vote
2 answers

Iterate QAction items on a given QToolBar object in PyQt?

Using Python and PyQt4, given a GUI with any number of QToolBar objects and each toolbar contains any number of QAction objects. I can iterate the ui with the following code and find the toolbars: for name, obj in inspect.getmembers(ui): if…
panofish
  • 7,578
  • 13
  • 55
  • 96
1
vote
0 answers

Auto - adjust size of icons in QToolBar after hiding a QAction button

in my GUI program I have a QToolBar at the bottom of my mainwindow which contains a number of QAction buttons for opening various dialogs. Now, I have adjusted the size (i.e. width) of icons of the QToolBar through the QTCreator interface size…
1
vote
0 answers

How to make QToolBar to fit as much actions as possible

I have 2 QToolBar objects placed horizontaly one after another. The first one contains essential actions, the other - optional. I'd like the first toolbar to fit as much actions as possible, but can't get it - if the second bar contains too much,…
Mikhail Zimka
  • 694
  • 1
  • 9
  • 20
1
vote
2 answers

QToolButton should have another icon than the default action

When using a QToolButton and the setDefaultAction(myAction) method, it will get the default actions properties Reference: If a tool button has a default action, the action defines the button's properties like text, icon, tool tip, etc. So I try…
Sadık
  • 4,249
  • 7
  • 53
  • 89
1
vote
3 answers

QT - Resize QToolbar

i have some concatenate toolbar. For every toolbar i have call: toolbar->setGeometry(x,y,width,height) but i have no resize. I try to call toolbar->updateGeometry(); but nothing. My goal is to expand every toolbar with my size definition
user2543127
  • 385
  • 10
  • 21