Revert "Fixup Mac toolbar for Qt5 and Qt4 build"

This reverts commit 20739ebb29.

Qt5 has a number of issues that cannot easily be resolved.

An alternative strategy of developing a custom cocoa control
for the mac toolbar is probably a better way forward.
This commit is contained in:
Mark Liversedge
2013-12-21 22:29:24 +00:00
parent 20739ebb29
commit 06242db844
4 changed files with 13 additions and 26 deletions

View File

@@ -107,7 +107,6 @@ MainWindow::MainWindow(const QDir &home)
* Bootstrap
*--------------------------------------------------------------------*/
setAttribute(Qt::WA_DeleteOnClose);
setAttribute(Qt::WA_MacBrushedMetal, true); // only works on Mac
mainwindows.append(this); // add us to the list of open windows
context = new Context(this);
context->athlete = new Athlete(context, home);
@@ -203,14 +202,8 @@ MainWindow::MainWindow(const QDir &home)
*--------------------------------------------------------------------*/
#ifdef Q_OS_MAC
setUnifiedTitleAndToolBarOnMac(true);
head = new QHBoxLayout;//addToolBar(context->athlete->cyclist);
head = addToolBar(context->athlete->cyclist);
head->setContentsMargins(0,0,0,0);
head->setSpacing(10);
// left spacer
QLabel *leftspacer = new QLabel("", this);
leftspacer->setFixedSize(8,25);
head->addWidget(leftspacer);
// widgets
QWidget *macAnalButtons = new QWidget(this);
@@ -313,11 +306,6 @@ MainWindow::MainWindow(const QDir &home)
connect(searchBox, SIGNAL(searchClear()), this, SLOT(clearFilter()));
#endif
// right spacer
QLabel *rightspacer = new QLabel("", this);
rightspacer->setFixedSize(8,25);
head->addWidget(rightspacer);
#endif
/*----------------------------------------------------------------------
@@ -479,8 +467,6 @@ MainWindow::MainWindow(const QDir &home)
#ifndef Q_OS_MAC // nonmac toolbar on main view -- its not
// unified with the title bar.
mainLayout->addWidget(head);
#else
mainLayout->addLayout(head);
#endif
mainLayout->addWidget(scopebar);
mainLayout->addWidget(tab);
@@ -684,7 +670,6 @@ MainWindow::showLowbar(bool want)
void
MainWindow::showToolbar(bool want)
{
#ifndef Q_OS_MAC
if (want) {
head->show();
scopebar->show();
@@ -693,7 +678,6 @@ MainWindow::showToolbar(bool want)
head->hide();
scopebar->hide();
}
#endif
}
void
@@ -825,7 +809,7 @@ MainWindow::resizeEvent(QResizeEvent*)
{
appsettings->setValue(GC_SETTINGS_MAIN_GEOM, geometry());
#ifdef Q_OS_MAC
//head->updateGeometry();
head->updateGeometry();
repaint();
#endif
}