I'm trying to publish an app to the Ubuntu Store, however something is wrong with Qt Creator (or something else).
I used to be able to see this:
But now all I see is this:
As you can see (or read, if you're using a Reader with no images), the second image here isn't displaying things like the General tab which allows me to enter details such as Maintainer, Name, Description, Security Policy Groups - it doesn't have a Manifest tab AppArmor tab or Excludes tab either. The Create Package button is gone.
All I am left with is a blank screen with only 1 enabled button which reads 'Validate existing Click package', but when I click that (since there's nothing else I can do, it seems...), it takes me to my Projects directory where all my apps are listed. I select the app in question, and I can't click the open button on the dialog because there is no *.click file anywhere to be seen.
Have I done something wrong? Do you know what's going on here?
Also, I read that in order to publish to the store, we need to create "Click apps". I've searched the universe for this phrase and have come up empty handed. How do I create a "Click app"? I thought the app I was creating was a click app (I went to Qt Creator > Qt Quick Application > ...).
Links:
Tutorial for Publishing apps: http://developer.ubuntu.com/publish/apps/packaging-click-apps/
The reason is that you are using QtCreator from Qt Project proper instead of using the Ubuntu SDK, which delivers its own custom version of QtCreator.
In order to get things done for this, you will need to use the Ubuntu SDK. First you need to install it:
$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo apt-get update && sudo apt-get install ubuntu-sdk
This will also install the qtcreator-plugin-ubuntu
package, its own toolchain, etc. Then you can run it e.g. from the command line as follows:
$ ubuntu-sdk
You can also search in the Unity Dash Applications lens for “Ubuntu SDK” as the image shows below:
You can also just start typing the name in the search line as the images shows below:
Please make sure that you go to the following:
New Project > Ubuntu > Simple UI/Html/QML/etc
rather than e.g. what you tried based on your question:
New Project > Qt Quick Application
You may also with to set up the click targets and device kits part of which (Build and Run) is presented below inline:
First of all you need to read this well , luckily i have been developing ubuntu HTML5 apps recently , so i have been in your place before , you will be able to integrate your c++ code using the QML option ( as ubuntu developers have only 2 options either HTML5 or QML ).
Here is a sample project found on xda to create a simple calculator app ( pay attention how to include your cpp file ):
File Name:apcalc-qml.pro
QT += qml quick
# If your application uses the Qt Mobility libraries, uncomment the following
# lines and add the respective components to the MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=
#C++ source files
SOURCES += cpp/main.cpp\
cpp/applicationdata.cpp\
#C++ header files
HEADERS += cpp/applicationdata.h
#Path to the libraries...
INCLUDEPATH += $$PWD\
$$PWD/../../../../usr/lib
DEPENDPATH += $$PWD/../../../../usr/lib
#Path to "other files" in this case the QML-Files
OTHER_FILES += \
qml/main.qml\
qml/basicCalc/*.qml
File Name:main.cpp
#include <QtGui/QGuiApplication>
#include <QGuiApplication>
#include <QQuickView>
#include <QtQml/qqmlcontext.h>
#include <stdio.h>
#include "applicationdata.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
ApplicationData data;
//Resize Mode so the content of the QML file will scale to the window size
view.setResizeMode(QQuickView::SizeRootObjectToView);
//With this we can add the c++ Object to the QML file
view.rootContext()->setContextProperty("applicationData", &data);
//Resolve the relativ path to the absolute path (at runtime)
const QString qmlFilePath= QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), "qml/main.qml");
view.setSource(QUrl::fromLocalFile(qmlFilePath));
//For debugging we print out the location of the qml file
QByteArray ba = qmlFilePath.toLocal8Bit();
const char *str = ba.data();
printf("Qml File:%s\n",str);
//Not sure if this is nessesary, but on mobile devices the app should start in fullscreen mode
#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX)
view.showFullScreen();
#else
view.show();
#endif
return app.exec();
}
File Name:main.qml
import QtQuick 2.0
import Ubuntu.Components 0.1
import "basicCalc"
import QtQuick.Window 2.0
MainView {
//objectName for functional testing purposes (autopilot-qt5)
objectName: "mainView"
applicationName: "apcalc-qml"
automaticOrientation:true;
width: units.gu(60);
height: units.gu(100);
id:root
Tabs {
objectName: "Tabs"
ItemStyle.class: "new-tabs"
anchors.fill: parent
id:mainWindow;
Tab {
objectName: "Calculator"
title: "Calculator"
page:BasicCalc{
width: root.width;
height: root.height-root.header.height;
anchors.top: parent.top;
anchors.topMargin: root.header.height;
onToCalculateChanged: {
//access to the c++ Object
result=applicationData.calculate(toCalculate);
}
}
}
}
}
File Name:applicationdata.h
#ifndef APPLICATIONDATA_H
#define APPLICATIONDATA_H
#include <QObject>
class ApplicationData : public QObject
{
Q_OBJECT
public:
explicit ApplicationData(QObject *parent = 0);
Q_INVOKABLE QString calculate(QString) const;
signals:
public slots:
};
#endif // APPLICATIONDATA_H
File Name:applicationdata.cpp
#include "applicationdata.h"
ApplicationData::ApplicationData(QObject *parent) :
QObject(parent)
{
}
QString ApplicationData::calculate(QString command) const {
// Some Logic comes here
return command;
}
You can check the full tutorial here , though this app is intended to work for ubuntu touch but i believe that all QML projects follow the same procedure.
Publishing App :
First of all click App means a package , a one file click > installs your app AKA (Personal Package Archives (PPA) ) , in order to publish your app , you need to follow some procedure metioned in details here , eventhough the xda tutorial explains everything in a clear way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With