]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/LengthCombo.cpp
Add missing initialization
[lyx.git] / src / frontends / qt4 / LengthCombo.cpp
index 0ed1d64c4e987ddad547119dc089a8057f19ddae..6eacfbfb36d715d5ae2a2586cde557d7232f3084 100644 (file)
 #include <string>
 
 
+namespace lyx {
+namespace frontend {
+
 LengthCombo::LengthCombo(QWidget * parent)
        : QComboBox(parent)
 {
        for (int i = 0; i < lyx::num_units; i++) {
                // mu does not make sense usually
                // so it must be added manually, if needed
-               if (QString(lyx::unit_name[i]) == "mu")
+               if (QLatin1String(lyx::unit_name[i]) == "mu")
                        continue;
                QComboBox::addItem(lyx::qt_(lyx::unit_name_gui[i]),
                        lyx::toqstr(lyx::unit_name[i]));
        }
 
        connect(this, SIGNAL(activated(int)),
-               this, SLOT(has_activated(int)));
+               this, SLOT(hasActivated(int)));
 }
 
 
@@ -45,7 +48,7 @@ lyx::Length::UNIT LengthCombo::currentLengthItem() const
 }
 
 
-void LengthCombo::has_activated(int)
+void LengthCombo::hasActivated(int)
 {
   // emit signal
        selectionChanged(currentLengthItem());
@@ -58,7 +61,7 @@ void LengthCombo::setCurrentItem(lyx::Length::UNIT unit)
 }
 
 
-void LengthCombo::setCurrentItem(QString const item)
+void LengthCombo::setCurrentItem(QString const item)
 {
        int num = QComboBox::count();
        for (int i = 0; i < num; i++) {
@@ -95,6 +98,14 @@ void LengthCombo::noPercents()
 }
 
 
+void LengthCombo::removeFontDependent()
+{
+       removeUnit(Length::EM);
+       removeUnit(Length::EX);
+       removeUnit(Length::MU);
+}
+
+
 void LengthCombo::removeUnit(lyx::Length::UNIT unit)
 {
        QString const val = lyx::toqstr(lyx::stringFromUnit(unit));
@@ -122,5 +133,7 @@ void LengthCombo::addUnit(lyx::Length::UNIT unit)
                   lyx::toqstr(lyx::unit_name[int(unit)]));
 }
 
+} // namespace frontend
+} // namespace lyx
 
 #include "moc_LengthCombo.cpp"