Skip to content

Commit

Permalink
Port additional code from develop to qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Nyaga committed Aug 5, 2024
1 parent fd6e522 commit 8d12583
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/app/seamly2d/core/application_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
#include <QMessageBox>
#include <QThread>
#include <QDateTime>
#include <QtXmlPatterns>
#include <QIcon>

QT_WARNING_PUSH
Expand Down
6 changes: 4 additions & 2 deletions src/app/seamly2d/dialogs/about2d_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <QGuiApplication>
#include <QMessageBox>
#include <QScreen>
#include <QSound>
#include <QSoundEffect>
#include <QSysInfo>
#include <QtDebug>
#include <QTextCodec>
Expand All @@ -75,8 +75,9 @@ About2DAppDialog::About2DAppDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::About2DAppDialog)
, m_isInitialized(false)
, m_beep(new QSound(qApp->Settings()->getSelectionSound()))
, m_beep(new QSoundEffect())
{
m_beep->setSource(QUrl(qApp->Settings()->getSelectionSound()));
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

Expand Down Expand Up @@ -182,6 +183,7 @@ About2DAppDialog::About2DAppDialog(QWidget *parent)
About2DAppDialog::~About2DAppDialog()
{
delete ui;
delete m_beep;
}

//---------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/app/seamly2d/dialogs/about2d_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#define ABOUT2D_DIALOG_H

#include <QDialog>
#include <QSound>
#include <QSoundEffect>

namespace Ui
{
Expand All @@ -78,7 +78,7 @@ public slots:
private:
Ui::About2DAppDialog *ui;
bool m_isInitialized;
QSound *m_beep;
QSoundEffect *m_beep;
Q_DISABLE_COPY(About2DAppDialog)

void copyToClipboard();
Expand Down
6 changes: 4 additions & 2 deletions src/app/seamly2d/dialogs/welcome_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <QPushButton>
#include <QShowEvent>
#include <QSound>
#include <QSoundEffect>


//---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,7 +68,9 @@ SeamlyWelcomeDialog::SeamlyWelcomeDialog(QWidget *parent)
connect(ui->selectionSound_ComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]()
{
m_selectionSoundChanged = true;
QSound::play("qrc:/sounds/" + ui->selectionSound_ComboBox->currentText() + ".wav");
QSoundEffect effect;
effect.setSource(QUrl("qrc:/sounds/" + ui->selectionSound_ComboBox->currentText() + ".wav"));
effect.play();
});

ui->doNotShow_CheckBox->setChecked(settings->getShowWelcome());
Expand Down
4 changes: 0 additions & 4 deletions src/app/seamly2d/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ int main(int argc, char *argv[])
// Check if the Qt version is at least 5.15.2
QT_REQUIRE_VERSION(argc, argv, "5.15.2");

// Register meta-type stream operators for VPieceNode
// This is needed to internally move a node inside a piece main path
qRegisterMetaTypeStreamOperators<VPieceNode>("VPieceNode");

//------------------------------------------------------------------------
// On macOS, correct WebView / QtQuick compositing and stacking requires running
// Qt in layer-backed mode, which again requires rendering on the Gui thread.
Expand Down
1 change: 1 addition & 0 deletions src/app/seamly2d/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6286,6 +6286,7 @@ void MainWindow::createActions()
{
About2DAppDialog *aboutDialog = new About2DAppDialog(this);
aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
aboutDialog->adjustSize(); // Silence warning "Cannot set geometry"
aboutDialog->show();
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/seamly2d/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class QToolButton;
class QDoubleSpinBox;
class QFontComboBox;

class DraftImage;
struct DraftImage;
class ImageItem;

class MouseCoordinates;
Expand Down
6 changes: 3 additions & 3 deletions src/libs/ifc/schema/multi_size_measurements/v0.4.5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()–+−=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()–+−=?:;\&quot;]){0,}$"/>
<xs:pattern value="([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\-()–+−=?:;'&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\-()–+−=?:;&quot;]){0,}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
Expand All @@ -55,12 +55,12 @@
</xs:simpleType>
<xs:simpleType name="formatVersion">
<xs:restriction base="xs:string">
<xs:pattern value="^(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))$"/>
<xs:pattern value="(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="psCode">
<xs:restriction base="xs:string">
<xs:pattern value="^^(([0-9]|[1-4][0-9]|5[0-4])|998)$"/>
<xs:pattern value="(([0-9]|[1-4][0-9]|5[0-4])|998)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="baseHeight">
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ifc/schema/pattern/v0.6.9.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;\&quot;]){0,}$"/>
<xs:pattern value="([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;'&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;&quot;]){0,}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
Expand All @@ -722,7 +722,7 @@
</xs:simpleType>
<xs:simpleType name="formatVersion">
<xs:restriction base="xs:string">
<xs:pattern value="^(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))$"/>
<xs:pattern value="(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="imageExtension">
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ifc/schema/pattern/v0.7.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;'\&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;\&quot;]){0,}$"/>
<xs:pattern value="([^\p{Nd}\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;'&quot;]){1,1}([^\p{Zs}*/&amp;|!&lt;&gt;^\()\-−+.,٫, ٬.’=?:;&quot;]){0,}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
Expand All @@ -723,7 +723,7 @@
</xs:simpleType>
<xs:simpleType name="formatVersion">
<xs:restriction base="xs:string">
<xs:pattern value="^(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))$"/>
<xs:pattern value="(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="imageExtension">
Expand Down
2 changes: 1 addition & 1 deletion src/libs/qmuparser/qmuparsertokenreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ bool QmuParserTokenReader::IsArgSep ( token_type &a_Tok )
QString szSep;
szSep.resize(2);
szSep[0] = m_cArgSep;
szSep[1] = 0;
szSep[1] = '\0';

if ( m_iSynFlags & noARG_SEP )
{
Expand Down
3 changes: 0 additions & 3 deletions src/libs/vpropertyexplorer/plugins/direction_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#include <QPen>
#include <QPixmap>
#include <QSize>
#include <QStaticStringData>
#include <QStringData>
#include <QStringDataPtr>
#include <QWidget>

#include "../ifc/ifcdef.h"
Expand Down

0 comments on commit 8d12583

Please sign in to comment.