File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ DECLARE_STATIC_LOGGER(logger, "build.self");
2222
2323using TargetEntryPointMap = std::unordered_map<sw::PackageId, std::shared_ptr<sw::NativeBuiltinTargetEntryPoint>>;
2424
25+ #define SW_DRIVER_ADD_SELF
2526#include < build_self.generated.h>
2627
2728namespace sw
Original file line number Diff line number Diff line change 1+ #include " mainwindow.h"
2+
3+ #include < qapplication.h>
4+ #include < qglobal.h>
5+ #include < qthread.h>
6+
7+ #ifdef QT_STATIC
8+ #include < QtPlugin>
9+ Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin)
10+ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)
11+ #endif
12+
13+ #include < time.h>
14+
15+ #ifdef WIN32
16+ #include < Windows.h>
17+ #endif
18+
19+ void win32_hacks ();
20+
21+ int main (int argc, char *argv[])
22+ {
23+ win32_hacks ();
24+ qsrand (time (0 ));
25+
26+ QThread t (0 );
27+ QApplication a (argc, argv);
28+ MainWindow w;
29+ w.show ();
30+
31+ return a.exec ();
32+ }
33+
34+ void win32_hacks ()
35+ {
36+ #ifdef WIN32
37+ SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
38+ #endif
39+ }
Original file line number Diff line number Diff line change 1+ #include " mainwindow.h"
2+
3+ MainWindow::MainWindow (QWidget *parent)
4+ : QMainWindow(parent)
5+ {
6+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < qmainwindow.h>
4+
5+ class MainWindow : public QMainWindow
6+ {
7+ Q_OBJECT
8+ public:
9+ MainWindow (QWidget *parent = 0 );
10+ };
Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ void build(Solution &s)
232232 }
233233 }
234234
235+ #ifndef SW_DRIVER_ADD_SELF
235236 auto &client = p.addTarget <ExecutableTarget>(" sw" );
236237 {
237238 client.PackageDefinitions = true ;
@@ -280,7 +281,7 @@ void build(Solution &s)
280281 }
281282 }
282283
283- /* auto &gui = client.addTarget<ExecutableTarget>("gui");
284+ auto &gui = client.addTarget <ExecutableTarget>(" gui" );
284285 {
285286 gui.PackageDefinitions = true ;
286287 gui.SwDefinitions = true ;
@@ -290,11 +291,16 @@ void build(Solution &s)
290291 gui += " org.sw.demo.qtproject.qt.base.winmain-*" _dep;
291292 gui += " org.sw.demo.qtproject.qt.base.plugins.platforms.windows-*" _dep;
292293 gui += " org.sw.demo.qtproject.qt.base.plugins.styles.windowsvista-*" _dep;
293-
294- if (auto L = gui.getSelectedTool()->as<VisualStudioLinker>(); L)
294+
295+ #ifdef SW_CPP_DRIVER_API_VERSION
296+ if (auto L = gui.getSelectedTool ()->as <VisualStudioLinker*>(); L)
297+ #else
298+ if (auto L = gui.getSelectedTool ()->as <VisualStudioLinker>(); L)
299+ #endif
295300 L->Subsystem = vs::Subsystem::Windows;
296301
297302 qt_moc_rcc_uic (" org.sw.demo.qtproject.qt-*" _dep, gui);
298303 qt_tr (" org.sw.demo.qtproject.qt-*" _dep, gui);
299- }*/
304+ }
305+ #endif
300306}
You can’t perform that action at this time.
0 commit comments