Set focus on pagewidget's list when pref dialog is shown - to workaround weird OSX painting bug.

This commit is contained in:
craig.p.drummond
2014-10-03 15:49:36 +00:00
parent a65c5e9777
commit e60f4d5893
2 changed files with 8 additions and 0 deletions

View File

@@ -55,6 +55,7 @@
#endif
#include "scrobbling/scrobblingsettings.h"
#include <QDesktopWidget>
#include <QTimer>
static int iCount=0;
@@ -138,6 +139,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
#endif
setAttribute(Qt::WA_DeleteOnClose);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
// Under OSX if we dont set focus, then a weird blue line is shown to the right of the item list
// this line looks like part of a focus highlight. Odd, but setting focus works-around this...
QTimer::singleShot(0, pageWidget, SLOT(setFocus()));
}
PreferencesDialog::~PreferencesDialog()

View File

@@ -80,6 +80,9 @@ public:
PageWidgetItem * currentPage() const;
void setCurrentPage(PageWidgetItem *item);
public Q_SLOTS:
void setFocus();
Q_SIGNALS:
void currentPageChanged();