summaryrefslogtreecommitdiff
path: root/src/plugins/perforce
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-10-04 13:51:26 +0200
committerhjk <hjk@qt.io>2022-11-17 13:41:27 +0000
commitc5296c0bf65fdc2742ab52219d484b53a93f549e (patch)
tree05a20aa545c07454f1927330d90e7e7848e433e3 /src/plugins/perforce
parent0e4b0a26d34c523463ea68b27caf69cbb89083f2 (diff)
downloadqt-creator-c5296c0bf65fdc2742ab52219d484b53a93f549e.tar.gz
Perforce: Inline submitpanel.ui
Some unusual stuff removed, some unusual stuff left in. Change-Id: I53d9f4677540c2401d6ddfcd687b5f18c5f70667 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r--src/plugins/perforce/CMakeLists.txt1
-rw-r--r--src/plugins/perforce/perforce.qbs3
-rw-r--r--src/plugins/perforce/perforcesubmiteditorwidget.cpp57
-rw-r--r--src/plugins/perforce/perforcesubmiteditorwidget.h12
-rw-r--r--src/plugins/perforce/submitpanel.ui100
5 files changed, 53 insertions, 120 deletions
diff --git a/src/plugins/perforce/CMakeLists.txt b/src/plugins/perforce/CMakeLists.txt
index 3b020dfa09..a24f97ec8c 100644
--- a/src/plugins/perforce/CMakeLists.txt
+++ b/src/plugins/perforce/CMakeLists.txt
@@ -10,5 +10,4 @@ add_qtc_plugin(Perforce
perforcesettings.cpp perforcesettings.h
perforcesubmiteditor.cpp perforcesubmiteditor.h
perforcesubmiteditorwidget.cpp perforcesubmiteditorwidget.h
- submitpanel.ui
)
diff --git a/src/plugins/perforce/perforce.qbs b/src/plugins/perforce/perforce.qbs
index 7790ddf420..6d2e7ca0be 100644
--- a/src/plugins/perforce/perforce.qbs
+++ b/src/plugins/perforce/perforce.qbs
@@ -28,7 +28,6 @@ QtcPlugin {
"perforcesubmiteditor.cpp",
"perforcesubmiteditor.h",
"perforcesubmiteditorwidget.cpp",
- "perforcesubmiteditorwidget.h",
- "submitpanel.ui",
+ "perforcesubmiteditorwidget.h"
]
}
diff --git a/src/plugins/perforce/perforcesubmiteditorwidget.cpp b/src/plugins/perforce/perforcesubmiteditorwidget.cpp
index 7ce4a1c099..a044cc7b8e 100644
--- a/src/plugins/perforce/perforcesubmiteditorwidget.cpp
+++ b/src/plugins/perforce/perforcesubmiteditorwidget.cpp
@@ -3,13 +3,51 @@
#include "perforcesubmiteditorwidget.h"
-namespace Perforce {
-namespace Internal {
+#include <utils/layoutbuilder.h>
-PerforceSubmitEditorWidget::PerforceSubmitEditorWidget() :
- m_submitPanel(new QGroupBox)
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QLabel>
+
+using namespace Utils;
+
+namespace Perforce::Internal {
+
+class SubmitPanel : public QGroupBox
+{
+public:
+ SubmitPanel()
+ : m_changeNumber(createLabel())
+ , m_clientName(createLabel())
+ , m_userName(createLabel())
+ {
+ resize(402, 134);
+ setFlat(true);
+ setTitle(tr("Submit"));
+
+ using namespace Layouting;
+
+ Form {
+ tr("Change:"), m_changeNumber, br,
+ tr("Client:"), m_clientName, br,
+ tr("User:"), m_userName
+ }.attachTo(this);
+ }
+
+ QLabel *createLabel()
+ {
+ QLabel *label = new QLabel(this);
+ label->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByMouse);
+ return label;
+ }
+
+ QLabel *m_changeNumber = nullptr;
+ QLabel *m_clientName = nullptr;
+ QLabel *m_userName = nullptr;
+};
+
+PerforceSubmitEditorWidget::PerforceSubmitEditorWidget()
+ : m_submitPanel(new SubmitPanel)
{
- m_submitPanelUi.setupUi(m_submitPanel);
insertTopWidget(m_submitPanel);
}
@@ -17,10 +55,9 @@ void PerforceSubmitEditorWidget::setData(const QString &change,
const QString &client,
const QString &userName)
{
- m_submitPanelUi.changeNumber->setText(change);
- m_submitPanelUi.clientName->setText(client);
- m_submitPanelUi.userName->setText(userName);
+ m_submitPanel->m_changeNumber->setText(change);
+ m_submitPanel->m_clientName->setText(client);
+ m_submitPanel->m_userName->setText(userName);
}
-} // namespace Internal
-} // namespace Perforce
+} // Perforce::Internal
diff --git a/src/plugins/perforce/perforcesubmiteditorwidget.h b/src/plugins/perforce/perforcesubmiteditorwidget.h
index 01de31842e..258a1f315c 100644
--- a/src/plugins/perforce/perforcesubmiteditorwidget.h
+++ b/src/plugins/perforce/perforcesubmiteditorwidget.h
@@ -3,11 +3,11 @@
#pragma once
-#include "ui_submitpanel.h"
#include <vcsbase/submiteditorwidget.h>
-namespace Perforce {
-namespace Internal {
+namespace Perforce::Internal {
+
+class SubmitPanel;
/* Submit editor widget with additional information pane
* at the top. */
@@ -19,9 +19,7 @@ public:
void setData(const QString &change, const QString &client, const QString &userName);
private:
- QGroupBox *m_submitPanel;
- Ui::SubmitPanel m_submitPanelUi;
+ SubmitPanel *m_submitPanel;
};
-} // namespace Internal
-} // namespace Perforce
+} // Perforce::Internal
diff --git a/src/plugins/perforce/submitpanel.ui b/src/plugins/perforce/submitpanel.ui
deleted file mode 100644
index 5ce1f259f3..0000000000
--- a/src/plugins/perforce/submitpanel.ui
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Perforce::Internal::SubmitPanel</class>
- <widget class="QGroupBox" name="Perforce::Internal::SubmitPanel">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>-2</y>
- <width>402</width>
- <height>134</height>
- </rect>
- </property>
- <property name="title">
- <string>Submit</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QFormLayout" name="formLayout">
- <property name="horizontalSpacing">
- <number>5</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Change:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="changeNumber">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="textInteractionFlags">
- <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Client:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="clientName">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="textInteractionFlags">
- <set>Qt::LinksAccessibleByMouse</set>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>User:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="userName">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="textInteractionFlags">
- <set>Qt::LinksAccessibleByMouse</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>