1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 09:23:52 +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 19:03:54 +00:00
#include <QCheckBox>
#include <QComboBox>
2015-04-16 16:50:22 +00: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 16:50:22 +00:00
QStackedWidget mReplaceInput;
QLineEdit mReplaceText;
QLabel mReplacePlaceholder;
2015-04-16 18:11:14 +00:00
QPushButton mReplace;
2022-09-22 18:26:05 +00:00
private:
void updateSearchButton();
2022-09-22 18:26:05 +00:00
public:
2020-11-13 07:39:47 +00:00
SearchBox(QWidget* parent = nullptr);
void setSearchMode(bool enabled);
CSMTools::Search getSearch() const;
2015-04-16 16:50:22 +00:00
std::string getReplaceText() const;
2015-04-16 18:11:14 +00: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 18:11:14 +00:00
void replaceAll(bool checked);
signals:
void startSearch(const CSMTools::Search& search);
2015-04-16 18:11:14 +00:00
void replaceAll();
};
}
#endif