I hope this topic hasn’t been covered elsewhere, I have been doing some digging but haven’t found anything which seems useful.
I have been trying to set up my Pi to allow me to run cross compiled applications from my desktop. I have been following the guide here [qt-project.org] but have been struggling on a couple of points.
1. It seems that the link for the compiler used in the guide is no longer functioning. I used the alternate compiler from here [github.com] and change all of the paths: “/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc” to “/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc” for the fixQualifiedLibraryPaths step and “~/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-” for the configure step. Does that look right?
2. As I have found in other posts, it doesn’t seem that the qtjsbackend patch is needed anymore correct?
When I run the ./configure command I get the following error (provided in context):
rm -f libqsqlite.so
/home/nathan/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf --sysroot=/mnt/rasp-pi-rootfs -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5pi/lib -shared -o libqsqlite.so .obj/release-shared/smain.o .obj/release-shared/qsql_sqlite.o .obj/release-shared/sqlite3.o .obj/release-shared/moc_qsql_sqlite_p.o -L/home/nathan/opt/qt5/qtbase/lib -lQt5Sql -lQt5Core -lpthread
mv -f libqsqlite.so ../../../../plugins/sqldrivers/
make[4]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins/sqldrivers/sqlite'
make[3]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins/sqldrivers'
make[2]: Leaving directory `/home/nathan/opt/qt5/qtbase/src/plugins'
make[1]: *** [sub-plugins-make_first] Error 2
make[1]: Leaving directory `/home/nathan/opt/qt5/qtbase/src'
make: *** [sub-src-make_first] Error 2
I tried adding a -no-pch to the end of the ./configure command but didn’t get any farther. I can run the make -j 4 and sudo make install commands but when it comes time to run /usr/local/qt5pi/bin/qmake it isn’t there. I am not terribly experienced in Linux so I have hit a brick wall with these errors.
Any help to resolve this is appreciated!
Nate
↧
Cross Compilation errors
↧
Composite Display Resolution
Hi All,
I am having difficulty with the resolution in my QML application when I deploy to the Pi. I have set the /boot/config.txt to the resolution of my screen (480×272) but there is always a white boarder around the application and I can’t remove it. I had this same issue when I was outputting to a 1280×1024 monitor through the Pi but figured it was due to the resolution being so much higher than my graphics size. Has anyone else experienced something like this? Is there another configuration setting I have missed in Qt or is it something on the Pi?
I have added:
export QT_QPA_EGLFS_PHYSICAL_WIDTH=72
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=53
export QT_QPA_EGLFS_DEPTH=32
to my ~/.bashrc file on the pi but this only seems to affect my font size.
Thanks,
Nathan
↧
↧
Installing qextserialport on RPI under QT5
Hi,
I have sucessfully compiled a QT5.0.1 project on my RPI which works fine and now wish to add a USB serial port. Under Windows this works fine. I have cloned qextserialport and installed the project as a shared library.
Attaching a USB hub, lsusb shows all the device ID’s as expected.
The COM port I need is attached to ttyUSB0 as shown on boot up.
The examples make and the uartassistant shows ttyUSBO as the only available port.
Following the instructions I have added the line to my .pro file:
CONFIG += extserialport // should this be qextserialport?
In my code I have added
#include “//src/qextserialport.h”
and
QextSerialPort * port = new QextSerialPort()
I have uncommented the line
linux*:CONFIG += qesp_linux_udev
However, after qmake, make returns the error message:
cannot find -lQt5ExtSerialPort
I do not know where the reference to theQt5ExtSerialPort is from? Can anyone help please?
Thanks
↧
cross/remote debugging
hi
I have started a little project to control a terrarium with the raspberry pi.
I have installed Qt 5.2.0 with QT Creator 3.0.0 on Ubuntu 12.04.4 LTS (64Bit).
The same is on my RPI with raspian.
when i try to start the application without any parameters, the following messages would be shown:
QSocketNotifier: Can only be used with threads started with QThread
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGLFS: Unable to query screen depth, defaulting to 32.
EGLFS: To override, set QT_QPA_EGLFS_DEPTH.
This plugin does not support propagateSizeHints()
When i start the Application with -platform xcb it will run fine, but i receive 2 messages:
Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
When i try to debug, i can’t see any values from the variables but the breakpoints are working.
when i just start the program with the debugger , also with “-platform xcb” i get some strange issues.
the debugger ist located here:
/home/*****/src/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gdb
i also got this “cannot find egl error”. The Program starts and breakpoints are hit, but i cannot see any values of the variables.
And it also looks like my programm cannot acces the file system if i start it from the debugger.
Im a linux newbie, i would really appreciated if someone can help me.
↧
Cross Compile Issue
All,
I am trying to cross compile Qt 5 for the Rpi and have followed the “Beginners Guide to Cross Compile Qt5 on a RaspberryPi” posted here, with the execption of also having installed the packages in “Native Build of Qt 5 on a Raspberry Pi” that were listed as “needed for compiling.” I can get it to configure fine, but when I try to make qtbase I get the following output:
qxcbconnection.cpp: In constructor ‘QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, const char*)’:
qxcbconnection.cpp:280:45: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
In file included from qxcbconnection.cpp:72:0:
/mnt/rasp-pi-rootfs/usr/include/X11/Xlib-xcb.h:13:19: error: initializing argument 1 of ‘xcb_connection_t* XGetXCBConnection(Display*)’ [-fpermissive]
qxcbconnection.cpp:281:51: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
In file included from qxcbconnection.cpp:72:0:
/mnt/rasp-pi-rootfs/usr/include/X11/Xlib-xcb.h:16:6: error: initializing argument 1 of ‘void XSetEventQueueOwner(Display*, XEventQueueOwner)’ [-fpermissive]
/home/charles/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_XKB -DQ_FONTCONFIGDATABASE -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_PLATFORMSUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/devices/linux-rasp-pi-g++ -I. -I../../../../include -I../../../../include/QtPlatformSupport -I../../../../include/QtPlatformSupport/5.2.2 -I../../../../include/QtPlatformSupport/5.2.2/QtPlatformSupport -I../../../../include/QtGui/5.2.2 -I../../../../include/QtGui/5.2.2/QtGui -I../../../../include/QtCore/5.2.2 -I../../../../include/QtCore/5.2.2/QtCore -I../../../../include/QtGui -I../../../../include/QtCore -I.moc -I/mnt/rasp-pi-rootfs/opt/vc/include -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vcos/pthreads -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/linux -o .obj/qlinuxfbscreen.o qlinuxfbscreen.cpp
make[5]: *** [.obj/qxcbconnection.o] Error 1
make[5]: Leaving directory `/home/charles/opt/qt5/qtbase/src/plugins/platforms/xcb'
make[4]: *** [sub-xcb-plugin-pro-make_first-ordered] Error 2
make[4]: Leaving directory `/home/charles/opt/qt5/qtbase/src/plugins/platforms/xcb'
make[3]: *** [sub-xcb-make_first] Error 2
make[3]: *** Waiting for unfinished jobs....
This had worked fine in December, but due to some hardware problems I am forced to redo it.
Any assistance is appricated.
Charles
↧
↧
Problem with eglfs
Hello,
I have strange issue with eglfs plugin. I’m using fully upgraded Arch Linux ARM + Qt 5.2. QmlViewer works flawlessly using eglfs, but all other programs (qmlscene, examples, simple hello world program) are starting without visible windows. It seems that shader used in eglfs for rendering can’t be created for some reason, for all programs except qmlviewer.
I have tried different memory splits and video settings, but results are always same. This is how console output looks like when I run qmlscene:
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGLFS: Unable to query screen depth, defaulting to 32.
EGLFS: To override, set QT_QPA_EGLFS_DEPTH.
This plugin does not support propagateSizeHints()
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShaderProgram::attributeLocation( vertexCoordEntry ): shader program is not linked
QOpenGLShaderProgram::attributeLocation( textureCoordEntry ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( isRaster ): shader program is not linked
Does anyone know how to solve this problem?
↧
Qt 5.2.2 + Raspberry Pi (Raspbian Wheezy). Cross-Compilation.
Good evening, everyone. I am sorry, this text was translated by google and promt, because I russian-speaking man. Please, help me fill some of the gaps in knowledge concerning a subject of this topic. Not so long ago I began to study raspberry and questions have been raised, the solution of which takes a lot of time due to poor knowledge of the area open source projects in particular Linux. A time every day less , because I am a student , and each day brings me closer to the session. To an essence. I found a lot of documentation, how build Qt from source codes for cross-compilation of programs on Raspberry Pi in particular given on this site. And practically everywhere write, that raspbian image necessary mounted to a /mnt/rasp-pi-rootfs. In general all anything, but after build Qt, installation and all other, application in the “Creator” successfully building, but the app does not start, and in an output is written “Not clearly what to launch”. Just specify that setting Creator was performed competently fully in compliance with instruction. Is that here except this: “Then go to the “Rasperry Pi” kit tab-> System Environment and add LD_LIBRARY_PATH which is set to /usr/local/qt5pi/lib”. How many have not tried, I did not understand what the “Rasperry Pi” kit tab and where it is. In general, in fact here is the first question. In the settings I configured the connection to the board, and as I understand it, in the process of launching Creator must pour the executable file (with all the necessary libraries?) and perform the launch. However, since the creator writes “Not clearly what to launch”, he doesn’t do it. Why? And if it’s not so, what configure this connection? Generally, “one write two in mind”, we go further. Copy the executable file on the single board computer and try to run, we get the message, that libraries missing in system. It should be expected, copy the libraries in the directory with the executable file and we get the same error, strange in Windows it usually worked… In general I was plagued by the following questions: what to do with libraries? May need to copy them to a specific folder on the raspberry and add the path to it in the variable path. Or to connect a flash card raspberry to the computer and on an assembly step somehow to specify a way for installation of libraries? How to make so that not simply worked, but also was the correct, adequate decision? And it is possible to set the launch from Creator?
UPD: After build and install Qt for cross-compile, in /mnt/rasp-pi-rootfs/usr/local created folder qt5pi and Qt5.2.2. It is normal? Maybe qt5pi folder need to move on raspi? Also, on my computer in /usr/local created folder Qt5.2.2, but there are no libraries.
↧
QT5.2.x crosscompile general advice
Hi everyone,
i’m trying to cross-compile QT5.2 for my raspberry, like most of you do ;-)
I need some general advice.
What I’ve done:
I already have raspbian configured and running and don’t want to change it anymore (if possible)
I’m following the steps described in http://qt-project.org/wiki/RaspberryPi_Beginners_guide
Question:
What do i have to do differently so that i can:
crosscompile and install QT on my host linux, e.g. to one folder. The beginners guide somehow merges the compiled QT file into a wheezy image. But i want to keep my existing raspbian system
copy that folder to my raspberry and run a qt-programm
My System:
raspberry: NOOBS – raspbian image
Host: Linux Debian (downloaded the newest version via net-installer; i don’t know which version exactly)
Thanks a lot for your help,
ben
↧
QT5.x - which SRC / wheezy combination do you use?
Hi everyone,
i’m still struggling with crosscompiling QT5.
I tried several tutorials and downloads of the source / images files, there is always some issue at the end.
At the moment i cannot get rid of an error when compiling qtbase.
I also tried a patch from last year, same result.
What i tried:
Tutorial: http://qt-project.org/wiki/RaspberryPi_Beginners_guide
Install Script: http://gitorious.org/bakeqtpi
This patch: https://bugreports.qt-project.org/browse/QTBUG-34065
…
Please !!!
Can you tell me exactly which code versions you are using. I want to be sure, that a certain code combination does work properly together (wheezy, toolchain, qt-src, patches)
If that still doesn’t work, can anybody provide me a working image of his/her sdcard?
I really appreciate any help, since it starts getting frustrating rigth now.
Thanks a lot,
Ben
↧
↧
Using WiringPi for Cross Compliation
All,
Has anyone been able to use the wiringPi.h library in their Qt project without having to compile the project on the Raspberry PI itself (ie, cross compiling the program)? I have the libraries installed on the Raspberry Pi, and I have an image of the Raspberry Pi system with wiringPi.h mounted on my system, but when I compile I get the message:
wiringPi.h: No such file or directory
Any assistance is greatly appreciated.
↧
Qt platform plugin "xcb" error
Hi, I get this error when I execute program: This application failed to start because it could not find or load the Qt platform plugin “xcb”.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, wayland-brcm, wayland-egl, wayland, xcb.
Reinstalling the application may fix this problem.
Aborted
How to fix this issue? I have everything in folder what that program needed.
Here is package: https://onedrive.live.com/redir?resid=AB8B24AE3D535ECC!2470
Regards, Niko H.
↧
how to compile code separatly for linux and RaspberryPi with macros?
I know we can use macros like Q_OS_WIN32 and Q_OS_LINUX to build os specific code.
how to build seperate code blocks for linux and RaspberryPi?
↧
QT 5.0 raspberry error with QSerialPort
Hi All,
I have this code for manage a fingerprint reader :
secugen.h
class SecugenSda04 : public IFingerprint
{
Q_OBJECT
Q_INTERFACES(IFingerprint)
Q_ENUMS(ErrorReader)
public:
SecugenSda04(const QString &serialPort);
void setSerialPort(qint32 baudRate);
enum ErrorReader{
_NONE = 0x00, // Performs the command received from main controller or host (no error)
};
private:
QSerialPort serial;
QByteArray response;
QString serialPort;
QTimer *timer;
QString characterToHexQString(const char character);
std::vector<int> intToHex(int id);
void executeCommand(const char cmd, DataContainer &dataContainer, const char param1Hight = 0x00, const char param1Low = 0x00, const char param2Hight = 0x00, const char param2Low = 0x00,const char lwExtraDataHight = 0x00,const char lwExtraDataLow = 0x00,const char hwExtraDataHight = 0x00,const char hwExtraDataLow = 0x00, quint32 baudRate = QSerialPort::Baud9600, QByteArray data= QByteArray());
//Test avec QextSerialPort
//QextSerialPort *port;
private slots:
void checkFingerTouch();
public slots:
void waitForFinger();
signals:
void resultReady(DataContainer *data);
void fingerDetected();
};
Constructor with some command of test
SecugenSda04::SecugenSda04(const QString &serialPort): IFingerprint() {
serial.setPortName(serialPort);
// This command work and show the firmware version
executeCommand(0x05,dataContainer);
// This command change the com speed
DataContainer dataContainer;
executeCommand(0x21,dataContainer,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,QSerialPort::Baud115200);
[...]
void SecugenSda04::executeCommand(const char cmd, DataContainer &dataContainer, const char param1Hight, const char param1Low, const char param2Hight, const char param2Low ,const char lwExtraDataHight,const char lwExtraDataLow,const char hwExtraDataHight,const char hwExtraDataLow, quint32 baudRate, QByteArray data)
{
setSerialPort(baudRate);
const char channel = 0x00;
const char stub = 0x00;
int cks = ((int)cmd + (int)param1Hight + (int)param1Low + (int)param2Hight + (int)param2Low +(int)lwExtraDataLow + (int)lwExtraDataHight + (int)hwExtraDataLow + (int)hwExtraDataHight) % 256;
const char checkSum[] = { cks };
serial.write(&channel,1); // channel 1 byte (alway the same)
serial.write(&cmd,1); // command 1 byte
serial.write(&param1Low,1); // param1 2 bytes (byte low)
serial.write(&param1Hight,1); // param1 2 bytes (byte hight)
serial.write(&param2Low,1); // param2 2 bytes (byte low)
serial.write(&param2Hight,1); // param2 2 bytes (byte hight)
serial.write(&lwExtraDataLow,1); // lwExtraData 2 bytes (byte low)
serial.write(&lwExtraDataHight,1); // lwExtraData 2 bytes (byte hight)
serial.write(&hwExtraDataLow,1); // hwExtraData 2 bytes (byte low)
serial.write(&hwExtraDataHight,1); // hwExtraData 2 bytes (byte hight)
serial.write(&stub,1); // ErrorCode 1 byte
serial.write(&checkSum[0],1); // Checksum 1 byte
if(!data.isEmpty())
serial.write(data.constData(),data.size());
if (serial.waitForBytesWritten(1000)) {
qDebug() << "Serial data written on port" << serial.portName();
QByteArray ack;
while(ack.size() < 12)
if(serial.waitForReadyRead(100))
ack += serial.readAll();
dataContainer.setAck(ack);
if(dataContainer.error() == SecugenSda04::_NONE && dataContainer.packetSize() > 0)
{
qDebug() << "get the data packet on the serial port ...";
QByteArray data = ack.right(ack.size() - 12);
while(data.size() < dataContainer.packetSize())
if(serial.waitForReadyRead(100))
data += serial.readAll();
if (data.size() > 0)
dataContainer.setPacket(data);
}
}
}
Initalise port like this :
void SecugenSda04::setSerialPort(qint32 baudRate)
{
serial.setPortName(serialPort);
if(!serial.isOpen())
{
if (!serial.open(QIODevice::ReadWrite)) {
qCritical() << "error open : " << serial.errorString() << "(code : " << serial.error() << ")";
}
}
if (!serial.setBaudRate(baudRate)) {
qCritical() << "Can't set baud rate " << baudRate << " baud to port " << serialPort << ", error code " << serial.error();
}
if (!serial.setDataBits(QSerialPort::Data8)) {
qCritical() << "Can't set 8 data bits to port " << serialPort << ", error code " << serial.error();
}
if (!serial.setParity(QSerialPort::NoParity)) {
qCritical() << "Can't set no patity to port " << serialPort << ", error code " << serial.error();
}
if (!serial.setStopBits(QSerialPort::OneStop)) {
qCritical() << "Can't set 1 stop bit to port " << serialPort << ", error code " << serial.error();
}
if (!serial.setFlowControl(QSerialPort::NoFlowControl)) {
qCritical() << "Can't set no flow control to port " << serialPort << ", error code " << serial.error();
}
}
problem : When i change the variable “quint32 baudRate” from QSerialPort::Baud9600 to QSerialPort::Baud115200 the fingerprint reader is blocked on reading … i known the serial port is not closed in this version but it’s the same thing with a serial.close()
I have try a LOT OF THING :
- close the port and reopen with other baud value – update to the last QSerialPort – reset the port – clear the port – try to another baud rate (work only in 9600)
sorry for this code i´m a noob in C++, if you have som advise for a new code, or something to help me …
the same command 0×21 work like a charm on windows to change the com speed
↧
↧
Developing App for Raspberry & Raspbian
Hi guys,
Even though I have already read many posts and info about Raspberry and Raspbian, actually I still didn’t understand what I haveto do to develop an App for this OS. The best thing for me will be to develop and compile the App on my Ubuntu 10 system and then copy the App I have done on my Raspberry device.
I tried on doing it but it doesn’t work as well.
Therefore I start wondering: what libraries should I have to install onto my Raspberry device to be able to launch an App which I have done and compiled on Ubuntu 10 using Qt Creator 4.8?
Does I have to upgrade my Qt Creator to Qt 5? After I have done the migration, will I have the same problems?
Thank you in advance.
↧
Installing QtCreator 3.0.1
Hi, I get error when I run command qmake -r
Reading /home/pi/qt-creator-opensource-src-3.0.1/src/src.pro
Reading /home/pi/qt-creator-opensource-src-3.0.1/src/libs/libs.pro
Reading /home/pi/qt-creator-opensource-src-3.0.1/src/libs/aggregation/aggregation.pro
Reading /home/pi/qt-creator-opensource-src-3.0.1/src/libs/extensionsystem/extensionsystem.pro
Reading /home/pi/qt-creator-opensource-src-3.0.1/src/libs/utils/utils.pro
Project ERROR: Unknown module(s) in QT: script
I have installed qtscript, but i get this error. any ideas how to fix this?
Regards, Niko H.
↧
Qt Cross-Compiling configuration for Rpi Application
HI guys,
I have got Qt5 installed using the qt.run file, which I had downloaded from the Qt Project website (Qt was installed properly and I can work on my desktop), on my Ubuntu 12.04. I’ve followed this guide [qt-project.org] to be able to cross-compile my apps. What I’m able to do is to configure the Qt Version for the Rpi. I can’t configure my Qt Creator, because I don’t know where the qmake for rpi is installed even thouhgt I have installed the linario gcc. What am I missing? Is it mandatory that I must to compile qt5 from the source files? Where can I get the qmake files for rpi?
Moreover I have read these documents:
document_1 [ics.com] —> I can’t mount the Raspbian SD image file on the Desktop PC as described on the document, using the command *$sudo mount -o loop,offset=62914560 \
raspberry-working-image.img /mnt/raspberry-rootfs*
document_2 [ics.com]
the same problem, I was unable to mount the rpi by the remote command sudo mount x.x.x.x:/ /mnt/rpi-rootfs but I think this is due to the fact I’m not using the NTFS file system and I don’t have sharing folder.
Furthermore, I have read a lot of documentation about how to set a toolchain to be able to build application for rpi using Qt5. Nothing has work well, there where everytime something that doesn’t do what expected.
Now I need a big help…
Thank you in advance.
↧
Question about Bluetooth Scanner Example
I apt-get install bluetooth bluez-utils libbluetooth-dev.
Then reference http://qt-project.org/wiki/Native_Build_of_Qt5_on_a_Raspberry_Pi
install Qt 5.2.1
When I try Bluetooth Scanner Example.
Discoverable(checkBox) property always disabled.
Information:
Raspberry Pi(2014-01-07-wheezy-raspbian.zip)
Azio BTD-V201 USB Micro Bluetooth Adapter
Any help would be appreciated!
sorry for my english.
↧
↧
wallpaper Qt and Pi
Hi Qties,
I’ve made a wall paper featuring Qt and the Raspberry Pi and I want to share it with all of you.
Has anyone ever asked you for a program you can do everything with by clicking on one button? I designed my keyboard with a very usefull green button ;-)
Rendering made with SolidWorks PhotoView.
Hope you love it…
↧
Qt4.8.5 + raspberry pi
Hi all.
I need help.
I use Qt4.8.5 for embedded linux on my raspberry pi(raspbian installed).
I’m trying to run compiled applications from my pc on rpi, but, some of them not running.
Error text is : undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent (QWidget::qwsEvent(QWSEvent*))
1) applications with forms(Ui::MainWindow *ui;) not running.
2) Not running too
class Slider : public QWidget
{
Q_OBJECT
public:
Slider(QWidget *parent = 0);
private:
QSlider *slider;
QLabel *label;
};
#include "qttest.h"
Slider::Slider(QWidget *parent)
: QWidget(parent)
{
slider = new QSlider(Qt::Horizontal , this);
slider->setGeometry(50, 50, 130, 30);
label = new QLabel("0", this);
label->setGeometry(230, 50, 20, 30);
connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int)));
}
#include <QApplication>
#include "qttest.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Slider window;
window.move(300, 300);
window.setWindowTitle("QSlider");
window.show();
return app.exec();
}
3 run succesful
#include <QHash>
#include <QVariant>
#include <QAbstractTableModel>
class TableModel : public QAbstractTableModel {
Q_OBJECT
private:
int m_rows;
int m_columns;
QHash<QModelIndex, QVariant> m_hash;
public:
explicit TableModel(int columns, int rows, QObject *parent = 0);
QVariant data(const QModelIndex& index, int nRole) const;
bool setData(const QModelIndex& index, const QVariant& value, int nRole);
int rowCount(const QModelIndex& index) const;
int columnCount(const QModelIndex& index) const;
Qt::ItemFlags flags(const QModelIndex& index) const;
signals:
public slots:
};
#include "tablemodel.h"
TableModel::TableModel(int columns, int rows, QObject* parent) :
QAbstractTableModel(parent),
m_rows(rows),
m_columns(columns) {
}
QVariant TableModel::data(const QModelIndex& index, int nRole) const {
if(!index.isValid()) {
return QVariant();
}
QString str = QString("%1 : %2").arg(index.row() + 1).arg(index.column() + 1);
return (nRole == Qt::DisplayRole || nRole == Qt::EditRole)
? m_hash.value(index, QVariant(str))
: QVariant();
}
bool TableModel::setData(const QModelIndex& index, const QVariant& value, int nRole) {
if(!index.isValid() && nRole == Qt::EditRole) {
m_hash[index] = value;
emit dataChanged(index, index);
return true;
}
return false;
}
int TableModel::rowCount(const QModelIndex& index) const {
return m_rows;
}
int TableModel::columnCount(const QModelIndex& index) const {
return m_columns;
}
Qt::ItemFlags TableModel::flags(const QModelIndex& index) const {
Qt::ItemFlags flags = QAbstractTableModel::flags(index);
return index.isValid() ? (flags | Qt::ItemIsEditable) : flags;
}
#include <QApplication>
#include <QtGui>
#include <QTreeView>
#include <QListView>
#include <QTableView>
#include <QHBoxLayout>
#include <QStandardItemModel>
#include <QDirModel>
#include <QSplitter>
#include "intlistmodel.h"
#include "tablemodel.h"
#include "mainwindow.h"
#include "simpledelegate.h"
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
TableModel model(200,200);
QTableView tableView;
tableView.setModel(&model);
tableView.show();
return a.exec();
}
What’s wrong? I do not understand. Please help me to understand, thanks.
↧
Qt 5.2.1 Exes Segmentation Fault and Qml No Window System - How can I fix?
I have built Qt 5.2.1 for the Raspberry Pi according to the instructions at www.ics.com/blog/building-qt-5-raspberry-pi#.U05AJJUr3n3
The build and install go fine. However there are two problems:
If I run any example application (eg analogclock) on the target (built for rpi) I get a segmentation fault.
If I run a simple qml script (as per the above build instructions) on the target I get Hello World in the middle of the screen, the screen is filled white but there is no window frame, no mouse and no keyboard
I also get EGLFS warning messages about screen resolution.
Does anyone know how to fix these problems?
Many thanks
Baz
↧