forked from COVESA/dlt-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'COVESA:master' into master
- Loading branch information
Showing
9 changed files
with
216 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "searchform.h" | ||
#include "ui_searchform.h" | ||
|
||
#include <QLineEdit> | ||
|
||
SearchForm::SearchForm(QWidget *parent) | ||
: QWidget(parent) | ||
, ui(new Ui::SearchForm) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->comboBox->setLineEdit(new QLineEdit); | ||
ui->comboBox->setInsertPolicy(QComboBox::InsertAtTop); | ||
|
||
connect (ui->abortButton, &QPushButton::clicked, this, &SearchForm::abortSearch); | ||
} | ||
|
||
SearchForm::~SearchForm() | ||
{ | ||
delete ui; | ||
} | ||
|
||
QLineEdit *SearchForm::input() const | ||
{ | ||
return ui->comboBox->lineEdit(); | ||
} | ||
|
||
void SearchForm::setState(State state) | ||
{ | ||
switch(state) { | ||
case State::INPUT: | ||
ui->stackedWidget->setCurrentIndex(0); | ||
break; | ||
case State::PROGRESS: | ||
ui->stackedWidget->setCurrentIndex(1); | ||
break; | ||
} | ||
} | ||
|
||
void SearchForm::setProgress(int val) | ||
{ | ||
ui->progressBar->setValue(val); | ||
} | ||
|
||
void SearchForm::resetProgress() | ||
{ | ||
setProgress(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef SEARCHFORM_H | ||
#define SEARCHFORM_H | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui { | ||
class SearchForm; | ||
} | ||
|
||
class QLineEdit; | ||
|
||
class SearchForm : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
enum class State { | ||
INPUT, | ||
PROGRESS | ||
}; | ||
|
||
explicit SearchForm(QWidget *parent = nullptr); | ||
~SearchForm(); | ||
|
||
QLineEdit* input() const; | ||
|
||
void setState(State state); | ||
void setProgress(int val); | ||
void resetProgress(); | ||
|
||
signals: | ||
void abortSearch(); | ||
|
||
private: | ||
Ui::SearchForm *ui; | ||
}; | ||
|
||
#endif // SEARCHFORM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>SearchForm</class> | ||
<widget class="QWidget" name="SearchForm"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>260</width> | ||
<height>40</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_3"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QStackedWidget" name="stackedWidget"> | ||
<widget class="QWidget" name="page"> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QComboBox" name="comboBox"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | ||
<horstretch>1</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<widget class="QWidget" name="page_2"> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QProgressBar" name="progressBar"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> | ||
<horstretch>1</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="value"> | ||
<number>24</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="abortButton"> | ||
<property name="text"> | ||
<string>Abort</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters