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&#40;&#41;;
    

    }

    @

    What's wrong? I do not understand. Please help me to understand, thanks.


  • Moderators

    Hi and welcome to devnet,

    Qwsevent is used on embedded systems to encapsulate an event.
    http://qt-project.org/doc/qt-4.8/qwsevent.html
    Seems you're linking to the wrong libraries.

    How did you install / compile Qt ?  How is your pc set up? OS? Qt version? Cross compile tools?



  • [quote author="Eddy" date="1397541482"]Hi and welcome to devnet,

    Qwsevent is used on embedded systems to encapsulate an event.
    http://qt-project.org/doc/qt-4.8/qwsevent.html
    Seems you're linking to the wrong libraries.

    How did you install / compile Qt ?  How is your pc set up? OS? Qt version? Cross compile tools?[/quote]

    Hi Eddy, thanks for replay.

    1. How did you install Qt
      On raspbian i didn't it.
      On my pc, I folowed this "instructions":http://qt-project.org/doc/qt-4.8/embeddedlinux-support.html

    2)How is your pc set up?
    I work from virtual machine, debian wheezy.

    1. Qt version is 4.8.5

    2. cross compile tools is arm-2010q1-none-linux-gnueabi


  • Moderators

    I've never tried that approach myself. So I can't help you with the details of this setup.

    Why do you use an old version of Qt anyway? Are you forced to do so by circumstances or are you just trying things out? In the last case we can point you to more recent tutorials on how to cross-compile for the Pi.



    1. Why do you use an old version of Qt anyway?
      I did not fount qt5 for embedded.

    2. In the last case we can point you to more recent tutorials on how to cross-compile for the Pi.
      Wow, It seems very good.


  • Moderators

    On this wiki page you will find a lot of information:
    "Link to wiki":http://qt-project.org/wiki/Category:QtonPi

    Beware of old info. The link to the ICS tutorial is the most recent of the bunch and has been used successfully lately.

    Have fun!



  • Thanks.
    May I ask a question?
    I want to join to developing qt.(Write code)
    What I must to do for it?
    I have never work with open source projects.
    Can you guide me a little please?


  • Moderators

    There is a lot you can do for Qt!

    All info can be found on "The contributions page":http://qt-project.org/contribute



  • [quote author="Eddy" date="1397547863"]There is a lot you can do for Qt!

    All info can be found on "The contributions page":http://qt-project.org/contribute[/quote]
    Thanks.

    Two question please.
    If I developing an application for embedded systems, should I install qt on every machine where I planning install my software?
    Where I can find Qt 5.2.0 for embedded systems?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.