diff options
| author | Mikko Syrjä <mikko@3d-system.fi> | 2019-03-28 01:29:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-28 01:29:51 +0200 |
| commit | 23e663f6a73ed16c88638944d5795d1d5cb37618 (patch) | |
| tree | 1b7b76cb41c52afe3aae7fda3f9b7702da8c077f | |
| parent | bd869b5f3b7a9568127c3447b1ca6e66823c5a9c (diff) | |
| parent | 184ba759a0cfb4f6da11270733bf6ec118df14be (diff) | |
| download | symedit-23e663f6a73ed16c88638944d5795d1d5cb37618.tar.gz symedit-23e663f6a73ed16c88638944d5795d1d5cb37618.zip | |
Merge pull request #1 from mikkosyrja/labs
Labs
| -rw-r--r-- | README.md | 33 | ||||
| -rw-r--r-- | main.cpp | 5 | ||||
| -rw-r--r-- | main.qml | 28 | ||||
| -rw-r--r-- | symedit.cpp | 2 | ||||
| -rw-r--r-- | symedit.pro | 2 |
5 files changed, 36 insertions, 34 deletions
@@ -4,22 +4,29 @@ Simple symbol editor for use with 3D-Win. https://gentleface.com/free_icon_set.html -krita: - icons: - 48x48 - transparent - line width: 6px - brush: basic-1 +krita icons: + 48x48 + transparent + line width: 6px + brush: basic-1 + +Windows icon creation with ImageMagick: + +convert icon16.png icon24.png icon32.png icon48.png icon256.png icon.ico + +Build html help in Windows: + +sphinx-build -M html . _build Windows deployment: C:\Users\Mikko\Code\Qt\5.12.2\msvc2017_64\bin\windeployqt.exe - --release - --qmldir ../../symedit - --no-translations - --no-compiler-runtime - --no-webkit2 - --no-angle - --no-opengl-sw + --debug --qmldir ../../symedit + --no-translations --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw + . + +C:\Users\Mikko\Code\Qt\5.12.2\msvc2017_64\bin\windeployqt.exe + --release --qmldir ../../symedit + --no-translations --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw . @@ -1,5 +1,5 @@ #include <QQmlContext> -#include <QGuiApplication> +#include <QtWidgets/QApplication> #include <QQmlApplicationEngine> #include <QCommandLineParser> #include <QSettings> @@ -16,12 +16,11 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationVersion("1.0"); QSettings::setDefaultFormat(QSettings::IniFormat); - QGuiApplication app(argc, argv); + QApplication app(argc, argv); // set base language translators QLocale locale; QTranslator backuptranslator, localetranslator, currenttranslator; -// if ( backuptranslator.load(":/locale/symedit.fi_FI.qm") ) if ( backuptranslator.load(":/locale/symedit.en_GB.qm") ) QCoreApplication::installTranslator(&backuptranslator); if ( localetranslator.load(locale, ":/locale/symedit.") ) @@ -1,7 +1,8 @@ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 -import QtQuick.Dialogs 1.2 + +import Qt.labs.platform 1.1 as Labs ApplicationWindow { @@ -309,35 +310,30 @@ ApplicationWindow } } - FileDialog + Labs.FileDialog { id: filedialog - title: (selectExisting ? qsTrId("id_dialog_open_file") : qsTrId("id_dialog_save_file")) + title: (fileMode === Labs.FileDialog.OpenFile ? qsTrId("id_dialog_open_file") : qsTrId("id_dialog_save_file")) nameFilters: [ qsTrId("id_dialog_symbol_files"), qsTrId("id_dialog_all_files") ] onAccepted: { - if ( selectExisting ) + if ( fileMode === Labs.FileDialog.OpenFile ) { - manager.open(fileUrl) + manager.open(file) symbol = manager.getSymbol(true) } else // save - manager.save(fileUrl) + manager.save(file) editor.update() } } - Dialog + Labs.MessageDialog { id: aboutdialog title: qsTrId("id_dialog_about") - Label - { - anchors.fill: parent - text: qsTrId("id_dialog_about_text") + "\n\n© 2019 Mikko Syrjä" - horizontalAlignment: Text.AlignHCenter - } - standardButtons: StandardButton.Ok + text: qsTrId("id_dialog_about_text") + "\n\n© 2019 Mikko Syrjä" + buttons: Labs.MessageDialog.Ok } onXChanged: { manager.setGeometry(Qt.point(x, y), Qt.size(width, height)) } @@ -393,7 +389,7 @@ ApplicationWindow function open() { - filedialog.selectExisting = true + filedialog.fileMode = Labs.FileDialog.OpenFile filedialog.folder = manager.getTextSetting("Directory") filedialog.open() } @@ -402,7 +398,7 @@ ApplicationWindow { if ( ask ) { - filedialog.selectExisting = false + filedialog.fileMode = Labs.FileDialog.SaveFile filedialog.folder = manager.getTextSetting("Directory") filedialog.open() } diff --git a/symedit.cpp b/symedit.cpp index 2cf2ad9..555a0da 100644 --- a/symedit.cpp +++ b/symedit.cpp @@ -502,7 +502,7 @@ void SymEditManager::help(QString topic) const { Q_UNUSED(topic); QString path = QCoreApplication::applicationDirPath(); - path.append("/help/").append(Language).append("/index.html"); + path.append("/help/").append(Language).append("/symedit/index.html"); QDesktopServices::openUrl(QUrl(path)); } diff --git a/symedit.pro b/symedit.pro index eb4f653..130fbff 100644 --- a/symedit.pro +++ b/symedit.pro @@ -1,4 +1,4 @@ -QT += quick +QT += quick widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use |
