diff --git a/.gitignore b/.gitignore index 134aba9..fa3c896 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,11 @@ compile_commands.json CTestTestfile.cmake _deps +build/ +tools/ +sysroot/ + +qt_src/ + +.kate-swp + diff --git a/demo/untitled/main.cpp b/demo/untitled/main.cpp new file mode 100644 index 0000000..fd3e533 --- /dev/null +++ b/demo/untitled/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/demo/untitled/mainwindow.cpp b/demo/untitled/mainwindow.cpp new file mode 100644 index 0000000..5ceaab0 --- /dev/null +++ b/demo/untitled/mainwindow.cpp @@ -0,0 +1,24 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + + +static uint32_t counter = 0U; + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + + +void MainWindow::on_pushButton_clicked() +{ + counter++; + ui->lcdNumber->display(QString::number(counter)); +} diff --git a/demo/untitled/mainwindow.h b/demo/untitled/mainwindow.h new file mode 100644 index 0000000..9fb63ce --- /dev/null +++ b/demo/untitled/mainwindow.h @@ -0,0 +1,24 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private slots: + void on_pushButton_clicked(); + +private: + Ui::MainWindow *ui; +}; +#endif // MAINWINDOW_H diff --git a/demo/untitled/mainwindow.ui b/demo/untitled/mainwindow.ui new file mode 100644 index 0000000..041ec6e --- /dev/null +++ b/demo/untitled/mainwindow.ui @@ -0,0 +1,76 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 140 + 250 + 541 + 121 + + + + + Adobe Courier [Adobe] + + + + Hello World on a RasperryPi without Xserver! + + + + + + 80 + 30 + 301 + 161 + + + + false + + + + + + 440 + 140 + 141 + 51 + + + + Push ME!! + + + + + + + 0 + 0 + 800 + 23 + + + + + + + + diff --git a/demo/untitled/untitled.pro b/demo/untitled/untitled.pro new file mode 100644 index 0000000..7c8c3f7 --- /dev/null +++ b/demo/untitled/untitled.pro @@ -0,0 +1,27 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +FORMS += \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +#target.path = /home/pi/$${TARGET}/bin +#INSTALLS += target diff --git a/sysroot-relativelinks.py b/sysroot-relativelinks.py new file mode 100644 index 0000000..ac26367 --- /dev/null +++ b/sysroot-relativelinks.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +import sys +import os + +# Take a sysroot directory and turn all the abolute symlinks and turn them into +# relative ones such that the sysroot is usable within another system. + +if len(sys.argv) != 2: + print("Usage is " + sys.argv[0] + "") + sys.exit(1) + +topdir = sys.argv[1] +topdir = os.path.abspath(topdir) + +def handlelink(filep, subdir): + link = os.readlink(filep) + if link[0] != "/": + return + if link.startswith(topdir): + return + #print("Replacing %s with %s for %s" % (link, topdir+link, filep)) + print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep)) + os.unlink(filep) + os.symlink(os.path.relpath(topdir+link, subdir), filep) + +for subdir, dirs, files in os.walk(topdir): + for f in files: + filep = os.path.join(subdir, f) + if os.path.islink(filep): + #print("Considering %s" % filep) + handlelink(filep, subdir)