Use good old C++ template instead of auto parameter which needs C++1y.
This commit is contained in:
parent
961eadada4
commit
ce407a5ec4
@ -25,6 +25,7 @@
|
||||
#include <QMouseEvent>
|
||||
#include <QStyleOption>
|
||||
|
||||
|
||||
static const int VIEW_HEIGHT = 30;
|
||||
static const int CORNER_RADIUS = 3;
|
||||
static const int EXTENDED_PARTITION_MARGIN = 4;
|
||||
@ -400,9 +401,10 @@ PartitionSplitterWidget::drawPartitions( QPainter* painter,
|
||||
}
|
||||
|
||||
|
||||
template < typename F >
|
||||
PartitionSplitterItem*
|
||||
PartitionSplitterWidget::_findItem( QList< PartitionSplitterItem >& items,
|
||||
auto condition )
|
||||
F condition )
|
||||
{
|
||||
for ( auto it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
struct PartitionSplitterItem
|
||||
{
|
||||
QString itemPath;
|
||||
@ -69,7 +70,9 @@ private:
|
||||
const QRect& rect_,
|
||||
int x );
|
||||
|
||||
PartitionSplitterItem* _findItem( QList< PartitionSplitterItem >& items, auto condition );
|
||||
template < typename F >
|
||||
PartitionSplitterItem* _findItem( QList< PartitionSplitterItem >& items,
|
||||
F condition );
|
||||
|
||||
QList< PartitionSplitterItem > m_items;
|
||||
QString m_itemToResizePath;
|
||||
|
Loading…
Reference in New Issue
Block a user