Skip to content

Commit e13f180

Browse files
committed
Remove stdafx, update Qt integration and UI
Eliminates usage of stdafx.cpp/h and updates project files for direct Qt integration without QtMsBuild. Adds custom build steps for MOC and RCC, updates resource and filter settings, and introduces generated moc_ui.cpp and qrc_gui.cpp. UI and main window styling improved, window size reduced, and build dependencies updated for newer Qt and Boost versions.
1 parent 89f010c commit e13f180

File tree

11 files changed

+5290
-123
lines changed

11 files changed

+5290
-123
lines changed

Solidify/Solidify.vcxproj

Lines changed: 96 additions & 90 deletions
Large diffs are not rendered by default.

Solidify/Solidify.vcxproj.filters

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
</Filter>
2020
</ItemGroup>
2121
<ItemGroup>
22-
<QtRcc Include="src\gui.qrc">
22+
<None Include="src\gui.qrc">
2323
<Filter>Resource Files</Filter>
24-
</QtRcc>
24+
</None>
2525
</ItemGroup>
2626
<ItemGroup>
2727
<ClCompile Include="src\ui.cpp">
@@ -50,9 +50,9 @@
5050
</ClCompile>
5151
</ItemGroup>
5252
<ItemGroup>
53-
<QtUic Include="src\gui.ui">
53+
<None Include="src\gui.ui">
5454
<Filter>Form Files</Filter>
55-
</QtUic>
55+
</None>
5656
</ItemGroup>
5757
<ItemGroup>
5858
<ClInclude Include="src\processing.h">
@@ -87,9 +87,17 @@
8787
</ClInclude>
8888
</ItemGroup>
8989
<ItemGroup>
90-
<QtMoc Include="src\ui.h">
90+
<ClInclude Include="src\ui.h">
9191
<Filter>src</Filter>
92-
</QtMoc>
92+
</ClInclude>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<ClCompile Include="src\moc_ui.cpp">
96+
<Filter>src</Filter>
97+
</ClCompile>
98+
<ClCompile Include="src\qrc_gui.cpp">
99+
<Filter>src</Filter>
100+
</ClCompile>
93101
</ItemGroup>
94102
<ItemGroup>
95103
<CopyFileToFolders Include="src\sldf_config.toml">

Solidify/src/UI.CPP

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include "stdafx.h"
18+
#define WIN32_LEAN_AND_MEAN
19+
#define NOMINMAX
20+
#include <windows.h>
21+
#include <tlhelp32.h>
22+
#include <process.h>
23+
1924
#include "ui.h"
2025

2126
#include "processing.h"
@@ -51,6 +56,17 @@ void DropArea::dropEvent(QDropEvent* event) {
5156
}
5257

5358
MainWindow::MainWindow() {
59+
60+
this->setStyleSheet(
61+
"* {border: 0px solid black; border-radius: 3px; background-color: #D0D0D0; color: black; margin-bottom: 0}"
62+
"QMenuBar {background-color: #D0D0D0;}"
63+
"QMenuBar::item {background-color: #C0C0C0;}"
64+
"QMenuBar::item:selected {background-color: #B0B0B0;}"
65+
"QMenu {background-color: #D0D0D0;}"
66+
"QMenu::item:selected {background-color: #B0B0B0;}"
67+
"QMenu::separator {height: 1px; background: #808080; margin-left: 5px; margin-right: 5px; margin-top: 5px; margin-bottom: 5px;}"
68+
);
69+
5470
QVBoxLayout* layout = new QVBoxLayout; // Create a vertical layout
5571

5672
DropArea* dropArea = new DropArea;

Solidify/src/gui.ui

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>700</width>
9+
<width>500</width>
1010
<height>500</height>
1111
</rect>
1212
</property>
@@ -18,13 +18,13 @@
1818
</property>
1919
<property name="minimumSize">
2020
<size>
21-
<width>700</width>
21+
<width>500</width>
2222
<height>500</height>
2323
</size>
2424
</property>
2525
<property name="maximumSize">
2626
<size>
27-
<width>700</width>
27+
<width>500</width>
2828
<height>500</height>
2929
</size>
3030
</property>
@@ -37,6 +37,15 @@
3737
<property name="windowTitle">
3838
<string>MainWindow</string>
3939
</property>
40+
<property name="styleSheet">
41+
<string notr="true">* {
42+
border: 0px solid black;
43+
border-radius: 3px;
44+
background-color: #F0F0F0;
45+
color: black;
46+
margin-bottom: 0;
47+
}</string>
48+
</property>
4049
<widget class="QWidget" name="centralWidget">
4150
<widget class="QWidget" name="DropArea" native="true">
4251
<property name="geometry">
@@ -106,14 +115,33 @@
106115
</rect>
107116
</property>
108117
<property name="sizePolicy">
109-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
118+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
110119
<horstretch>0</horstretch>
111120
<verstretch>0</verstretch>
112121
</sizepolicy>
113122
</property>
123+
<property name="minimumSize">
124+
<size>
125+
<width>480</width>
126+
<height>20</height>
127+
</size>
128+
</property>
129+
<property name="sizeIncrement">
130+
<size>
131+
<width>1</width>
132+
<height>1</height>
133+
</size>
134+
</property>
135+
<property name="baseSize">
136+
<size>
137+
<width>480</width>
138+
<height>30</height>
139+
</size>
140+
</property>
114141
<property name="styleSheet">
115142
<string notr="true">QProgressBar {border: 0px solid black; border-radius: 3px; background-color: white; color: black; margin-bottom: 4px;}
116-
QProgressBar::chunk {background-color: #05B8CC;}</string>
143+
QProgressBar::chunk {background-color: #05B8CC;}
144+
</string>
117145
</property>
118146
<property name="value">
119147
<number>24</number>
@@ -127,13 +155,13 @@ QProgressBar::chunk {background-color: #05B8CC;}</string>
127155
<rect>
128156
<x>10</x>
129157
<y>410</y>
130-
<width>680</width>
158+
<width>480</width>
131159
<height>51</height>
132160
</rect>
133161
</property>
134162
<property name="maximumSize">
135163
<size>
136-
<width>680</width>
164+
<width>16777215</width>
137165
<height>16777215</height>
138166
</size>
139167
</property>
@@ -147,7 +175,7 @@ QProgressBar::chunk {background-color: #05B8CC;}</string>
147175
<rect>
148176
<x>0</x>
149177
<y>0</y>
150-
<width>700</width>
178+
<width>500</width>
151179
<height>21</height>
152180
</rect>
153181
</property>

Solidify/src/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include "stdafx.h"
1918
#include "settings.h"
19+
#include <Windows.h>
20+
#include <QtCore/QResource>
2021

2122
int main(int argc, char* argv[]) {
2223
// Allocate console and redirect std output
@@ -37,6 +38,7 @@ int main(int argc, char* argv[]) {
3738

3839

3940
QApplication app(argc, argv);
41+
Q_INIT_RESOURCE(gui);
4042
app.setWindowIcon(QIcon(":/MainWindow/sldf.ico"));
4143

4244
MainWindow window;

0 commit comments

Comments
 (0)