Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::FlagsIterator< QObjectType, FlagsType > Class Template Reference

Wrapper class to iterate over the flags set. More...

#include <qt_utils.h>

Classes

class  Iterator
 

Public Types

using EnumType = typename FlagsType::enum_type
 

Public Member Functions

 FlagsIterator (FlagsType flags)
 
Iterator begin () const
 
Iterator end () const
 

Detailed Description

template<typename QObjectType, typename FlagsType>
class sf::FlagsIterator< QObjectType, FlagsType >

Wrapper class to iterate over the flags set.

Template Parameters
QObjectTypeQObject derived class where the QFlags type is declared in.
FlagsTypeOptional since the argument in the constructor determines it. Usage is as follows:
// QFlags class.
QDialogButtonBox::StandardButtons sbs{QDialogButtonBox::Help | QDialogButtonBox::Abort};
// Iterate over the set flags using the iterator helper class.
for (auto sb: FlagsIterator<QDialogButtonBox>(sbs))
{
// Print the flag values in the output.
qDebug() << flagsMetaEnum<QDialogButtonBox, QDialogButtonBox::StandardButtons>().valueToKey(sb);
}
Wrapper class to iterate over the flags set.
Definition qt_utils.h:207

Member Typedef Documentation

◆ EnumType

template<typename QObjectType , typename FlagsType >
using sf::FlagsIterator< QObjectType, FlagsType >::EnumType = typename FlagsType::enum_type

Constructor & Destructor Documentation

◆ FlagsIterator()

template<typename QObjectType , typename FlagsType >
sf::FlagsIterator< QObjectType, FlagsType >::FlagsIterator ( FlagsType  flags)
inlineexplicit

Member Function Documentation

◆ begin()

template<typename QObjectType , typename FlagsType >
Iterator sf::FlagsIterator< QObjectType, FlagsType >::begin ( ) const
inline

◆ end()

template<typename QObjectType , typename FlagsType >
Iterator sf::FlagsIterator< QObjectType, FlagsType >::end ( ) const
inline

The documentation for this class was generated from the following file: