File: fontcombobox.cpp

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (20 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "fontcombobox.h"

#include <QFontDatabase>

FontCombobox::FontCombobox(QWidget* parent) : ComboBoxEx(parent) {
	addItems(QFontDatabase().families());

	value = currentText();

	connect(this, SIGNAL(currentTextChanged(QString)), this, SLOT(updateInternals()));
}

const QString& FontCombobox::getPreviousValue() {
	return previousValue;
}

void FontCombobox::updateInternals() {
	previousValue = value;
	value = currentText();
}