NotebookSelector: use ComboBox

This commit is contained in:
Le Tan 2022-03-02 10:57:16 +08:00
parent bdd935d9c2
commit d25c142bfa
3 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,6 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLabel> #include <QLabel>
#include <QComboBox>
#include <QPushButton> #include <QPushButton>
#include <QCheckBox> #include <QCheckBox>
#include <QLineEdit> #include <QLineEdit>
@ -35,6 +34,7 @@
#include <export/exporter.h> #include <export/exporter.h>
#include <widgets/locationinputwithbrowsebutton.h> #include <widgets/locationinputwithbrowsebutton.h>
#include <widgets/messageboxhelper.h> #include <widgets/messageboxhelper.h>
#include <widgets/combobox.h>
using namespace vnotex; using namespace vnotex;

View File

@ -15,7 +15,7 @@
using namespace vnotex; using namespace vnotex;
NotebookSelector::NotebookSelector(QWidget *p_parent) NotebookSelector::NotebookSelector(QWidget *p_parent)
: QComboBox(p_parent), : ComboBox(p_parent),
NavigationMode(NavigationMode::Type::StagedDoubleKeys, this) NavigationMode(NavigationMode::Type::StagedDoubleKeys, this)
{ {
auto itemDelegate = new QStyledItemDelegate(this); auto itemDelegate = new QStyledItemDelegate(this);
@ -169,7 +169,7 @@ bool NotebookSelector::eventFilter(QObject *p_obj, QEvent *p_event)
return true; return true;
} }
} }
return QComboBox::eventFilter(p_obj, p_event); return ComboBox::eventFilter(p_obj, p_event);
} }
void NotebookSelector::clearNavigation() void NotebookSelector::clearNavigation()
@ -187,5 +187,5 @@ void NotebookSelector::mousePressEvent(QMouseEvent *p_event)
return; return;
} }
QComboBox::mousePressEvent(p_event); ComboBox::mousePressEvent(p_event);
} }

View File

@ -1,17 +1,17 @@
#ifndef NOTEBOOKSELECTOR_H #ifndef NOTEBOOKSELECTOR_H
#define NOTEBOOKSELECTOR_H #define NOTEBOOKSELECTOR_H
#include <QComboBox>
#include <QModelIndex> #include <QModelIndex>
#include "global.h" #include "global.h"
#include "navigationmode.h" #include "navigationmode.h"
#include "combobox.h"
namespace vnotex namespace vnotex
{ {
class Notebook; class Notebook;
class NotebookSelector : public QComboBox, public NavigationMode class NotebookSelector : public ComboBox, public NavigationMode
{ {
Q_OBJECT Q_OBJECT
public: public: