Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLedMatrix Sample Program
Qt 6.11 is out! See what's new in the release blog

QLedMatrix Sample Program

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • 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 Offline
    Q Offline
    qt52
    wrote on last edited by
    #1

    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
    0
    • S Offline
      S Offline
      stukdev
      wrote on last edited by
      #2
      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
      0
      • Q Offline
        Q Offline
        qt52
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved