#include "uisettings.h"
#include "graphicalui.h"
#include "uistyle.h"
+#include "util.h"
TopicWidget::TopicWidget(QWidget *parent)
: AbstractItemView(parent)
ui.topicLineEdit->setLineWrapEnabled(true);
ui.topicLineEdit->installEventFilter(this);
- connect(ui.topicLabel, SIGNAL(clickableActivated(Clickable)), SLOT(clickableActivated(Clickable)));
- connect(ui.topicLineEdit, SIGNAL(noTextEntered()), SLOT(on_topicLineEdit_textEntered()));
+ connect(ui.topicLabel, &StyledLabel::clickableActivated, this, &TopicWidget::clickableActivated);
+ connect(ui.topicLineEdit, &MultiLineEdit::noTextEntered, this, &TopicWidget::on_topicLineEdit_textEntered);
UiSettings s("TopicWidget");
- s.notify("DynamicResize", this, SLOT(updateResizeMode()));
- s.notify("ResizeOnHover", this, SLOT(updateResizeMode()));
+ s.notify("DynamicResize", this, &TopicWidget::updateResizeMode);
+ s.notify("ResizeOnHover", this, &TopicWidget::updateResizeMode);
updateResizeMode();
UiStyleSettings fs("Fonts");
- fs.notify("UseCustomTopicWidgetFont", this, SLOT(setUseCustomFont(QVariant)));
- fs.notify("TopicWidget", this, SLOT(setCustomFont(QVariant)));
+ fs.notify("UseCustomTopicWidgetFont", this, &TopicWidget::setUseCustomFont);
+ fs.notify("TopicWidget", this, selectOverload<const QVariant&>(&TopicWidget::setCustomFont));
if (fs.value("UseCustomTopicWidgetFont", false).toBool())
setCustomFont(fs.value("TopicWidget", QFont()));
if (event->type() != QEvent::KeyRelease)
return QObject::eventFilter(obj, event);
- QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ auto *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Escape) {
switchPlain();