Qt4 compatibility

This commit is contained in:
Nikolaj Schlej 2015-11-02 21:48:00 +01:00
parent 02d87ae550
commit 2443560c1d
4 changed files with 7 additions and 4 deletions

View File

@ -138,7 +138,7 @@ STATUS FfsFinder::findGuidPattern(const QModelIndex & index, const QByteArray &
if (hexPattern.count('.') == hexPattern.length())
return ERR_SUCCESS;
QRegExp regexp = QRegExp(QString(hexPattern), Qt::CaseInsensitive);
QRegExp regexp(QString(hexPattern), Qt::CaseInsensitive);
INT32 offset = regexp.indexIn(hexBody);
while (offset >= 0) {
if (offset % 2 == 0) {

View File

@ -18,6 +18,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <QByteArray>
#include <QString>
#include <QModelIndex>
#include <QPair>
#include <QRegExp>
#include <QVector>
#include "../common/basetypes.h"
#include "../common/treemodel.h"

View File

@ -899,7 +899,7 @@ void UEFITool::showFitTable()
// Set up the FIT table
ui->fitTableWidget->clear();
ui->fitTableWidget->setRowCount(fitTable.length());
ui->fitTableWidget->setRowCount(fitTable.size());
ui->fitTableWidget->setColumnCount(5);
ui->fitTableWidget->setHorizontalHeaderLabels(QStringList() << tr("Address") << tr("Size") << tr("Version") << tr("Type") << tr("Checksum"));
ui->fitTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
@ -908,7 +908,7 @@ void UEFITool::showFitTable()
ui->fitTableWidget->horizontalHeader()->setStretchLastSection(true);
// Add all data to the table widget
for (INT32 i = 0; i < fitTable.length(); i++) {
for (INT32 i = 0; i < fitTable.size(); i++) {
for (UINT8 j = 0; j < 5; j++) {
ui->fitTableWidget->setItem(i, j, new QTableWidgetItem(fitTable[i][j]));
}

View File

@ -1844,7 +1844,7 @@ STATUS FfsParser::parseGuidedSectionHeader(const QByteArray & section, const UIN
// Obtain header fields
const EFI_COMMON_SECTION_HEADER* sectionHeader = (const EFI_COMMON_SECTION_HEADER*)(section.constData());
const EFI_GUID_DEFINED_SECTION* guidDefinedSectionHeader = guidDefinedSectionHeader = (const EFI_GUID_DEFINED_SECTION*)sectionHeader;
const EFI_GUID_DEFINED_SECTION* guidDefinedSectionHeader = (const EFI_GUID_DEFINED_SECTION*)sectionHeader;
EFI_GUID guid = guidDefinedSectionHeader->SectionDefinitionGuid;
UINT16 dataOffset = guidDefinedSectionHeader->DataOffset;
UINT16 attributes = guidDefinedSectionHeader->Attributes;