pull/32/head
pvqf6mep3 3 years ago
commit 402a15165d

@ -20,10 +20,72 @@ MainWindow::~MainWindow()
void MainWindow::initUis(){ void MainWindow::initUis(){
setBtnStyles();
/*
* init
*/
rock_widget = new JoyStick(ui->JoyStick_widget);
rock_widget->show();
}
void MainWindow::setBtnStyles(){
/* /*
* set PushButton state * set PushButton state
*/ */
ui->btn_main->setIcon(QIcon("://images/up.png"));
ui->btn_main->setText("mainWidget");
ui->btn_main->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
ui->btn_uav->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
ui->btn_ugv->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
// 8 -> Forward: ↑ // 8 -> Forward: ↑
ui->pushButton_Forward->setShortcut(Qt::Key_8); ui->pushButton_Forward->setShortcut(Qt::Key_8);
ui->pushButton_Forward->setStyleSheet( ui->pushButton_Forward->setStyleSheet(
@ -88,15 +150,6 @@ void MainWindow::initUis(){
"QPushButton:pressed{border-image: url(://images/down_right_2.png)}"); "QPushButton:pressed{border-image: url(://images/down_right_2.png)}");
ui->pushButton_Right_Back->setFlat(true); ui->pushButton_Right_Back->setFlat(true);
/*
* init
*/
rock_widget = new JoyStick(ui->JoyStick_widget);
rock_widget->show();
} }

@ -49,6 +49,7 @@ private:
JoyStick *rock_widget; JoyStick *rock_widget;
void initUis(); void initUis();
void setBtnStyles();
void connections(); void connections();

@ -54,16 +54,38 @@
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="UGVWidget"> <widget class="QWidget" name="UGVWidget">
<widget class="QWidget" name="layoutWidget_2"> <widget class="QWidget" name="">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>1000</x> <x>1000</x>
<y>80</y> <y>30</y>
<width>387</width> <width>407</width>
<height>566</height> <height>680</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QStackedWidget" name="stackedWidget_ros_control">
<widget class="QWidget" name="keyboard_control">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -312,7 +334,7 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>30</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -461,7 +483,7 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>30</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -474,11 +496,11 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>86</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
@ -501,7 +523,7 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -527,6 +549,78 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="system_control"/>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_menu_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>45</height>
</size>
</property>
<property name="text">
<string>system</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>45</height>
</size>
</property>
<property name="text">
<string>keyboard</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -545,23 +639,7 @@ QPushButton:pressed{border-image: url(://images/down_2.png);}</string>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton:hover{ <string notr="true"/>
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -583,23 +661,7 @@ margin:0px 0px 0px 0px;
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton:hover{ <string notr="true"/>
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -621,26 +683,10 @@ margin:0px 0px 0px 0px;
</size> </size>
</property> </property>
<property name="cursor"> <property name="cursor">
<cursorShape>PointingHandCursor</cursorShape> <cursorShape>ArrowCursor</cursorShape>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton:hover{ <string notr="true"/>
background-color:rgb(186, 189, 182);
border-bottom:2px solid rgb(67, 154, 246);
}
QPushButton:checked{
background-color:cyan;
border-bottom:2px solid white
}
QPushButton:pressed{
background-color:rgb(67, 154, 246)
}
QPushButton{
background-color:rgb(238, 238, 236);
border:none;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>

Loading…
Cancel
Save