[Qt-interest] special trick needed to get toolbars to show up?

kent williams nkwmailinglists at gmail.com
Tue Oct 26 21:01:36 CEST 2010


I've tried it.  It just makes the window fugly.  I've also tried
converting my icons from JPG to PNG. No go.  My anecdotal experience
is that toolbars just plain don't work on Mac OS X.

On Fri, Oct 22, 2010 at 1:44 AM, velociraptor Genjix
<aphidia at hotmail.com> wrote:
>
> have you tried window->setUnifiedTitleAndToolBarOnMac(true)?
>
> ----------------------------------------
>> Date: Thu, 21 Oct 2010 11:33:56 -0500
>> From: nkwmailinglists at gmail.com
>> To: qt-interest at trolltech.com
>> Subject: [Qt-interest] special trick needed to get toolbars to show up?
>>
>> I have this code in my main application window class (derived from QMainWindow):
>>
>>
>> QToolBar *toolbar(this->addToolBar(tr("View")));
>>
>> // add icons for different views.
>> static struct { const char *filename; const char *description;
>> const char *action;
>> } toolBarItems[] = {
>> { ":/images/axialicon.jpg", "Axial View", SLOT(axialview()) },
>> { ":/images/coronalicon.jpg", "Coronal View", SLOT(coronalview()) },
>> { ":/images/sagittalicon.jpg", "Sagittal view", SLOT(sagittalview()) },
>> { ":/images/3dicon.jpg", "3D View", SLOT(_3dview()) },
>> { ":/images/4dicon.jpg", "4-way View", SLOT(_4dview()) },
>> { 0, 0 },
>> };
>> for (unsigned i = 0; toolBarItems[i].filename != 0; i++)
>> {
>> this->m_ToolBarIcons[i] = new QIcon(toolBarItems[i].filename);
>> QAction *curAction = toolbar->addAction(*(this->m_ToolBarIcons[i]),
>> tr(toolBarItems[i].description));
>> connect(curAction, SIGNAL(triggered()), this, toolBarItems[i].action);
>> }
>>
>> I do my initial development using OS X. I'd never gotten my icons to
>> show up on the toolbar in OS X and figured I was doing something
>> wrong. I tabled this problem while I attacked higher-priority tasks.
>>
>> Last week, I got around to building my application on Linux, and on
>> Linux, the buttons show up and work properly.
>>
>> Does adding toolbars to a QMainWindow-derived class just not work on
>> OS X, or is there some sort of special dance step it takes to make it
>> work?
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list