Skip to content

Commit 946f838

Browse files
committed
base layout
1 parent da35136 commit 946f838

File tree

4 files changed

+64
-73
lines changed

4 files changed

+64
-73
lines changed

Animeme.pro

+9-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ DEFINES += QT_DEPRECATED_WARNINGS
2222
# You can also select to disable deprecated APIs only up to a certain version of Qt.
2323
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
2424

25-
INCLUDEPATH += /usr/include/opencv2
26-
27-
LIBS += `pkg-config --cflags --libs opencv`
25+
linux {
26+
INCLUDEPATH += /usr/include/opencv2
27+
LIBS += `pkg-config --libs opencv`
28+
}
29+
30+
macx {
31+
INCLUDEPATH += `pkg-config --cflags opencv`
32+
LIBS += `pkg-config --libs opencv`
33+
}
2834

2935
SOURCES += \
3036
main.cpp \

mainwindow.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ MainWindow::MainWindow(QWidget *parent) :
88
player = new LoopPlayer();
99
QObject::connect(player, SIGNAL(processedImage(QImage)), this, SLOT(updateLoopPlayerUI(QImage)));
1010

11-
if (!player->loadVideo("/home/shin/Videos/59adf78ac4c0bc657943222d.mp4"))
12-
{
13-
QMessageBox msgBox;
14-
msgBox.setText("The selected video could not be opened!");
15-
msgBox.exec();
16-
}
17-
18-
player->play();
19-
2011
ui->setupUi(this);
2112
}
2213

@@ -61,16 +52,16 @@ void MainWindow::on_openFileButton_clicked()
6152
}
6253
}
6354

64-
void MainWindow::on_pushButton_2_clicked()
55+
void MainWindow::on_playPauseButton_clicked()
6556
{
6657
if (player->isStopped())
6758
{
6859
player->play();
69-
ui->pushButton_2->setText(tr("Pause"));
60+
// ui->playPauseButton->setText(tr("Pause"));
7061
}
7162
else
7263
{
7364
player->pause();
74-
ui->pushButton_2->setText(tr("Play"));
65+
// ui->playPauseButton->setText(tr("Play"));
7566
}
7667
}

mainwindow.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MainWindow : public QMainWindow
2121
private slots:
2222
void updateLoopPlayerUI(QImage img);
2323
void on_openFileButton_clicked();
24-
void on_pushButton_2_clicked();
24+
void on_playPauseButton_clicked();
2525

2626
private:
2727
Ui::MainWindow *ui;

mainwindow.ui

