# HG changeset patch # User Teemu Piippo # Date 1529658781 -10800 # Node ID f7c53002a9902c4cb8a948eed11f1cefc4dfaf2f # Parent 503d4e7e27c9afdc54be2e87320ad86554a865f4 replaced uses of QList with QVector diff -r 503d4e7e27c9 -r f7c53002a990 src/basics.cpp --- a/src/basics.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/basics.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -44,7 +44,7 @@ } -QString joinStrings(const QList& values, QString delimeter) +QString joinStrings(const QVector& values, QString delimeter) { QStringList list; diff -r 503d4e7e27c9 -r f7c53002a990 src/basics.h --- a/src/basics.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/basics.h Fri Jun 22 12:13:01 2018 +0300 @@ -105,7 +105,7 @@ qreal determinant(const QMatrix4x4& matrix); QString formatFileSize(qint64 size); int gcd(int a, int b); -QString joinStrings(const QList& values, QString delimeter = " "); +QString joinStrings(const QVector& values, QString delimeter = " "); QString largeNumberRep(int number); double log1000(double x); double roundToDecimals(double value, int decimals); diff -r 503d4e7e27c9 -r f7c53002a990 src/dialogs/configdialog.cpp --- a/src/dialogs/configdialog.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/dialogs/configdialog.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -553,7 +553,7 @@ // // Finds the given list widget item in the list of widget items given. // -int ConfigDialog::getItemRow (QListWidgetItem* item, QList& haystack) +int ConfigDialog::getItemRow (QListWidgetItem* item, QVector& haystack) { int i = 0; @@ -582,9 +582,9 @@ // // Get the list of shortcuts selected // -QList ConfigDialog::getShortcutSelection() +QVector ConfigDialog::getShortcutSelection() { - QList out; + QVector out; for (QListWidgetItem* entry : ui.shortcutsList->selectedItems()) out << static_cast (entry); @@ -597,7 +597,7 @@ // void ConfigDialog::slot_setShortcut() { - QList sel = getShortcutSelection(); + QVector sel = getShortcutSelection(); if (countof(sel) < 1) return; @@ -613,7 +613,7 @@ // void ConfigDialog::slot_resetShortcut() { - QList sel = getShortcutSelection(); + QVector sel = getShortcutSelection(); for (ShortcutListItem* item : sel) { @@ -627,7 +627,7 @@ // void ConfigDialog::slot_clearShortcut() { - QList sel = getShortcutSelection(); + QVector sel = getShortcutSelection(); for (ShortcutListItem* item : sel) { diff -r 503d4e7e27c9 -r f7c53002a990 src/dialogs/configdialog.h --- a/src/dialogs/configdialog.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/dialogs/configdialog.h Fri Jun 22 12:13:01 2018 +0300 @@ -69,7 +69,7 @@ private: class Ui_ConfigDialog& ui; - QList quickColorItems; + QVector quickColorItems; QMap m_buttonColors; ExternalProgramWidgets m_externalProgramWidgets[NumExternalPrograms]; QVector quickColors; @@ -81,10 +81,10 @@ void setButtonBackground (QPushButton* button, QString value); void updateQuickColorList (ColorToolbarItem* sel = nullptr); void setShortcutText (ShortcutListItem* item); - int getItemRow (QListWidgetItem* item, QList& haystack); + int getItemRow (QListWidgetItem* item, QVector& haystack); QString quickColorString(); QListWidgetItem* getSelectedQuickColor(); - QList getShortcutSelection(); + QVector getShortcutSelection(); void initExtProgs(); void applyToWidgetOptions (std::function func); diff -r 503d4e7e27c9 -r f7c53002a990 src/editHistory.h --- a/src/editHistory.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/editHistory.h Fri Jun 22 12:13:01 2018 +0300 @@ -28,7 +28,7 @@ Q_OBJECT public: - using Changeset = QList; + using Changeset = QVector; EditHistory (LDDocument* document); ~EditHistory(); @@ -59,7 +59,7 @@ private: LDDocument* m_document; Changeset m_currentChangeset; - QList m_changesets; + QVector m_changesets; bool m_isIgnoring; int m_position; }; diff -r 503d4e7e27c9 -r f7c53002a990 src/editmodes/abstractEditMode.cpp --- a/src/editmodes/abstractEditMode.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/editmodes/abstractEditMode.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -117,7 +117,7 @@ Vertex cursorPosition = renderer()->currentCamera().convert2dTo3d(data.ev->pos()); QPoint cursorPosition2D = data.ev->pos(); const Axis depthAxis = renderer()->getRelativeZ(); - QList vertices = currentDocument()->inlineVertices().toList(); + QVector vertices = currentDocument()->inlineVertices().toList().toVector(); // Sort the vertices in order of distance to camera sort(vertices.begin(), vertices.end(), [&](const Vertex& a, const Vertex& b) -> bool diff -r 503d4e7e27c9 -r f7c53002a990 src/editmodes/abstractEditMode.h --- a/src/editmodes/abstractEditMode.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/editmodes/abstractEditMode.h Fri Jun 22 12:13:01 2018 +0300 @@ -79,7 +79,7 @@ DEFINE_CLASS (AbstractDrawMode, AbstractEditMode) protected: - QList m_drawedVerts; + QVector m_drawedVerts; QBrush m_polybrush; public: diff -r 503d4e7e27c9 -r f7c53002a990 src/editmodes/drawMode.cpp --- a/src/editmodes/drawMode.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/editmodes/drawMode.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -67,7 +67,7 @@ void DrawMode::endDraw() { // Clean the selection and create the object - QList& verts = m_drawedVerts; + QVector& verts = m_drawedVerts; Model model {m_documents}; switch (countof(verts)) diff -r 503d4e7e27c9 -r f7c53002a990 src/editmodes/linePathMode.cpp --- a/src/editmodes/linePathMode.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/editmodes/linePathMode.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -28,7 +28,7 @@ void LinePathMode::render (QPainter& painter) const { QVector points; - QList points3d = m_drawedVerts; + QVector points3d = m_drawedVerts; points3d << renderer()->position3D(); for (Vertex const& vrt : points3d) diff -r 503d4e7e27c9 -r f7c53002a990 src/generics/functions.h --- a/src/generics/functions.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/generics/functions.h Fri Jun 22 12:13:01 2018 +0300 @@ -100,9 +100,9 @@ } template -int countof(const QList& vector) +int countof(const QList& list) { - return vector.size(); + return list.size(); } template diff -r 503d4e7e27c9 -r f7c53002a990 src/mainwindow.h --- a/src/mainwindow.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/mainwindow.h Fri Jun 22 12:13:01 2018 +0300 @@ -125,8 +125,8 @@ PrimitiveManager* m_primitives; Grid* m_grid; QVector m_quickColors; - QList m_colorButtons; - QList m_recentFiles; + QVector m_colorButtons; + QVector m_recentFiles; class Ui_MainWindow& ui; QTabBar* m_tabs; bool m_updatingTabs; diff -r 503d4e7e27c9 -r f7c53002a990 src/primitives.h --- a/src/primitives.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/primitives.h Fri Jun 22 12:13:01 2018 +0300 @@ -90,8 +90,8 @@ PatternType type; }; - QList patterns; - QList primitives; + QVector patterns; + QVector primitives; explicit PrimitiveCategory (QString name, QObject* parent = 0); bool isValidToInclude(); @@ -129,7 +129,7 @@ QVariant headerData(int section, Qt::Orientation orientation, int role) const override; private: - QList m_categories; + QVector m_categories; PrimitiveScanner* m_activeScanner; QVector m_primitives; PrimitiveCategory* m_unmatched; diff -r 503d4e7e27c9 -r f7c53002a990 src/toolsets/algorithmtoolset.cpp --- a/src/toolsets/algorithmtoolset.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/toolsets/algorithmtoolset.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -289,7 +289,7 @@ const bool replaceAllValues= ui.any->isChecked(); const bool relative = ui.relative->isChecked(); - QList selectedAxes; + QVector selectedAxes; int count = 0; if (ui.x->isChecked()) @@ -333,7 +333,7 @@ if (not dialog.exec()) return; - QList sel; + QVector sel; if (ui.x->isChecked()) sel << X; if (ui.y->isChecked()) sel << Y; diff -r 503d4e7e27c9 -r f7c53002a990 src/toolsets/extprogramtoolset.cpp --- a/src/toolsets/extprogramtoolset.cpp Thu Jun 21 19:21:49 2018 +0300 +++ b/src/toolsets/extprogramtoolset.cpp Fri Jun 22 12:13:01 2018 +0300 @@ -285,7 +285,7 @@ // ============================================================================= // -void ExtProgramToolset::insertOutput (QString fname, bool replace, QList colorsToReplace) +void ExtProgramToolset::insertOutput (QString fname, bool replace, const QVector& colorsToReplace) { #ifdef DEBUG QFile::copy (fname, "./debug_lastOutput"); diff -r 503d4e7e27c9 -r f7c53002a990 src/toolsets/extprogramtoolset.h --- a/src/toolsets/extprogramtoolset.h Thu Jun 21 19:21:49 2018 +0300 +++ b/src/toolsets/extprogramtoolset.h Fri Jun 22 12:13:01 2018 +0300 @@ -62,7 +62,7 @@ bool makeTempFile (class QTemporaryFile& tmp, QString& fname); bool runExtProgram (ExtProgramType prog, QString argvstr); QString errorCodeString (ExtProgramType program, class QProcess& process); - void insertOutput (QString fname, bool replace, QList colorsToReplace); + void insertOutput (QString fname, bool replace, const QVector& colorsToReplace); void writeColorGroup (LDColor color, QString fname); void writeObjects (const QVector& objects, QFile& f); void writeObjects (const QVector& objects, QString fname);