Browse Source

Fix keyboard focus issues on Main window

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
6d31af676e
  1. 1
      src/mainwindow.cpp
  2. 8
      src/transferlistfilterswidget.h
  3. 3
      src/transferlistwidget.cpp

1
src/mainwindow.cpp

@ -164,7 +164,6 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -164,7 +164,6 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
// Transfer List tab
transferList = new TransferListWidget(hSplitter, this, QBtSession::instance());
transferList->setFocusPolicy(Qt::NoFocus);
properties = new PropertiesWidget(hSplitter, this, transferList);
transferListFilters = new TransferListFiltersWidget(vSplitter, transferList);
hSplitter->addWidget(transferList);

8
src/transferlistfilterswidget.h

@ -65,6 +65,9 @@ public: @@ -65,6 +65,9 @@ public:
setAcceptDrops(true);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
setStyleSheet("QListWidget { background: transparent; border: 0 }");
#if defined(Q_WS_MAC)
setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
}
// Redefine addItem() to make sure the list stays sorted
@ -162,6 +165,9 @@ public: @@ -162,6 +165,9 @@ public:
// Height is fixed (sizeHint().height() is used)
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setStyleSheet("QListWidget { background: transparent; border: 0 }");
#if defined(Q_WS_MAC)
setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
}
protected:
@ -203,14 +209,12 @@ public: @@ -203,14 +209,12 @@ public:
vLayout->addWidget(torrentsLabel);
statusFilters = new StatusFiltersWidget(this);
vLayout->addWidget(statusFilters);
statusFilters->setFocusPolicy(Qt::NoFocus);
QLabel *labelsLabel = new QLabel(tr("Labels"));
labelsLabel->setIndent(2);
labelsLabel->setFont(font);
vLayout->addWidget(labelsLabel);
labelFilters = new LabelFiltersList(this);
vLayout->addWidget(labelFilters);
labelFilters->setFocusPolicy(Qt::NoFocus);
setLayout(vLayout);
labelFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
statusFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

3
src/transferlistwidget.cpp

@ -107,6 +107,9 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, @@ -107,6 +107,9 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
setItemsExpandable(false);
setAutoScroll(true);
setDragDropMode(QAbstractItemView::DragOnly);
#if defined(Q_WS_MAC)
setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
// Default hidden columns
if (!column_loaded) {

Loading…
Cancel
Save