Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    QLedMatrix Sample Program

    General and Desktop
    2
    3
    1311
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      qt52 last edited by

      Hello Everyone,

      I would like to try this QLedMatrix sample code ( http://qt-apps.org/content/show.php?action=content&content=101193 ) but when i compile it, it show 2 error message as bellow:
      cannot find -lqledmatrix
      collect2: ld return 1 exit status

      In the .pro file last line show
      LIBS +- -lqledmatrix
      I think qledmatrix library is missing. May i know this library is .dll format? In QLedMatrix-0.6 folder i can't find any .dll file. Is it we have to use the sample code to generate the library?

      Please kindly advice..Thanks..

      1 Reply Last reply Reply Quote 0
      • S
        stukdev last edited by

        1. You have to build the library to generate the dll
        2. I tried in past that project and its simply the way to clear LCD effect (create a grid in front of the string) but have some limitation.
        1 Reply Last reply Reply Quote 0
        • Q
          qt52 last edited by

          Hello Stuk,

          Thanks for your reply.

          I'm not sure i'm doing a right way not... following is the library file that i try to generate,

          .pro file
          @#-------------------------------------------------

          Project created by QtCreator 2013-02-07T16:14:13

          #-------------------------------------------------

          QT -= gui

          TARGET = qledmatrix
          TEMPLATE = lib

          DEFINES += QLEDMATRIX_LIBRARY

          SOURCES += qledmatrix.cpp

          HEADERS += qledmatrix.h
          qledmatrix_global.h

          symbian {
          MMP_RULES += EXPORTUNFROZEN
          TARGET.UID3 = 0xEE658E29
          TARGET.CAPABILITY =
          TARGET.EPOCALLOWDLLDATA = 1
          addFiles.sources = qledmatrix.dll
          addFiles.path = !:/sys/bin
          DEPLOYMENT += addFiles
          }

          unix:!symbian {
          maemo5 {
          target.path = /opt/usr/lib
          } else {
          target.path = /usr/lib
          }
          INSTALLS += target
          }
          @

          qledmatrix.h file
          @#ifndef QLEDMATRIX_H
          #define QLEDMATRIX_H

          #include <QtGui/qwidget.h>
          #include <QtDesigner/QDesignerExportWidget>

          class QLedMatrixPrivate;
          class QDESIGNER_WIDGET_EXPORT QLedMatrix: public QWidget
          {
          Q_OBJECT
          Q_ENUMS(LEDColor)
          Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
          Q_PROPERTY(Qt::BGMode backgroundMode READ backgroundMode WRITE setBackgroundMode)
          Q_PROPERTY(QColor darkLedColor READ darkLedColor WRITE setDarkLedColor)
          Q_PROPERTY(int rows READ rowCount WRITE setRowCount)
          Q_PROPERTY(int columns READ columnCount WRITE setColumnCount)

          public:
          
              QLedMatrix(QWidget* parent = 0);
              virtual ~QLedMatrix();
          
              enum LEDColor
              {
                  NoColor   = 0xFF222222,
          
                  Red       = 0xFFFF0000,
                  Green     = 0xFF00FF00,
                  Blue      = 0xFF0000FF,
          
                  White     = 0xFFFFFFFF,
                  Orange    = 0xFFFF8800,
                  OrangeRed = 0xFFFF2200,
                  Yellow    = 0xFFFFFF00
              };
          
              void clear();
          
              QColor backgroundColor() const;
              void setBackgroundColor(const QColor& color);
          
              Qt::BGMode backgroundMode() const;
              void setBackgroundMode(Qt::BGMode mode);
          
              QColor darkLedColor() const;
              void setDarkLedColor(const QColor& color);
          
              QRgb colorAt(int row, int col) const;
              void setColorAt(int row, int col, QRgb rgb);
          
              int rowCount() const;
              void setRowCount(int rows);
          
              int columnCount() const;
              void setColumnCount(int columns);
          
              QSize sizeHint() const;
          
          protected:
              QLedMatrixPrivate* const d_ptr;
              void paintEvent(QPaintEvent* event);
          
          private:
              Q_DISABLE_COPY(QLedMatrix)
              Q_DECLARE_PRIVATE(QLedMatrix)
          

          };

          #endif // QLEDMATRIX_H
          @

          qledmatrix_global.h file
          @
          #ifndef QLEDMATRIX_GLOBAL_H
          #define QLEDMATRIX_GLOBAL_H

          #include <QtCore/qglobal.h>

          #if defined(QLEDMATRIX_LIBRARY)

          define QLEDMATRIXSHARED_EXPORT Q_DECL_EXPORT

          #else

          define QLEDMATRIXSHARED_EXPORT Q_DECL_IMPORT

          #endif

          #endif // QLEDMATRIX_GLOBAL_H@

          qledmatrix.cpp file
          @#include "qledmatrix.h"

          #include <QtGui/qpainter.h>
          //#include <qpainter.h>

          /**

          • \internal
            */
            class QLedMatrixPrivate
            {
            Q_DECLARE_PUBLIC(QLedMatrix)

            public:
            bool isValid(int row, int col) const;
            void setColorAt(int row, int col, QRgb rgb, bool doUpdate);
            .....
            ..
            @

          After i compile, it generate a lot of warning and one error ( definition of static data member 'QLedMatrix::staticMetaObjectExtraData' of dllimport'd class).

          Have you across this error message?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post