+51-57
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>784</width>
9+
<width>860</width>
1010
<height>508</height>
1111
</rect>
1212
</property>
@@ -22,12 +22,12 @@
2222
</property>
2323
<layout class="QGridLayout" name="gridLayout">
2424
<property name="leftMargin">
25-
<number>0</number>
25+
<number>6</number>
2626
</property>
2727
<property name="rightMargin">
2828
<number>6</number>
2929
</property>
30-
<item row="1" column="0">
30+
<item row="0" column="0">
3131
<layout class="QHBoxLayout" name="baseLayout">
3232
<property name="leftMargin">
3333
<number>0</number>
@@ -37,7 +37,7 @@
3737
<item>
3838
<widget class="QLabel" name="playerScreen">
3939
<property name="sizePolicy">
40-
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
40+
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
4141
<horstretch>0</horstretch>
4242
<verstretch>0</verstretch>
4343
</sizepolicy>
@@ -56,90 +56,91 @@
5656
</property>
5757
</widget>
5858
</item>
59+
</layout>
60+
</item>
61+
<item>
62+
<layout class="QVBoxLayout" name="toolLayout">
5963
<item>
60-
<layout class="QHBoxLayout" name="horizontalLayout">
64+
<layout class="QVBoxLayout" name="toolBoxLayout">
65+
<property name="sizeConstraint">
66+
<enum>QLayout::SetDefaultConstraint</enum>
67+
</property>
6168
<item>
62-
<widget class="QToolButton" name="toolButton">
63-
<property name="enabled">
64-
<bool>true</bool>
69+
<widget class="QPushButton" name="cropAndRotateButton">
70+
<property name="minimumSize">
71+
<size>
72+
<width>200</width>
73+
<height>80</height>
74+
</size>
6575
</property>
6676
<property name="focusPolicy">
6777
<enum>Qt::NoFocus</enum>
6878
</property>
6979
<property name="text">
70-
<string/>
80+
<string>Crop and rotate</string>
7181
</property>
7282
</widget>
7383
</item>
7484
<item>
75-
<spacer name="horizontalSpacer">
85+
<widget class="Line" name="line">
7686
<property name="orientation">
7787
<enum>Qt::Horizontal</enum>
7888
</property>
89+
</widget>
90+
</item>
91+
<item>
92+
<spacer name="verticalSpacer">
93+
<property name="orientation">
94+
<enum>Qt::Vertical</enum>
95+
</property>
7996
<property name="sizeHint" stdset="0">
8097
<size>
81-
<width>40</width>
82-
<height>20</height>
98+
<width>20</width>
99+
<height>40</height>
83100
</size>
84101
</property>
85102
</spacer>
86103
</item>
87104
</layout>
88105
</item>
89106
<item>
90-
<widget class="QProgressBar" name="playerProgressBar">
91-
<property name="sizePolicy">
92-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
93-
<horstretch>0</horstretch>
94-
<verstretch>0</verstretch>
95-
</sizepolicy>
96-
</property>
97-
<property name="value">
98-
<number>24</number>
107+
<widget class="Line" name="line_2">
108+
<property name="orientation">
109+
<enum>Qt::Horizontal</enum>
99110
</property>
100111
</widget>
101112
</item>
102-
</layout>
103-
</item>
104-
<item>
105-
<layout class="QVBoxLayout" name="toolLayout">
106113
<item>
107-
<layout class="QVBoxLayout" name="toolBoxLayout">
114+
<layout class="QVBoxLayout" name="verticalLayout_4">
108115
<item>
109-
<widget class="QPushButton" name="pushButton">
110-
<property name="text">
111-
<string>PushButton</string>
116+
<widget class="QPushButton" name="openFileButton">
117+
<property name="minimumSize">
118+
<size>
119+
<width>0</width>
120+
<height>50</height>
121+
</size>
122+
</property>
123+
<property name="focusPolicy">
124+
<enum>Qt::NoFocus</enum>
112125
</property>
113-
</widget>
114-
</item>
115-
<item>
116-
<widget class="QPushButton" name="pushButton_2">
117126
<property name="text">
118-
<string>PushButton</string>
127+
<string>Open File</string>
119128
</property>
120129
</widget>
121130
</item>
122131
<item>
123-
<spacer name="verticalSpacer">
124-
<property name="orientation">
125-
<enum>Qt::Vertical</enum>
126-
</property>
127-
<property name="sizeHint" stdset="0">
132+
<widget class="QPushButton" name="exportButton">
133+
<property name="minimumSize">
128134
<size>
129-
<width>20</width>
130-
<height>40</height>
135+
<width>0</width>
136+
<height>50</height>
131137
</size>
132138
</property>
133-
</spacer>
134-
</item>
135-
</layout>
136-
</item>
137-
<item>
138-
<layout class="QVBoxLayout" name="verticalLayout_4">
139-
<item>
140-
<widget class="QPushButton" name="pushButton_3">
139+
<property name="focusPolicy">
140+
<enum>Qt::NoFocus</enum>
141+
</property>
141142
<property name="text">
142-
<string>PushButton</string>
143+
<string>Export</string>
143144
</property>
144145
</widget>
145146
</item>
@@ -149,13 +150,6 @@
149150
</item>
150151
</layout>
151152
</item>
152-
<item row="0" column="0">
153-
<widget class="QToolButton" name="openFileButton">
154-
<property name="text">
155-
<string>Open File</string>
156-
</property>
157-
</widget>
158-
</item>
159153
</layout>
160154
</widget>
161155
</widget>

0 commit comments

Comments
 (0)