File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -64,3 +64,25 @@ http_archive(
64
64
"https://github.com/bazelbuild/buildtools/archive/refs/tags/4.2.2.tar.gz" ,
65
65
],
66
66
)
67
+ load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
68
+
69
+ git_repository (
70
+ name = "com_justbuchanan_rules_qt" ,
71
+ remote = "https://github.com/justbuchanan/bazel_rules_qt.git" ,
72
+ branch = "master" ,
73
+ )
74
+
75
+ load ("@com_justbuchanan_rules_qt//:qt_configure.bzl" , "qt_configure" )
76
+
77
+ qt_configure ()
78
+
79
+ load ("@local_config_qt//:local_qt.bzl" , "local_qt_path" )
80
+
81
+ new_local_repository (
82
+ name = "qt" ,
83
+ build_file = "@com_justbuchanan_rules_qt//:qt.BUILD" ,
84
+ path = local_qt_path (),
85
+ )
86
+
87
+ load ("@com_justbuchanan_rules_qt//tools:qt_toolchain.bzl" , "register_qt_toolchains" )
88
+ register_qt_toolchains ()
Original file line number Diff line number Diff line change
1
+ load ("@com_justbuchanan_rules_qt//:qt.bzl" , "qt_cc_library" , "qt_ui_library" )
2
+
3
+ cc_binary (
4
+ name = "main" ,
5
+ srcs = ["main.cpp" ],
6
+ copts = ["-fpic" ],
7
+ deps = [
8
+ "@qt//:qt_widgets" ,
9
+ ],
10
+ )
Original file line number Diff line number Diff line change
1
+ # How to Run:
2
+
3
+ ```bash
4
+ bazel run //examples/qt:main
5
+ ```
Original file line number Diff line number Diff line change
1
+ #include < QtWidgets/QApplication>
2
+ #include < QtWidgets/QPushButton>
3
+
4
+ auto main (int argc, char *argv[]) -> int {
5
+ QApplication app (argc, argv); // Create the QApplication object
6
+
7
+ // Create a simple push button with the text "Hello World"
8
+ QPushButton button (" Hello World" );
9
+
10
+ // Show the button
11
+ button.show ();
12
+
13
+ // Start the application's event loop
14
+ return app.exec ();
15
+ }
You can’t perform that action at this time.
0 commit comments