hallo,
ich habe nun für qtcreator plus gcc/C++ auch in anderen Foren-Topics Installationstipps gefunden und konnte immerhin jetzt ganz super-simple GUI Widget Windows bauen
- u.a. auch eine zum an/ausschalten einer LED (GPIO23) per Window-Buttons und auslesen und anzeigen eines Switch-Pinstates in einem Label (GPIO24, input_pullup).
GPIO-Zugriff erfolgt über eingebundene wiringPi Libs!![]()
https://github.com/dsyleixa/Raspberr...er/qt/quit_btn
https://github.com/dsyleixa/Raspberr...nshot_app.jpeg
share and enjoy!
hier die fehlerbereinigte, vollständige Installationsanleitung für qtcreator inkl. designer, zusammengestellt aus verschiedenen Foren-Posts (für Raspbian Stretch, installiert auf Raspberry Pi 2 v1):
Code:Qt 5 Creator + Designer installieren sudo apt-get update sudo apt-get upgrade sudo reboot sudo apt-get autoremove sudo apt install qtcreator sudo apt install gnustep gnustep-devel clang-3.8-doc llvm-3.8-doc qtbase5-dev cmake kdelibs5-data subversion sudo apt install qt5-default #optional: sudo apt install qt5-qmltooling-plugins qt5-doc sudo apt install qtdeclarative5-dev sudo apt-get install libqt5multimedia5-plugins Open Qtcreator and go to Help > about plugins and and untick Remote Linux gpu memory: in /boot/config.txt: gpu_mem=128 # 128MB sudo reboot Open Qt creator, go to "Tools > Options > Build and Run" (Extras->Einstellungen->Erstellen) and go to Compilers. Add C: GCC, compiler path= /usr/bin/gcc C++: GCC, compiler Path=/usr/bin/g++ Then go to Kits and check whether Compiler, Debugger and Qt version are set; choose qt Kit (drop down menu) additionally. That's it , click Ok and create a new project The next bit was confusing in that clicking on "Design" down the left panel is impossible because it's greyed. Tools->Form Editor->Switch Source/Form solves that (i.e. shift-f4) with "mainwindow.cpp" open (aka "mainwindow.ui") and now you can create forms. Hin und her wechseln zwischen Editor und Designer mit Shift+F4 Im Designer Modus z.B. den auf die Form gezogenen Button mit rechts anklicken und "Slot anzeigen" wählen. Dann geht ein Fenster auf mit Auswahl Button-Event (leftClick, rightClick, ButtonUp,...). Ist einer gewählt kommt man in den Editor an die Stelle im Code an dem man auf die eigenen Methoden zeigen kann. ctrl-r to build and run (build menu). Hinzufügen von wiringPi GPIO functions: 1.) im .pro file die folgenden 3 Zeilen einfügen : INCLUDEPATH += /usr/local/include LIBS += -L"/usr/local/lib" LIBS += -lwiringPi 2.) Zusätzlich im sourcecode von mainwindow.cpp: #include <wiringPi.h>







Zitieren

Lesezeichen