LcdSpinBox: use LcdWidget as base class
We can now use the new LcdWidget class as base class for actually displaying our model's values.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -26,32 +26,20 @@
|
||||
#ifndef _LCD_SPINBOX_H
|
||||
#define _LCD_SPINBOX_H
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "LcdWidget.h"
|
||||
#include "AutomatableModelView.h"
|
||||
|
||||
|
||||
class EXPORT lcdSpinBox : public QWidget, public IntModelView
|
||||
class EXPORT lcdSpinBox : public LcdWidget, public IntModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
lcdSpinBox( int _num_digits, QWidget * _parent, const QString & _name =
|
||||
QString::null );
|
||||
lcdSpinBox( int numDigits, QWidget* parent, const QString& name = QString::null );
|
||||
|
||||
lcdSpinBox( int _num_digits, const QString & _lcd_style,
|
||||
QWidget * _parent, const QString & _name = QString::null );
|
||||
lcdSpinBox( int numDigits, const QString& style, QWidget* parent, const QString& name = QString::null );
|
||||
|
||||
virtual ~lcdSpinBox();
|
||||
|
||||
void setLabel( const QString & _txt );
|
||||
|
||||
inline void addTextForValue( int _val, const QString & _text )
|
||||
{
|
||||
m_textForValue[_val] = _text;
|
||||
update();
|
||||
}
|
||||
|
||||
virtual void modelChanged()
|
||||
{
|
||||
ModelView::modelChanged();
|
||||
@@ -60,8 +48,6 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void setEnabled( bool _on );
|
||||
virtual void setMarginWidth( int _width );
|
||||
virtual void update();
|
||||
|
||||
|
||||
@@ -71,26 +57,8 @@ protected:
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void paintEvent( QPaintEvent * _me );
|
||||
|
||||
virtual void updateSize();
|
||||
|
||||
private:
|
||||
|
||||
static const int charsPerPixmap = 12;
|
||||
|
||||
QMap<int, QString> m_textForValue;
|
||||
|
||||
QString m_display;
|
||||
|
||||
QString m_label;
|
||||
QPixmap * m_lcdPixmap;
|
||||
|
||||
int m_cellWidth;
|
||||
int m_cellHeight;
|
||||
int m_numDigits;
|
||||
int m_marginWidth;
|
||||
|
||||
QPoint m_origMousePos;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user