mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-21 02:35:26 -04:00
Updated code to support newer Qt versions (#237)
This commit is contained in:
parent
d1e47539fc
commit
34c8ad8dcc
28 changed files with 358 additions and 94 deletions
|
@ -43,7 +43,7 @@ QVariant TreeModel::data(const UModelIndex &index, int role) const
|
|||
Qt::ItemFlags TreeModel::flags(const UModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
}
|
||||
|
@ -559,9 +559,14 @@ UModelIndex TreeModel::findByBase(UINT32 base) const
|
|||
goDeeper:
|
||||
int n = rowCount(parentIndex);
|
||||
for (int i = 0; i < n; i++) {
|
||||
#if ((QT_VERSION_MAJOR == 5) && (QT_VERSION_MINOR < 6)) || (QT_VERSION_MAJOR < 5)
|
||||
UModelIndex currentIndex = parentIndex.child(i, 0);
|
||||
#else
|
||||
UModelIndex currentIndex = parentIndex.model()->index(i, 0, parentIndex);
|
||||
#endif
|
||||
|
||||
UINT32 currentBase = this->base(currentIndex);
|
||||
UINT32 fullSize = header(currentIndex).size() + body(currentIndex).size() + tail(currentIndex).size();
|
||||
UINT32 fullSize = (UINT32)(header(currentIndex).size() + body(currentIndex).size() + tail(currentIndex).size());
|
||||
if ((compressed(currentIndex) == false || (compressed(currentIndex) == true && compressed(currentIndex.parent()) == false)) // Base is meaningful only for true uncompressed items
|
||||
&& currentBase <= base && base < currentBase + fullSize) { // Base must be in range [currentBase, currentBase + fullSize)
|
||||
// Found a better candidate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue