Skip to content

Commit

Permalink
Merge branch 'qt-migration'
Browse files Browse the repository at this point in the history
  • Loading branch information
epekkar committed Jan 12, 2023
2 parents 4d6fa51 + 8b35c66 commit c9b1261
Show file tree
Hide file tree
Showing 627 changed files with 9,046 additions and 28,928 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/check_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
- uses: actions/checkout@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 6.2.4
- name: Configure build
run: ./configure
- name: Build sources
Expand All @@ -29,7 +31,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.12.7
version: 6.2.4
- name: Build sources
run: |
$Env:PYTHON_DIR = $Env:RUNNER_TOOL_CACHE/Python/
Expand Down
5 changes: 2 additions & 3 deletions CreateHelp.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
REM
REM Bind HTML pages to context helps. If you modify help texts, you
REM don't need recompilation, if you run this script.
REM Joni-Matti Määttä, Aug 2012
REM Joni-Matti M��tt�, Aug 2012
REM
@echo off
qhelpgenerator Help/kactus2help.qhp -o Help/Kactus2Help.qch
qcollectiongenerator Help/kactus2help.qhcp -o Help/Kactus2Help.qhc
qhelpgenerator Help/kactus2help.qhcp -o Help/Kactus2Help.qhc
xcopy /Y Help\Kactus2Help.qhc executable\Help\
xcopy /Y Help\Kactus2Help.qch executable\Help\
xcopy /Y Help\Kactus2Help.qhc x64\executable\Help\
Expand Down
2 changes: 1 addition & 1 deletion Help/HelpSystem/ContextHelpBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: ContextHelpBrowser.cpp
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 6.8.2012
//
// Description:
Expand Down
2 changes: 1 addition & 1 deletion Help/HelpSystem/ContextHelpBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: ContextHelpBrowser.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 6.8.2012
//
// Description:
Expand Down
4 changes: 2 additions & 2 deletions Help/HelpSystem/HelpSearchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: HelpSearchWidget.cpp
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 8.8.2012
//
// Description:
Expand Down Expand Up @@ -41,6 +41,6 @@ HelpSearchWidget::~HelpSearchWidget()
//-----------------------------------------------------------------------------
void HelpSearchWidget::onSearch()
{
QList<QHelpSearchQuery> query = searchEngine_->queryWidget()->query();
auto query = searchEngine_->queryWidget()->searchInput();
searchEngine_->search(query);
}
2 changes: 1 addition & 1 deletion Help/HelpSystem/HelpSearchWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: HelpSearchWidget.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 8.8.2012
//
// Description:
Expand Down
4 changes: 2 additions & 2 deletions Help/HelpSystem/HelpWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: HelpWindow.cpp
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 7.8.2012
//
// Description:
Expand All @@ -27,7 +27,7 @@ HelpWindow::HelpWindow(QHelpEngine* engine, QWidget* parent): QMainWindow(parent
engine_(engine),
menu_(new QMenuBar(this)),
tocDock_(new QDockWidget(tr("Contents"), this)),
browser_(new ContextHelpBrowser(engine, "qthelp://com.tut.kactus2.2.0/doc", this))
browser_(new ContextHelpBrowser(engine, "qthelp://fi.tuni.kactus2/doc", this))
{
setWindowTitle(tr("Kactus2 Help"));
resize(800, 500);
Expand Down
2 changes: 1 addition & 1 deletion Help/HelpSystem/HelpWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// File: HelpWindow.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Määttä
// Author: Joni-Matti Maatta
// Date: 7.8.2012
//
// Description:
Expand Down
5 changes: 3 additions & 2 deletions Help/componenteditor/choices.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ <h2>Choices editor</h2>
containing component.
</p>
<p>
Each choice has a mandatory <b>name</b> and at least one <b>enumeration</b> must be specified.
Choices are identified by a mandatory <b>name</b> in the Choice list.
</p>
<p>
Each <b>enumeration</b> has a mandatory <b>value</b>, an optional <b>text</b> to display instead
Each choice must have at least one <b>enumeration</b> defined. An <b>enumeration</b> has
a mandatory <b>value</b>, an optional <b>text</b> to display instead
of the value and an optional <b>description</b>. When the value of e.g. a parameter refers to the
choice, the possible model parameter value is selected from the set of enumerations in that choice.
</p>
Expand Down
Binary file modified Help/images/choiceExample.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Help/kactus2help.qhcp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<QHelpCollectionProject version="1.0">
<docFiles>
<generate>
<file>
<input>kactus2help.qhp</input>
<output>Kactus2Help.qch</output>
</file>
</generate>
<register>
<file>Kactus2Help.qch</file>
</register>
Expand Down
2 changes: 1 addition & 1 deletion Help/kactus2help.qhp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
<namespace>com.tut.kactus2.2.0</namespace>
<namespace>fi.tuni.kactus2</namespace>
<virtualFolder>doc</virtualFolder>
<customFilter name="Kactus2 2.0">
<filterAttribute>kactus2</filterAttribute>
Expand Down
8 changes: 4 additions & 4 deletions IPXACTmodels/Component/AddressSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ range_(range),
width_(width),
segments_(new QList<QSharedPointer<Segment> > ()),
addressUnitBits_(),
localMemoryMap_(0),
localMemoryMap_(nullptr),
parameters_(new QList<QSharedPointer<Parameter> > ())
{

Expand Down Expand Up @@ -159,7 +159,7 @@ QSharedPointer<MemoryMapBase> AddressSpace::getLocalMemoryMap()
//-----------------------------------------------------------------------------
bool AddressSpace::hasLocalMemoryMap() const
{
return localMemoryMap_;
return localMemoryMap_.isNull() == false;
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -226,7 +226,7 @@ void AddressSpace::copySegments(const AddressSpace& other)
{
if (segment)
{
QSharedPointer<Segment> copy = QSharedPointer<Segment>(new Segment(*segment.data()));
auto copy = QSharedPointer<Segment>(new Segment(*segment.data()));
segments_->append(copy);
}
}
Expand All @@ -241,7 +241,7 @@ void AddressSpace::copyParameters(const AddressSpace& other)
{
if (parameter)
{
QSharedPointer<Parameter> copy = QSharedPointer<Parameter>(new Parameter(*parameter.data()));
auto copy = QSharedPointer<Parameter>(new Parameter(*parameter.data()));
parameters_->append(copy);
}
}
Expand Down
2 changes: 1 addition & 1 deletion IPXACTmodels/Component/validators/MemoryMapValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void MemoryMapValidator::componentChange(QSharedPointer<Component> newComponent)
{
if (availableRemapStates_)
{
availableRemapStates_->clear();
availableRemapStates_.clear();
}

if (newComponent)
Expand Down
139 changes: 71 additions & 68 deletions IPXACTmodels/Component/validators/MemoryReserve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,31 @@ void MemoryReserve::addArea(QString const& newId, qint64 newBegin, qint64 newEnd
//-----------------------------------------------------------------------------
bool MemoryReserve::hasOverlap()
{
if (!reservedArea_.isEmpty())
if (reservedArea_.isEmpty())
{
qSort(reservedArea_);
return false;
}

for (int areaIndex = 0; areaIndex < reservedArea_.size(); ++areaIndex)
{
MemoryArea const& area = reservedArea_.at(areaIndex);
std::sort(reservedArea_.begin(), reservedArea_.end());

for (int nextIndex = areaIndex+1; nextIndex < reservedArea_.size(); ++nextIndex)
{
MemoryArea const& nextArea = reservedArea_.at(nextIndex);
for (int areaIndex = 0; areaIndex < reservedArea_.size(); ++areaIndex)
{
MemoryArea const& area = reservedArea_.at(areaIndex);

if (nextArea.begin_ > area.end_)
{
break;
}
else
{
return true;
}
}
}
}
for (int nextIndex = areaIndex + 1; nextIndex < reservedArea_.size(); ++nextIndex)
{
MemoryArea const& nextArea = reservedArea_.at(nextIndex);

if (nextArea.begin_ > area.end_)
{
break;
}
else
{
return true;
}
}
}

return false;
}
Expand All @@ -80,7 +82,7 @@ bool MemoryReserve::hasIdDependantOverlap()
{
if (!reservedArea_.isEmpty())
{
qSort(reservedArea_);
std::sort(reservedArea_.begin(), reservedArea_.end());

for (int areaIndex = 0; areaIndex < reservedArea_.size(); ++areaIndex)
{
Expand Down Expand Up @@ -114,30 +116,32 @@ bool MemoryReserve::hasIdDependantOverlap()
void MemoryReserve::findErrorsInOverlap(QVector<QString>& errors, QString const& itemIdentifier,
QString const& context)
{
if (!reservedArea_.isEmpty())
if (reservedArea_.isEmpty())
{
qSort(reservedArea_);

for (int i = 0; i < reservedArea_.size(); ++i)
{
MemoryArea area = reservedArea_.at(i);

for (int j = i+1; j < reservedArea_.size(); ++j)
{
MemoryArea nextArea = reservedArea_.at(j);

if (nextArea.begin_ > area.end_)
{
break;
}
else
{
errors.append(QObject::tr("%1 %2 and %3 overlap within %4")
.arg(itemIdentifier).arg(area.id_).arg(nextArea.id_).arg(context));
}
}
}
}
return;
}

std::sort(reservedArea_.begin(), reservedArea_.end());

for (int i = 0; i < reservedArea_.size(); ++i)
{
MemoryArea area = reservedArea_.at(i);

for (int j = i + 1; j < reservedArea_.size(); ++j)
{
MemoryArea nextArea = reservedArea_.at(j);

if (nextArea.begin_ > area.end_)
{
break;
}
else
{
errors.append(QObject::tr("%1 %2 and %3 overlap within %4")
.arg(itemIdentifier).arg(area.id_).arg(nextArea.id_).arg(context));
}
}
}
}

//-----------------------------------------------------------------------------
Expand All @@ -146,28 +150,27 @@ void MemoryReserve::findErrorsInOverlap(QVector<QString>& errors, QString const&
void MemoryReserve::findErrorsInIdDependantOverlap(QVector<QString>& errors, QString const& itemIdentifier,
QString const& context)
{
if (!reservedArea_.isEmpty())
{
qSort(reservedArea_);

for (int i = 0; i < reservedArea_.size(); ++i)
{
MemoryArea const& area = reservedArea_.at(i);

for (int j = i+1; j < reservedArea_.size(); ++j)
{
MemoryArea const& nextArea = reservedArea_.at(j);

if (area.id_ == nextArea.id_)
{
if (nextArea.begin_ <= area.end_)
{
errors.append(QObject::tr("Multiple definitions of %1 %2 overlap within %3")
.arg(itemIdentifier).arg(area.id_).arg(context));
break;
}
}
}
}
}
}
if (reservedArea_.isEmpty())
{
return;
}

std::sort(reservedArea_.begin(), reservedArea_.end());

for (int i = 0; i < reservedArea_.size(); ++i)
{
MemoryArea const& area = reservedArea_.at(i);

for (int j = i + 1; j < reservedArea_.size(); ++j)
{
MemoryArea const& nextArea = reservedArea_.at(j);

if (area.id_ == nextArea.id_ && nextArea.begin_ <= area.end_)
{
errors.append(QObject::tr("Multiple definitions of %1 %2 overlap within %3")
.arg(itemIdentifier).arg(area.id_).arg(context));
break;
}
}
}
}
Loading

0 comments on commit c9b1261

Please sign in to comment.