-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor/qbytearray' into develop
- Loading branch information
Showing
13 changed files
with
161 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/**************************************************************************** | ||
** Copyright (c) 2024, Fougue Ltd. <https://www.fougue.pro> | ||
** All rights reserved. | ||
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt | ||
****************************************************************************/ | ||
|
||
#include "qtcore_utils.h" | ||
|
||
#include <algorithm> | ||
|
||
namespace Mayo::QtCoreUtils { | ||
|
||
std::vector<uint8_t> toStdByteArray(const QByteArray& bytes) | ||
{ | ||
std::vector<uint8_t> stdBytes; | ||
stdBytes.resize(bytes.size()); | ||
std::copy(bytes.cbegin(), bytes.cend(), stdBytes.begin()); | ||
return stdBytes; | ||
} | ||
|
||
Qt::CheckState toQtCheckState(Mayo::CheckState state) | ||
{ | ||
switch (state) { | ||
case CheckState::Off: return Qt::Unchecked; | ||
case CheckState::Partially: return Qt::PartiallyChecked; | ||
case CheckState::On: return Qt::Checked; | ||
} | ||
|
||
return Qt::Unchecked; | ||
} | ||
|
||
Mayo::CheckState toCheckState(Qt::CheckState state) | ||
{ | ||
switch (state) { | ||
case Qt::Unchecked: return CheckState::Off; | ||
case Qt::PartiallyChecked: return CheckState::Partially; | ||
case Qt::Checked: return CheckState::On; | ||
} | ||
|
||
return CheckState::Off; | ||
} | ||
|
||
} // namespace Mayo::QtCoreUtils |
Oops, something went wrong.