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?
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?