-
Notifications
You must be signed in to change notification settings - Fork 51
Web engine #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
snuk182
wants to merge
1
commit into
rust-qt:main
Choose a base branch
from
snuk182:web_engine
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Web engine #134
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
qt_ritual_build::run("qt_web_engine"); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
qt_ritual_build::run("qt_web_engine_widgets"); | ||
} |
12 changes: 12 additions & 0 deletions
12
qt_ritual/crate_templates/qt_web_engine_widgets/tests/q_web_engine.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use qt_web_engine_widgets::{qt_core::{QUrl, QString}, qt_widgets::QApplication, QWebEngineView}; | ||
|
||
#[test] | ||
fn web1() { | ||
QApplication::init(|_| unsafe { | ||
let web = QWebEngineView::new_0a(); | ||
web.load(&QUrl::from_user_input_1a(&QString::from_std_str("https://www.rust-lang.org"))); | ||
let url = web.url().url_0a().to_std_string(); | ||
assert_eq!(&url, "https://www.rust-lang.org"); | ||
0 | ||
}) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use ritual::config::Config; | ||
use ritual::cpp_data::CppPath; | ||
use ritual::rust_info::RustPathScope; | ||
use ritual::rust_type::RustPath; | ||
use ritual_common::errors::Result; | ||
|
||
/// QtWebEngine specific configuration. | ||
pub fn web_engine_config(config: &mut Config) -> Result<()> { | ||
let namespace = CppPath::from_good_str("QtWebEngine"); | ||
config.set_rust_path_scope_hook(move |path| { | ||
if path == &namespace { | ||
return Ok(Some(RustPathScope { | ||
path: RustPath::from_good_str("qt_web_engine"), | ||
prefix: None, | ||
})); | ||
} | ||
Ok(None) | ||
}); | ||
Ok(()) | ||
} | ||
|
||
/// QtWebEngineWidgets specific configuration. | ||
pub fn web_engine_widgets_config(config: &mut Config) -> Result<()> { | ||
let namespace = CppPath::from_good_str("QtWebEngineWidgets"); | ||
config.set_rust_path_scope_hook(move |path| { | ||
if path == &namespace { | ||
return Ok(Some(RustPathScope { | ||
path: RustPath::from_good_str("qt_web_engine_widgets"), | ||
prefix: None, | ||
})); | ||
} | ||
Ok(None) | ||
}); | ||
Ok(()) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.52.1 | ||
1.81.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
FROM debian:buster as qt_downloader | ||
RUN apt-get update | ||
RUN apt-get install -y python3-bs4 p7zip-full | ||
RUN apt-get install -y python3-bs4 p7zip-full ca-certificates | ||
RUN mkdir -p /opt/qt | ||
WORKDIR /opt/qt | ||
COPY scripts/install_qt.py / | ||
RUN /install_qt.py 5.9.7 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.9.7 --docs && \ | ||
/install_qt.py 5.11.3 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.11.3 --docs && \ | ||
/install_qt.py 5.12.2 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.12.2 --docs && \ | ||
/install_qt.py 5.13.0 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.13.0 --docs && \ | ||
/install_qt.py 5.14.0 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.14.0 --docs | ||
/install_qt.py 5.14.0 --docs && \ | ||
/install_qt.py 5.15.2 linux_x64 gcc_64 && \ | ||
/install_qt.py 5.15.2 --docs | ||
|
||
FROM ritual_builder | ||
COPY --from=qt_downloader /opt/qt /opt/qt | ||
COPY scripts/qt_env.sh /bin/qt_env | ||
|
||
RUN apt-get install -y libxrender1 libfontconfig libxkbcommon-x11-0 mesa-common-dev xvfb | ||
RUN apt-get install -y libxrender1 libfontconfig libxkbcommon-x11-0 mesa-common-dev xvfb libnss3-dev libxcomposite-dev libxcursor-dev libxi-dev libxtst-dev libxrandr-dev libasound2-dev | ||
RUN mkdir /tmp/run && chmod 0700 /tmp/run | ||
RUN qt_env /opt/qt/5.15.2/gcc_64 | ||
ENV XDG_RUNTIME_DIR=/tmp/run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
QT_DIR="$1" | ||
|
||
# Set Qt environment variables | ||
export PATH="$QT_DIR/bin:$PATH" | ||
export LD_LIBRARY_PATH="$QT_DIR/lib:$LD_LIBRARY_PATH" | ||
export QT_QPA_PLATFORM_PLUGIN_PATH="$QT_DIR/plugins" | ||
export QML2_IMPORT_PATH="$QT_DIR/qml" | ||
|
||
echo "Qt environment variables set for: $QT_DIR" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be improved by a parameter. Since X cannot be started in a Docker env, every GUI test fails.