diff --git a/effects/internal/texteffect.cpp b/effects/internal/texteffect.cpp index ff0b13c02..59b80b929 100644 --- a/effects/internal/texteffect.cpp +++ b/effects/internal/texteffect.cpp @@ -138,8 +138,8 @@ TextEffect::TextEffect(Clip* c, const EffectMeta* em) : outline_enable(false); shadow_enable(false); - connect(shadow_bool, SIGNAL(toggled(bool)), this, SLOT(shadow_enable(bool))); - connect(outline_bool, SIGNAL(toggled(bool)), this, SLOT(outline_enable(bool))); + connect(shadow_bool, SIGNAL(Toggled(bool)), this, SLOT(shadow_enable(bool))); + connect(outline_bool, SIGNAL(Toggled(bool)), this, SLOT(outline_enable(bool))); vertPath = "common.vert"; fragPath = "dropshadow.frag"; diff --git a/effects/internal/texteffect.h b/effects/internal/texteffect.h index c3d7734a6..e389a5873 100644 --- a/effects/internal/texteffect.h +++ b/effects/internal/texteffect.h @@ -29,7 +29,7 @@ class TextEffect : public Effect { Q_OBJECT public: - TextEffect(Clip* c, const EffectMeta *em); + TextEffect(Clip* c, const EffectMeta *em); void redraw(double timecode); StringField* text_val; diff --git a/effects/internal/vsthost.cpp b/effects/internal/vsthost.cpp index c29f9c550..f831abc4e 100644 --- a/effects/internal/vsthost.cpp +++ b/effects/internal/vsthost.cpp @@ -256,7 +256,22 @@ void VSTHost::processAudio(long numFrames) { plugin->processReplacing(plugin, inputs, outputs, numFrames); } -VSTHost::VSTHost(Clip* c, const EffectMeta *em) : Effect(c, em) { +void VSTHost::CreateDialogIfNull() +{ + if (dialog == nullptr) { + dialog = new QDialog(olive::MainWindow); + dialog->setWindowTitle(tr("VST Plugin")); + dialog->setAttribute(Qt::WA_NativeWindow, true); + dialog->setWindowFlags(dialog->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); + connect(dialog, SIGNAL(finished(int)), this, SLOT(uncheck_show_button())); + } +} + +VSTHost::VSTHost(Clip* c, const EffectMeta *em) : + Effect(c, em), + plugin(nullptr), + dialog(nullptr) +{ plugin = nullptr; inputs = new float* [CHANNEL_COUNT]; @@ -268,21 +283,14 @@ VSTHost::VSTHost(Clip* c, const EffectMeta *em) : Effect(c, em) { EffectRow* file_row = new EffectRow(this, tr("Plugin"), true, false); file_field = new FileField(file_row, "filename"); - connect(file_field, SIGNAL(changed()), this, SLOT(change_plugin())); + connect(file_field, SIGNAL(Changed()), this, SLOT(change_plugin())); EffectRow* interface_row = new EffectRow(this, tr("Interface"), false, false); - show_interface_btn = new ButtonField(interface_row, tr("Show")); show_interface_btn->SetCheckable(true); show_interface_btn->SetEnabled(false); - connect(show_interface_btn, SIGNAL(toggled(bool)), this, SLOT(show_interface(bool))); - - dialog = new QDialog(olive::MainWindow); - dialog->setWindowTitle(tr("VST Plugin")); - dialog->setAttribute(Qt::WA_NativeWindow, true); - dialog->setWindowFlags(dialog->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); - connect(dialog, SIGNAL(finished(int)), this, SLOT(uncheck_show_button())); + connect(show_interface_btn, SIGNAL(Toggled(bool)), this, SLOT(show_interface(bool))); } VSTHost::~VSTHost() { @@ -294,9 +302,6 @@ VSTHost::~VSTHost() { delete [] inputs; freePlugin(); - - delete show_interface_btn; - delete dialog; } void VSTHost::process_audio(double, double, quint8* samples, int nb_bytes, int) { @@ -358,6 +363,7 @@ void VSTHost::save(QXmlStreamWriter &stream) { } void VSTHost::show_interface(bool show) { + CreateDialogIfNull(); dialog->setVisible(show); if (show) { @@ -383,9 +389,13 @@ void VSTHost::change_plugin() { if (plugin != nullptr) { if (configurePluginCallbacks()) { startPlugin(); + VSTRect* eRect = nullptr; plugin->dispatcher(plugin, effEditGetRect, 0, 0, &eRect, 0); + + CreateDialogIfNull(); dialog->setFixedSize(eRect->right - eRect->left, eRect->bottom - eRect->top); + } else { #ifdef __APPLE__ CFBundleUnloadExecutable(bundle); diff --git a/effects/internal/vsthost.h b/effects/internal/vsthost.h index 5ac307139..5e30312ba 100644 --- a/effects/internal/vsthost.h +++ b/effects/internal/vsthost.h @@ -62,6 +62,7 @@ private: void suspendPlugin(); bool canPluginDo(char *canDoString); void processAudio(long numFrames); + void CreateDialogIfNull(); float** inputs; float** outputs; QDialog* dialog; diff --git a/project/effectfields/buttonfield.cpp b/project/effectfields/buttonfield.cpp index 28865d62f..57845808f 100644 --- a/project/effectfields/buttonfield.cpp +++ b/project/effectfields/buttonfield.cpp @@ -1,10 +1,11 @@ #include "buttonfield.h" +#include + ButtonField::ButtonField(EffectRow *parent, const QString &string) : - EffectField(parent, nullptr, EFFECT_FIELD_UI) -{ - SetValueAt(0, string); -} + EffectField(parent, nullptr, EFFECT_FIELD_UI), + button_text_(string) +{} void ButtonField::SetCheckable(bool c) { @@ -16,3 +17,20 @@ void ButtonField::SetChecked(bool c) checked_ = c; emit CheckedChanged(c); } + +QWidget *ButtonField::CreateWidget() +{ + QPushButton* button = new QPushButton(); + + button->setCheckable(checkable_); + button->setEnabled(IsEnabled()); + button->setText(button_text_); + + connect(this, SIGNAL(CheckedChanged(bool)), button, SLOT(setChecked(bool))); + connect(this, SIGNAL(EnabledChanged(bool)), button, SLOT(setEnabled(bool))); + connect(button, SIGNAL(clicked(bool)), this, SIGNAL(Clicked())); + connect(button, SIGNAL(toggled(bool)), this, SLOT(SetChecked(bool))); + connect(button, SIGNAL(toggled(bool)), this, SIGNAL(Toggled(bool))); + + return button; +} diff --git a/project/effectfields/buttonfield.h b/project/effectfields/buttonfield.h index eb108427c..71e77f1ac 100644 --- a/project/effectfields/buttonfield.h +++ b/project/effectfields/buttonfield.h @@ -10,12 +10,20 @@ public: ButtonField(EffectRow* parent, const QString& string); void SetCheckable(bool c); + virtual QWidget* CreateWidget() override; + +public slots: void SetChecked(bool c); + signals: void CheckedChanged(bool); + void Toggled(bool); + private: bool checkable_; bool checked_; + + QString button_text_; }; #endif // BUTTONFIELD_H diff --git a/project/effectfields/colorfield.cpp b/project/effectfields/colorfield.cpp index 435c79ddc..865505dd2 100644 --- a/project/effectfields/colorfield.cpp +++ b/project/effectfields/colorfield.cpp @@ -2,6 +2,8 @@ #include +#include "ui/colorbutton.h" + ColorField::ColorField(EffectRow* parent, const QString& id) : EffectField(parent, id, EFFECT_FIELD_COLOR) {} @@ -11,6 +13,16 @@ QColor ColorField::GetColorAt(double timecode) return GetValueAt(timecode).value(); } +QWidget *ColorField::CreateWidget() +{ + ColorButton* cb = new ColorButton(); + + connect(cb, SIGNAL(color_changed(const QColor &)), this, SLOT(UpdateFromWidget(const QColor &))); + connect(this, SIGNAL(EnabledChanged(bool)), cb, SLOT(setEnabled(bool))); + + return cb; +} + QVariant ColorField::ConvertStringToValue(const QString &s) { return QColor(s); @@ -20,3 +32,8 @@ QString ColorField::ConvertValueToString(const QVariant &v) { return v.value().name(); } + +void ColorField::UpdateFromWidget(const QColor& c) +{ + SetValueAt(Now(), c); +} diff --git a/project/effectfields/colorfield.h b/project/effectfields/colorfield.h index 26f668c65..f4ef25020 100644 --- a/project/effectfields/colorfield.h +++ b/project/effectfields/colorfield.h @@ -11,8 +11,12 @@ public: QColor GetColorAt(double timecode); + virtual QWidget* CreateWidget() override; + virtual QVariant ConvertStringToValue(const QString& s) override; virtual QString ConvertValueToString(const QVariant& v) override; +private slots: + void UpdateFromWidget(const QColor &c); }; #endif // COLORFIELD_H diff --git a/project/effectfields/combofield.cpp b/project/effectfields/combofield.cpp index ff4a1a164..46576aa7a 100644 --- a/project/effectfields/combofield.cpp +++ b/project/effectfields/combofield.cpp @@ -25,6 +25,7 @@ QWidget *ComboField::CreateWidget() } connect(cb, SIGNAL(activated(int)), this, SLOT(UpdateFromWidget(int))); + connect(this, SIGNAL(EnabledChanged(bool)), cb, SLOT(setEnabled(bool))); return cb; } diff --git a/project/effectfields/doublefield.cpp b/project/effectfields/doublefield.cpp index a0e9260e1..63de39fbb 100644 --- a/project/effectfields/doublefield.cpp +++ b/project/effectfields/doublefield.cpp @@ -71,6 +71,8 @@ QWidget *DoubleField::CreateWidget() ls->set_display_type(display_type_); ls->set_frame_rate(frame_rate_); + ls->setEnabled(IsEnabled()); + connect(ls, SIGNAL(valueChanged(double)), this, SLOT(UpdateFromWidget(double))); connect(ls, SIGNAL(clicked()), this, SIGNAL(Clicked())); connect(this, SIGNAL(EnabledChanged(bool)), ls, SLOT(setEnabled(bool))); diff --git a/project/effectfields/effectfield.h b/project/effectfields/effectfield.h index 166c801e0..b3fb60a29 100644 --- a/project/effectfields/effectfield.h +++ b/project/effectfields/effectfield.h @@ -85,6 +85,7 @@ private: signals: void Changed(); void Clicked(); + void EnabledChanged(bool); }; diff --git a/project/effectfields/filefield.cpp b/project/effectfields/filefield.cpp index 7ba52482e..a76383e15 100644 --- a/project/effectfields/filefield.cpp +++ b/project/effectfields/filefield.cpp @@ -1,5 +1,7 @@ #include "filefield.h" +#include "ui/embeddedfilechooser.h" + FileField::FileField(EffectRow* parent, const QString &id) : EffectField(parent, id, EFFECT_FIELD_FILE) { @@ -10,3 +12,18 @@ QString FileField::GetFileAt(double timecode) { return GetValueAt(timecode).toString(); } + +QWidget *FileField::CreateWidget() +{ + EmbeddedFileChooser* efc = new EmbeddedFileChooser(); + + connect(efc, SIGNAL(changed(const QString&)), this, SLOT(UpdateFromWidget(const QString&))); + connect(this, SIGNAL(EnabledChanged(bool)), efc, SLOT(setEnabled(bool))); + + return efc; +} + +void FileField::UpdateFromWidget(const QString &s) +{ + SetValueAt(Now(), s); +} diff --git a/project/effectfields/filefield.h b/project/effectfields/filefield.h index 575a43c21..2a68a0b50 100644 --- a/project/effectfields/filefield.h +++ b/project/effectfields/filefield.h @@ -10,6 +10,10 @@ public: FileField(EffectRow* parent, const QString& id); QString GetFileAt(double timecode); + + virtual QWidget* CreateWidget() override; +private slots: + void UpdateFromWidget(const QString &s); }; #endif // FILEFIELD_H diff --git a/project/effectfields/fontfield.cpp b/project/effectfields/fontfield.cpp index 7c16f2eea..a7b14fc0c 100644 --- a/project/effectfields/fontfield.cpp +++ b/project/effectfields/fontfield.cpp @@ -1,12 +1,34 @@ #include "fontfield.h" +#include +#include + FontField::FontField(EffectRow* parent, const QString &id) : EffectField(parent, id, EFFECT_FIELD_FONT) { + font_list = QFontDatabase().families(); + SetValueAt(0, font_list.first()); } QString FontField::GetFontAt(double timecode) { return GetValueAt(timecode).toString(); } + +QWidget *FontField::CreateWidget() +{ + QComboBox* fcb = new QComboBox(); + + fcb->addItems(font_list); + + connect(fcb, SIGNAL(currentTextChanged(const QString &)), this, SLOT(UpdateFromWidget(const QString &))); + connect(this, SIGNAL(EnabledChanged(bool)), fcb, SLOT(setEnabled(bool))); + + return fcb; +} + +void FontField::UpdateFromWidget(const QString& s) +{ + SetValueAt(Now(), s); +} diff --git a/project/effectfields/fontfield.h b/project/effectfields/fontfield.h index 532f82d4d..b2a828b1d 100644 --- a/project/effectfields/fontfield.h +++ b/project/effectfields/fontfield.h @@ -9,6 +9,12 @@ public: FontField(EffectRow* parent, const QString& id); QString GetFontAt(double timecode); + + virtual QWidget *CreateWidget() override; +private: + QStringList font_list; +private slots: + void UpdateFromWidget(const QString& index); }; #endif // FONTFIELD_H diff --git a/project/effectfields/labelfield.cpp b/project/effectfields/labelfield.cpp index bf6db9238..e50f337d8 100644 --- a/project/effectfields/labelfield.cpp +++ b/project/effectfields/labelfield.cpp @@ -1,7 +1,18 @@ #include "labelfield.h" +#include + LabelField::LabelField(EffectRow *parent, const QString &string) : - EffectField(parent, nullptr, EFFECT_FIELD_UI) + EffectField(parent, nullptr, EFFECT_FIELD_UI), + label_text_(string) +{} + +QWidget *LabelField::CreateWidget() { - SetValueAt(0, string); + QLabel* label = new QLabel(label_text_); + + label->setEnabled(IsEnabled()); + connect(this, SIGNAL(EnabledChanged(bool)), label, SLOT(setEnabled(bool))); + + return label; } diff --git a/project/effectfields/labelfield.h b/project/effectfields/labelfield.h index e7dd712f2..628a9181a 100644 --- a/project/effectfields/labelfield.h +++ b/project/effectfields/labelfield.h @@ -8,6 +8,10 @@ class LabelField : public EffectField Q_OBJECT public: LabelField(EffectRow* parent, const QString& string); + + virtual QWidget* CreateWidget() override; +private: + QString label_text_; }; #endif // LABELFIELD_H diff --git a/project/effectfields/stringfield.cpp b/project/effectfields/stringfield.cpp index 322f40f6f..105e5c28f 100644 --- a/project/effectfields/stringfield.cpp +++ b/project/effectfields/stringfield.cpp @@ -20,6 +20,7 @@ QWidget *StringField::CreateWidget() { TextEditEx* text_edit = new TextEditEx(); + text_edit->setEnabled(IsEnabled()); text_edit->setUndoRedoEnabled(true); // the "2" looks like a magic number, but it's just one pixel on the top and the bottom @@ -28,6 +29,7 @@ QWidget *StringField::CreateWidget() + text_edit->document()->documentMargin() + 2)); connect(text_edit, SIGNAL(textModified(const QString&)), this, SLOT(UpdateFromWidget(const QString&))); + connect(this, SIGNAL(EnabledChanged(bool)), text_edit, SLOT(setEnabled(bool))); return text_edit; } diff --git a/project/undo.cpp b/project/undo.cpp index 7c2ca0374..fd022f15c 100644 --- a/project/undo.cpp +++ b/project/undo.cpp @@ -197,7 +197,6 @@ AddEffectCommand::AddEffectCommand(Clip* c, EffectPtr e, const EffectMeta *m, in ref = e; meta = m; pos = insert_pos; - done = false; } void AddEffectCommand::doUndo() { @@ -207,7 +206,6 @@ void AddEffectCommand::doUndo() { } else { clip->effects.removeAt(pos); } - done = false; } void AddEffectCommand::doRedo() { @@ -219,7 +217,6 @@ void AddEffectCommand::doRedo() { } else { clip->effects.insert(pos, ref); } - done = true; } AddTransitionCommand::AddTransitionCommand(Clip* iopen, diff --git a/ui/colorbutton.cpp b/ui/colorbutton.cpp index 4489b47db..a5e200fbc 100644 --- a/ui/colorbutton.cpp +++ b/ui/colorbutton.cpp @@ -25,47 +25,47 @@ #include ColorButton::ColorButton(QWidget *parent) - : QPushButton(parent), color(Qt::white) { - set_button_color(); - connect(this, SIGNAL(clicked(bool)), this, SLOT(open_dialog())); + : QPushButton(parent), color(Qt::white) { + set_button_color(); + connect(this, SIGNAL(clicked(bool)), this, SLOT(open_dialog())); } QColor ColorButton::get_color() { - return color; + return color; } void ColorButton::set_color(QColor c) { - previousColor = color; - color = c; - set_button_color(); + previousColor = color; + color = c; + set_button_color(); } const QColor &ColorButton::getPreviousValue() { - return previousColor; + return previousColor; } void ColorButton::set_button_color() { - QPalette pal = palette(); - pal.setColor(QPalette::Button, color); - setPalette(pal); + QPalette pal = palette(); + pal.setColor(QPalette::Button, color); + setPalette(pal); } void ColorButton::open_dialog() { - QColor new_color = QColorDialog::getColor(color, nullptr, tr("Set Color")); - if (new_color.isValid() && color != new_color) { - set_color(new_color); - set_button_color(); - emit color_changed(); - } + QColor new_color = QColorDialog::getColor(color, nullptr, tr("Set Color")); + if (new_color.isValid() && color != new_color) { + set_color(new_color); + set_button_color(); + emit color_changed(color); + } } ColorCommand::ColorCommand(ColorButton* s, QColor o, QColor n) - : sender(s), old_color(o), new_color(n) {} + : sender(s), old_color(o), new_color(n) {} void ColorCommand::undo() { - sender->set_color(old_color); + sender->set_color(old_color); } void ColorCommand::redo() { - sender->set_color(new_color); + sender->set_color(new_color); } diff --git a/ui/colorbutton.h b/ui/colorbutton.h index d4593549f..74364d951 100644 --- a/ui/colorbutton.h +++ b/ui/colorbutton.h @@ -26,31 +26,31 @@ #include class ColorButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - ColorButton(QWidget* parent = 0); - QColor get_color(); - void set_color(QColor c); - const QColor& getPreviousValue(); + ColorButton(QWidget* parent = nullptr); + QColor get_color(); + void set_color(QColor c); + const QColor& getPreviousValue(); private: - QColor color; - QColor previousColor; - void set_button_color(); + QColor color; + QColor previousColor; + void set_button_color(); signals: - void color_changed(); + void color_changed(const QColor& c); private slots: - void open_dialog(); + void open_dialog(); }; class ColorCommand : public QUndoCommand { public: - ColorCommand(ColorButton* s, QColor o, QColor n); - void undo(); - void redo(); + ColorCommand(ColorButton* s, QColor o, QColor n); + void undo(); + void redo(); private: - ColorButton* sender; - QColor old_color; - QColor new_color; + ColorButton* sender; + QColor old_color; + QColor new_color; }; #endif // COLORBUTTON_H diff --git a/ui/comboboxex.h b/ui/comboboxex.h index 28c04d380..5a3d23772 100644 --- a/ui/comboboxex.h +++ b/ui/comboboxex.h @@ -25,18 +25,18 @@ #include class ComboBoxEx : public QComboBox { - Q_OBJECT + Q_OBJECT public: - ComboBoxEx(QWidget* parent = 0); - void setCurrentIndexEx(int i); - void setCurrentTextEx(const QString &text); - int getPreviousIndex(); + ComboBoxEx(QWidget* parent = 0); + void setCurrentIndexEx(int i); + void setCurrentTextEx(const QString &text); + int getPreviousIndex(); private slots: - void index_changed(int); + void index_changed(int); private: - int index; - int previousIndex; - void wheelEvent(QWheelEvent* e); + int index; + int previousIndex; + void wheelEvent(QWheelEvent* e); }; #endif // COMBOBOXEX_H diff --git a/ui/embeddedfilechooser.cpp b/ui/embeddedfilechooser.cpp index c5ca542d1..99e35905d 100644 --- a/ui/embeddedfilechooser.cpp +++ b/ui/embeddedfilechooser.cpp @@ -27,54 +27,54 @@ #include EmbeddedFileChooser::EmbeddedFileChooser(QWidget* parent) : QWidget(parent) { - QHBoxLayout* layout = new QHBoxLayout(this); - layout->setMargin(0); - file_label = new QLabel(this); - update_label(); - layout->addWidget(file_label); - QPushButton* browse_button = new QPushButton("...", this); - browse_button->setFixedWidth(25); - layout->addWidget(browse_button); - connect(browse_button, SIGNAL(clicked(bool)), this, SLOT(browse())); + QHBoxLayout* layout = new QHBoxLayout(this); + layout->setMargin(0); + file_label = new QLabel(this); + update_label(); + layout->addWidget(file_label); + QPushButton* browse_button = new QPushButton("...", this); + browse_button->setFixedWidth(25); + layout->addWidget(browse_button); + connect(browse_button, SIGNAL(clicked(bool)), this, SLOT(browse())); } const QString &EmbeddedFileChooser::getFilename() { - return filename; + return filename; } const QString &EmbeddedFileChooser::getPreviousValue() { - return old_filename; + return old_filename; } void EmbeddedFileChooser::setFilename(const QString &s) { - old_filename = filename; - filename = s; - update_label(); - emit changed(); + old_filename = filename; + filename = s; + update_label(); + emit changed(filename); } void EmbeddedFileChooser::update_label() { - QString l = "" + tr("File:") + " "; - if (filename.isEmpty()) { - l += "(none)"; - } else { - bool file_exists = QFileInfo::exists(filename); - if (!file_exists) l += ""; - QString short_fn = filename.mid(filename.lastIndexOf('/')+1); - if (short_fn.size() > 20) { - l += "..." + short_fn.right(20); - } else { - l += short_fn; - } - if (!file_exists) l += ""; - } - l += ""; - file_label->setText(l); + QString l = "" + tr("File:") + " "; + if (filename.isEmpty()) { + l += "(none)"; + } else { + bool file_exists = QFileInfo::exists(filename); + if (!file_exists) l += ""; + QString short_fn = filename.mid(filename.lastIndexOf('/')+1); + if (short_fn.size() > 20) { + l += "..." + short_fn.right(20); + } else { + l += short_fn; + } + if (!file_exists) l += ""; + } + l += ""; + file_label->setText(l); } void EmbeddedFileChooser::browse() { - QString fn = QFileDialog::getOpenFileName(this); - if (!fn.isEmpty()) { - setFilename(fn); - } + QString fn = QFileDialog::getOpenFileName(this); + if (!fn.isEmpty()) { + setFilename(fn); + } } diff --git a/ui/embeddedfilechooser.h b/ui/embeddedfilechooser.h index 3808bec6f..9d15d1264 100644 --- a/ui/embeddedfilechooser.h +++ b/ui/embeddedfilechooser.h @@ -26,22 +26,22 @@ class QLabel; class EmbeddedFileChooser : public QWidget { - Q_OBJECT + Q_OBJECT public: - EmbeddedFileChooser(QWidget* parent = 0); + EmbeddedFileChooser(QWidget* parent = 0); - const QString& getFilename(); - const QString& getPreviousValue(); - void setFilename(const QString& s); + const QString& getFilename(); + const QString& getPreviousValue(); + void setFilename(const QString& s); signals: - void changed(); + void changed(const QString& s); private: - QLabel* file_label; - QString filename; - QString old_filename; - void update_label(); + QLabel* file_label; + QString filename; + QString old_filename; + void update_label(); private slots: - void browse(); + void browse(); }; #endif // EMBEDDEDFILECHOOSER_H diff --git a/ui/fontcombobox.cpp b/ui/fontcombobox.cpp index 349625847..4e5547c26 100644 --- a/ui/fontcombobox.cpp +++ b/ui/fontcombobox.cpp @@ -22,19 +22,19 @@ #include -FontCombobox::FontCombobox(QWidget* parent) : ComboBoxEx(parent) { - addItems(QFontDatabase().families()); +FontCombobox::FontCombobox(QWidget* parent) : QComboBox(parent) { + addItems(QFontDatabase().families()); - value = currentText(); + value = currentText(); - connect(this, SIGNAL(currentTextChanged(QString)), this, SLOT(updateInternals())); + connect(this, SIGNAL(currentTextChanged(QString)), this, SLOT(updateInternals())); } const QString& FontCombobox::getPreviousValue() { - return previousValue; + return previousValue; } void FontCombobox::updateInternals() { - previousValue = value; - value = currentText(); + previousValue = value; + value = currentText(); } diff --git a/ui/fontcombobox.h b/ui/fontcombobox.h index f6ad2d5dd..90fb24813 100644 --- a/ui/fontcombobox.h +++ b/ui/fontcombobox.h @@ -21,18 +21,18 @@ #ifndef FONTCOMBOBOX_H #define FONTCOMBOBOX_H -#include "comboboxex.h" +#include -class FontCombobox : public ComboBoxEx { - Q_OBJECT +class FontCombobox : public QComboBox { + Q_OBJECT public: - FontCombobox(QWidget* parent = 0); - const QString &getPreviousValue(); + FontCombobox(QWidget* parent = 0); + const QString &getPreviousValue(); private slots: - void updateInternals(); + void updateInternals(); private: - QString previousValue; - QString value; + QString previousValue; + QString value; }; #endif // FONTCOMBOBOX_H