forked from Ivasoft/DSView
update: split class KeywordLineEdit from class ProtocolDock
This commit is contained in:
@@ -247,6 +247,7 @@ set(DSView_SOURCES
|
||||
pv/minizip/unzip.c
|
||||
pv/minizip/ioapi.c
|
||||
pv/dialogs/applicationpardlg.cpp
|
||||
pv/dock/keywordlineedit.cpp
|
||||
)
|
||||
|
||||
set(DSView_HEADERS
|
||||
@@ -330,6 +331,7 @@ set(DSView_HEADERS
|
||||
pv/minizip/unzip.h
|
||||
pv/minizip/ioapi.h
|
||||
pv/dialogs/applicationpardlg.h
|
||||
pv/dock/keywordlineedit.h
|
||||
)
|
||||
|
||||
set(DSView_FORMS
|
||||
|
||||
@@ -36,24 +36,6 @@
|
||||
#include "decoderstatus.h"
|
||||
#include "../../dsvdef.h"
|
||||
|
||||
|
||||
bool is_hex_number_str(const char *str)
|
||||
{
|
||||
char c = *str;
|
||||
int len = 0;
|
||||
|
||||
while (c)
|
||||
{
|
||||
++len;
|
||||
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')){
|
||||
c = *str;
|
||||
str++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return len % 2 == 0 && len > 0;
|
||||
}
|
||||
|
||||
namespace pv {
|
||||
namespace data {
|
||||
|
||||
@@ -53,39 +53,8 @@
|
||||
#include "../data/decode/decoderstatus.h"
|
||||
#include "../data/decode/decoder.h"
|
||||
|
||||
#define PROTOCOL_FIND_TITLE "Protocol search..."
|
||||
|
||||
using namespace std;
|
||||
|
||||
//--------------------------class KeywordLineEdit
|
||||
|
||||
KeywordLineEdit::KeywordLineEdit(QComboBox *comboBox)
|
||||
:QLineEdit()
|
||||
{
|
||||
assert(comboBox);
|
||||
_comboBox = comboBox;
|
||||
}
|
||||
|
||||
|
||||
void KeywordLineEdit::focusInEvent(QFocusEvent *e)
|
||||
{
|
||||
QLineEdit::focusInEvent(e);
|
||||
QString key(PROTOCOL_FIND_TITLE);
|
||||
if (this->text() == key){
|
||||
this->setText("");
|
||||
}
|
||||
}
|
||||
|
||||
void KeywordLineEdit::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
QLineEdit::focusOutEvent(e);
|
||||
|
||||
if (this->text() == ""){
|
||||
this->setText(PROTOCOL_FIND_TITLE);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
namespace pv {
|
||||
namespace dock {
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <QTableView>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QLineEdit>
|
||||
#include <QFocusEvent>
|
||||
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
@@ -45,27 +44,13 @@
|
||||
#include "protocolitemlayer.h"
|
||||
#include "../ui/dscombobox.h"
|
||||
#include "../dstimer.h"
|
||||
#include "keywordlineedit.h"
|
||||
|
||||
struct DecoderInfoItem{
|
||||
int Index;
|
||||
void *ObjectHandle; //srd_decoder* type
|
||||
};
|
||||
|
||||
class KeywordLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KeywordLineEdit(QComboBox *comboBox);
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *e) override;
|
||||
void focusOutEvent(QFocusEvent *e) override;
|
||||
|
||||
private:
|
||||
QComboBox *_comboBox;
|
||||
};
|
||||
|
||||
namespace pv {
|
||||
|
||||
class SigSession;
|
||||
|
||||
Reference in New Issue
Block a user