1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/opencs/view/tools/searchbox.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.3 KiB
C++
Raw Normal View History

#ifndef CSV_TOOLS_SEARCHBOX_H
#define CSV_TOOLS_SEARCHBOX_H
2018-07-04 21:03:54 +02:00
#include <QCheckBox>
#include <QComboBox>
2015-04-16 18:50:22 +02:00
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QStackedWidget>
#include <QWidget>
class QGridLayout;
namespace CSMTools
{
class Search;
}
namespace CSVTools
{
class SearchBox : public QWidget
{
Q_OBJECT
QStackedWidget mInput;
QLineEdit mText;
QComboBox mRecordState;
QCheckBox mCaseSensitive;
QPushButton mSearch;
QGridLayout* mLayout;
QComboBox mMode;
bool mSearchEnabled;
2015-04-16 18:50:22 +02:00
QStackedWidget mReplaceInput;
QLineEdit mReplaceText;
QLabel mReplacePlaceholder;
2015-04-16 20:11:14 +02:00
QPushButton mReplace;
2022-09-22 21:26:05 +03:00
private:
void updateSearchButton();
2022-09-22 21:26:05 +03:00
public:
2020-11-13 11:39:47 +04:00
SearchBox(QWidget* parent = nullptr);
void setSearchMode(bool enabled);
CSMTools::Search getSearch() const;
2015-04-16 18:50:22 +02:00
std::string getReplaceText() const;
2015-04-16 20:11:14 +02:00
void setEditLock(bool locked);
void focus();
private slots:
void modeSelected(int index);
void textChanged(const QString& text);
void startSearch(bool checked = true);
2015-04-16 20:11:14 +02:00
void replaceAll(bool checked);
signals:
void startSearch(const CSMTools::Search& search);
2015-04-16 20:11:14 +02:00
void replaceAll();
};
}
#endif