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 <QMouseEvent>
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
|
|
||||||
|
|
||||||
static const int VIEW_HEIGHT = 30;
|
static const int VIEW_HEIGHT = 30;
|
||||||
static const int CORNER_RADIUS = 3;
|
static const int CORNER_RADIUS = 3;
|
||||||
static const int EXTENDED_PARTITION_MARGIN = 4;
|
static const int EXTENDED_PARTITION_MARGIN = 4;
|
||||||
@ -400,9 +401,10 @@ PartitionSplitterWidget::drawPartitions( QPainter* painter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template < typename F >
|
||||||
PartitionSplitterItem*
|
PartitionSplitterItem*
|
||||||
PartitionSplitterWidget::_findItem( QList< PartitionSplitterItem >& items,
|
PartitionSplitterWidget::_findItem( QList< PartitionSplitterItem >& items,
|
||||||
auto condition )
|
F condition )
|
||||||
{
|
{
|
||||||
for ( auto it = items.begin(); it != items.end(); ++it)
|
for ( auto it = items.begin(); it != items.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
struct PartitionSplitterItem
|
struct PartitionSplitterItem
|
||||||
{
|
{
|
||||||
QString itemPath;
|
QString itemPath;
|
||||||
@ -69,7 +70,9 @@ private:
|
|||||||
const QRect& rect_,
|
const QRect& rect_,
|
||||||
int x );
|
int x );
|
||||||
|
|
||||||
PartitionSplitterItem* _findItem( QList< PartitionSplitterItem >& items, auto condition );
|
template < typename F >
|
||||||
|
PartitionSplitterItem* _findItem( QList< PartitionSplitterItem >& items,
|
||||||
|
F condition );
|
||||||
|
|
||||||
QList< PartitionSplitterItem > m_items;
|
QList< PartitionSplitterItem > m_items;
|
||||||
QString m_itemToResizePath;
|
QString m_itemToResizePath;
|
||||||
|
Loading…
Reference in New Issue
Block a user