mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -07:00
QT_VERSION <6.0
This commit is contained in:
parent
fa77b696d0
commit
e2c89c2a1a
37 changed files with 8 additions and 260 deletions
|
|
@ -25,22 +25,13 @@ bool CardInfoComparator::operator()(const CardInfoPtr &a, const CardInfoPtr &b)
|
|||
|
||||
bool CardInfoComparator::compareVariants(const QVariant &a, const QVariant &b) const
|
||||
{
|
||||
// Determine the type of QVariant based on Qt version
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
if (a.typeId() != b.typeId()) {
|
||||
#else
|
||||
if (a.type() != b.type()) {
|
||||
#endif
|
||||
// If they are not the same type, compare as strings
|
||||
return a.toString() < b.toString();
|
||||
}
|
||||
|
||||
// Perform type-specific comparison
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
switch (static_cast<int>(a.typeId())) {
|
||||
#else
|
||||
switch (static_cast<int>(a.type())) {
|
||||
#endif
|
||||
case static_cast<int>(QMetaType::Int):
|
||||
return a.toInt() < b.toInt();
|
||||
case static_cast<int>(QMetaType::Double):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue