lyx_mirror/src/frontends/qt/LengthCombo.h
Jean-Marc Lasgouttes c293be56bd Rename frontend qt4 to qt
In particular, the directory frontends/qt4 is renamed to frontends/qt.

Many configurations file have to be updated. All mentions of qt4 in
the source have been audited, and changed to qt if necessary.

The only part that has not been updated is the CMake build system.
2019-07-20 23:39:40 +02:00

63 lines
1.3 KiB
C++

// -*- C++ -*-
/**
* \file LengthCombo.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef LENGTHCOMBO_H
#define LENGTHCOMBO_H
#include <QComboBox>
#include "Length.h"
namespace lyx {
namespace frontend {
/**
* A combo box for selecting Length::UNIT types.
*/
class LengthCombo : public QComboBox {
Q_OBJECT
public:
LengthCombo(QWidget * parent);
/// set the current item from unit
void setCurrentItem(lyx::Length::UNIT unit);
/// set the current item from length string
virtual void setCurrentItem(QString const & item);
/// set the current item from int
virtual void setCurrentItem(int item);
/// get the current item
lyx::Length::UNIT currentLengthItem() const;
/// enable the widget
virtual void setEnabled(bool b);
/// use the %-items?
void noPercents();
/// Remove EM, EX and MU units
void removeFontDependent();
/// remove a unit from the combo
void removeUnit(lyx::Length::UNIT unit);
/// add a unit to the combo
void addUnit(lyx::Length::UNIT unit);
protected Q_SLOTS:
virtual void hasActivated(int index);
Q_SIGNALS:
/// the current selection has changed
void selectionChanged(lyx::Length::UNIT unit);
};
} // namespace frontend
} // namespace lyx
#endif // LENGTHCOMBO_H