trikRuntime
commandSettingsWidget.h
Go to the documentation of this file.
1 /* Copyright 2016 Mikhail Kita
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/qglobal.h>
18 
19 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
20  #include <QtGui/QWidget>
21  #include <QtGui/QLabel>
22  #include <QtGui/QVBoxLayout>
23  #include <QtGui/QListWidget>
24 #else
25  #include <QtWidgets/QWidget>
26  #include <QtWidgets/QLabel>
27  #include <QtWidgets/QVBoxLayout>
28  #include <QtWidgets/QListWidget>
29 #endif
30 
31 #include <QtCore/QString>
32 
33 #include "trikGuiDialog.h"
34 #include "numberSelectionWidget.h"
35 #include "connectButton.h"
36 
37 namespace trikGui {
38 
41 {
42  Q_OBJECT
43 
44 public:
49  CommandSettingsWidget(const QString &title, int digits, QWidget *parent = nullptr);
50 
52  static QString menuEntry();
53 
54  void renewFocus() override;
55 
57  int value() const;
58 
59 protected:
60  void keyPressEvent(QKeyEvent *event) override;
61 
62 private slots:
64  void focus();
65 
66 private:
67  QEventLoop mEventLoop;
68  QVBoxLayout mLayout;
69  QLabel mTitle;
70 
72  NumberSelectionWidget mValueSelector;
73 
75  ConnectButton mContinueButton;
76 };
77 
78 }
static QString menuEntry()
Returns menu entry for this widget.
Definition: commandSettingsWidget.cpp:46
CommandSettingsWidget(const QString &title, int digits, QWidget *parent=nullptr)
Constructor.
Definition: commandSettingsWidget.cpp:24
int value() const
Returns value of selector.
Definition: commandSettingsWidget.cpp:78
Widget that allows to input integer numbers using robot keys.
Definition: numberSelectionWidget.h:32
Base class for all trikGui dialog widgets.
Definition: trikGuiDialog.h:24
Widget which allows to change settings of robot command.
Definition: commandSettingsWidget.h:40
Definition: abstractIndicator.h:21
void renewFocus() override
Set focus properly on this widget or one of its children.
Definition: commandSettingsWidget.cpp:51
void keyPressEvent(QKeyEvent *event) override
Definition: commandSettingsWidget.cpp:55
Somewhat tuned button for communication settings widget.
Definition: connectButton.h:28