PDA

View Full Version : OS X QToolbar/QMacToolbar



Xanx
30th January 2016, 15:09
Hello! I'm trying to create an application that needs a toolbar. I'm using Mac and Qt 5.5. I used QToolbar and it looked different to traditional OS X toolbars. Later I found QtMacToolbar class and it works good. Unfortunately I see a problem with buttons. Here is a toolbar from the standard Pages.app:

11672

As you can see, each button has white rectangle around it. And here is a toolbar created with QMacToolbar:
11673
As you can see, there is no rectangle and icon looks awful.
Here is the code used to created it:



toolBar = new QMacToolBar(this);
QMacToolBarItem *toolBarItem =
toolBar->addItem(QIcon(":/undo.png"), "foo");
connect(toolBarItem, SIGNAL(activated()), this, SLOT(onBarClick()));

toolBar->attachToWindow(this->window()->windowHandle());


The rectangle seem to be a button, but how can I draw it?

bozz
4th September 2017, 19:42
Did you solve the problem in the end?