Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
v 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EndrII committed Jun 17, 2018
1 parent d61fd89 commit 9256052
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 18 deletions.
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: qt-deployer
version: '1.0.3.core16.test2'
version: '1.0.4'
summary: Deploy Qt Project
description: |
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application. |
Expand Down
8 changes: 0 additions & 8 deletions source/CPP/buildmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ bool BuildManager::build(){
return false;
}

QProcess P;
P.start("ldd " + qmake, QProcess::ReadOnly);
P.waitForFinished();


tempLog = P.readAll();
emit logChanged(tempLog);

pQMake.setProgram(qmake);
pQMake.setWorkingDirectory(tempBuildFolder);
pQMake.setArguments(QStringList() << m_projectdir);
Expand Down
10 changes: 9 additions & 1 deletion source/CPP/cppmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void CppManager::setNotFoundLibs(const QStringList &notFoundLibs)
}

bool CppManager::isQtLib(const QString &lib) const{
return lib.indexOf(m_qtdir) == 0;
return lib.indexOf(m_qtdir) == 0 || lib.indexOf("libQt") > -1;
}

void CppManager::extractAllLibs(const QStringList &execfiles)
Expand All @@ -41,7 +41,15 @@ void CppManager::extractAllLibs(const QStringList &execfiles)

QStringList CppManager::extractLibsFromExecutable(const QString &execpath)
{
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LD_LIBRARY_PATH", m_qtdir + "/lib");
env.insert("QML_IMPORT_PATH", m_qtdir + "/qml");
env.insert("QML2_IMPORT_PATH", m_qtdir + "/qml");
env.insert("QT_PLUGIN_PATH", m_qtdir + "/plugins");
env.insert("QT_QPA_PLATFORM_PLUGIN_PATH", m_qtdir + "/plugins/platforms");

QProcess P;
P.setProcessEnvironment(env);
P.start("ldd " + execpath, QProcess::ReadOnly);

if (!P.waitForStarted()) return QStringList();
Expand Down
62 changes: 62 additions & 0 deletions source/QML/BuildPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import Qt.labs.settings 1.0

Page {
id: page
clip: false

header: Header {
message: qsTr("Qt Deployer")
}

property string outdir
property var cpplibs: []

Flickable {
id: flick

Connections {
target: BuildManager
onLogChanged:{
log.append(BuildManager.log)
}
}

Connections {
target: BuildManager
onFinished:{
swipeview.currentIndex = 2
CppManager.cppLibraries = cpplibs
}
}

anchors.fill: parent
contentWidth: log.paintedWidth
contentHeight: log.paintedHeight
clip: true

function ensureVisible(r)
{
if (contentX >= r.x)
contentX = r.x;
else if (contentX+width <= r.x+r.width)
contentX = r.x+r.width-width;
if (contentY >= r.y)
contentY = r.y;
else if (contentY+height <= r.y+r.height)
contentY = r.y+r.height-height;
}

TextEdit {
id: log
width: flick.width
focus: true
wrapMode: TextEdit.Wrap
onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
}
}

}
2 changes: 1 addition & 1 deletion source/QML/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TopBar {
font.pointSize: smallFont
anchors.right: home.left
onClicked: {
swipeview.currentIndex = 4
swipeview.currentIndex = 5
}
anchors.verticalCenter: parent.verticalCenter
}
Expand Down
2 changes: 1 addition & 1 deletion source/QML/PreparePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Page {

onClicked: {
pp.erase = erase.checked
swipeview.currentIndex = 2
swipeview.currentIndex = 3
CppManager.cppLibraries = cpplibs
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/QML/ProcessPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Page {
if (page.state == 0)
MainManager.start(erase)
else if (page.state == 2)
swipeview.currentIndex = 3
swipeview.currentIndex = 4
}
}
}
7 changes: 6 additions & 1 deletion source/QML/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ ApplicationWindow {
title: qsTr("Qt Deployer")

width: 600
height: sp.implicitHeight + 30

height: sp.implicitHeight + 300

property real smallFont: window.font.pointSize
property real mediumFont: window.font.pointSize + 2
Expand All @@ -29,6 +30,10 @@ ApplicationWindow {
id: sp
}

BuildPage {
id: rb
}

PreparePage {
id: prp
}
Expand Down
5 changes: 1 addition & 4 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ int main(int argc, char *argv[])
mainApp.show();
#endif


int returnCode = app->exec();
delete app;
return returnCode;
return app->exec();

}
1 change: 1 addition & 0 deletions source/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<file>QML/Header.qml</file>
<file>QML/About.qml</file>
<file>QML/Theme.js</file>
<file>QML/BuildPage.qml</file>
</qresource>
<qresource prefix="/languages">
<file alias="en">languages/en.qm</file>
Expand Down

0 comments on commit 9256052

Please sign in to comment.