Skip to content

Commit

Permalink
V1.1 release - Missing Icon added, UI size fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehmet Aksoy committed Nov 14, 2024
1 parent 68c0564 commit 31f99ab
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 51 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
${PROJECT_SOURCES}
serialportworker.cpp
serialportworker.h
resources.qrc
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET PTZControl APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
Expand Down
Binary file added img/icon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this);
this->setFocusPolicy(Qt::StrongFocus);

// SetIcon
QIcon icon(":/img/icon.ico");
this->setWindowIcon(icon);

connect(ui->connectButton, &QPushButton::clicked, this, &MainWindow::on_connectButton_clicked);
connect(ui->stopButton, &QPushButton::clicked, this, &MainWindow::on_stopButton_clicked);

Expand Down
215 changes: 164 additions & 51 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@
<x>0</x>
<y>0</y>
<width>622</width>
<height>402</height>
<height>401</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>622</width>
<height>401</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>622</width>
<height>401</height>
</size>
</property>
<property name="font">
<font>
<family>Bahnschrift Light</family>
Expand All @@ -19,8 +31,18 @@
<property name="windowTitle">
<string>PTZ Control</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>icon.ico</normaloff>icon.ico</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonStyle::ToolButtonFollowStyle</enum>
<enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::TabShape::Rounded</enum>
Expand Down Expand Up @@ -53,8 +75,17 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="statusTip">
<string>This button is used to stop movement (It will send the PELCO-D Stop message)</string>
</property>
<property name="whatsThis">
<string>This button is used to stop movement (It will send the PELCO-D Stop message)</string>
</property>
<property name="text">
<string>O</string>
<string/>
</property>
<property name="icon">
<iconset theme="media-record"/>
</property>
</widget>
</item>
Expand All @@ -64,7 +95,10 @@
<bool>false</bool>
</property>
<property name="text">
<string>🢧</string>
<string/>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::GoNext"/>
</property>
</widget>
</item>
Expand All @@ -74,7 +108,10 @@
<bool>false</bool>
</property>
<property name="text">
<string>↓</string>
<string/>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::GoDown"/>
</property>
</widget>
</item>
Expand All @@ -84,7 +121,10 @@
<bool>false</bool>
</property>
<property name="text">
<string>↑</string>
<string/>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::GoUp"/>
</property>
</widget>
</item>
Expand All @@ -94,7 +134,10 @@
<bool>false</bool>
</property>
<property name="text">
<string>🢤</string>
<string/>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::GoPrevious"/>
</property>
</widget>
</item>
Expand All @@ -109,6 +152,9 @@
<height>20</height>
</rect>
</property>
<property name="statusTip">
<string>This option enables the Keyboard control to control PT via keyboard instead of buttons</string>
</property>
<property name="text">
<string>Keyboard Control</string>
</property>
Expand All @@ -135,30 +181,17 @@
<height>171</height>
</rect>
</property>
<property name="statusTip">
<string>The Logs will be displayed here when the connection has been established.</string>
</property>
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
</widget>
<widget class="QPushButton" name="stopButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>370</x>
<y>320</y>
<width>241</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Bahnschrift</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>STOP</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_5">
<property name="geometry">
<rect>
Expand Down Expand Up @@ -305,13 +338,19 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="rightLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -325,30 +364,14 @@
<height>20</height>
</rect>
</property>
<property name="statusTip">
<string>This option enables the PRESET Functionality to set-reset limits.</string>
</property>
<property name="text">
<string>Enable PRESET functionality</string>
<string>PRESET functionality</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="connectButton">
<property name="geometry">
<rect>
<x>130</x>
<y>320</y>
<width>231</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Bahnschrift</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>START</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
Expand All @@ -367,7 +390,7 @@
<x>10</x>
<y>12</y>
<width>221</width>
<height>81</height>
<height>83</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -401,14 +424,92 @@
</item>
<item row="0" column="1">
<widget class="QPushButton" name="stopAllButton">
<property name="statusTip">
<string>This button is used to stop movement (It will send the PELCO-D Stop message)</string>
</property>
<property name="whatsThis">
<string>This button is used to stop movement (It will send the PELCO-D Stop message)</string>
</property>
<property name="text">
<string>Stop All movement</string>
<string>Stop Movement</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>380</x>
<y>320</y>
<width>221</width>
<height>41</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="connectButton">
<property name="font">
<font>
<family>Bahnschrift</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>Please click if you want to connect the remote PT device with selected Port-Baudrate Configuration</string>
</property>
<property name="statusTip">
<string>Please click if you want to connect the remote PT device with selected Port-Baudrate Configuration</string>
</property>
<property name="whatsThis">
<string>Please click if you want to connect the remote PT device with selected Port-Baudrate Configuration</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>START</string>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentSend"/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stopButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Bahnschrift</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>Please click if you want to disconnect the remote PT device.</string>
</property>
<property name="statusTip">
<string>Please click if you want to disconnect the remote PT device.</string>
</property>
<property name="text">
<string>STOP</string>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::ApplicationExit"/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
Expand All @@ -424,6 +525,8 @@
<string>File</string>
</property>
<addaction name="separator"/>
<addaction name="actionNew"/>
<addaction name="actionOpen"/>
<addaction name="actionSave"/>
<addaction name="actionSave_Config_As"/>
<addaction name="actionExit"/>
Expand Down Expand Up @@ -508,6 +611,16 @@
<string>PTZ Control Help</string>
</property>
</action>
<action name="actionNew">
<property name="text">
<string>New</string>
</property>
</action>
<action name="actionOpen">
<property name="text">
<string>Open..</string>
</property>
</action>
</widget>
<resources/>
<connections/>
Expand Down
5 changes: 5 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>img/icon.ico</file>
</qresource>
</RCC>

0 comments on commit 31f99ab

Please sign in to comment.