問題タブ [qurl]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
qt - QUrl addQueryItemをQt5のQUrlQueryにどのように移植しますか?
4ではQt
、次のコードを使用してQUrl
動作します。
注:このコードはwkhtmltopdfからのものでpostData
あり、QByteArrayです。
ただし、Qt
5にはaddQueryItem()
もう機能がありません。このコードをどのように移植しますか?
c++ - Qt での HTML フォームのエンコーディング
QUrl は URL の HTML フォームのエンコード/デコード (スペースをプラス記号としてエンコードするなど) をサポートしていないようです。この機能は Qt の別の場所にありますか、それとも別のライブラリを探す必要がありますか? 後者の場合、あなたは何を提案しますか?
c++ - QFile が file:/// URL パス形式を認識しない
次のように Qml からファイル パスを取得します。
上記のファイル パスは次のようになります: file:///C:/uuuu.a3
しかし、このパスが QFile に渡されると、文句を言います
この問題を解決するには?
c++ - QUrl にパーセント記号を含めるにはどうすればよいですか
私は今日の午後から c++ を始めたばかりで、苦労しています。
私は以下の行を持っています:
しかし、QNetworkAccessManager で使用される QUrl "コマンド" が送信されると、実際には % 記号の後に25が追加されて送信されます。QUrl が TolerantMode にあることがわかり、ユーザー入力エラーだと思って追加しています。
望ましくない結果:
URL が変更されないようにするにはどうすればよいですか?
パーセント記号を 2 倍にし、バックスラッシュも挿入しようとしました。
どんな助けでも大歓迎です。ありがとう。
c++ - HTTP POST、Qt を使用してページを選択する
オンライン サーバーで認証しようとしていますが、ダウンロードするページを選択できません。コードは次のとおりです。
Get リクエスト:
ここでポスト リクエストは、get リクエストが終了した直後に呼び出されます。
返されるエラーは次のとおりです。
その方法がわかりません。Googleで検索しても、その方法にたどり着く例しか見つかりませんでした。誰かが助けてくれたら、ありがとう。:)
qt - Convert QUrl with percent encoding into string
I use a URL entered by the user as text to initialize a QUrl object. Later I want to convert the QUrl back into a string for displaying it and to check it using regular expression. This works fine as long as the user does not enter any percent encoded URLs.
Why doesn't the following example code work?
It simply doesn't decode any of the percent-encoded characters. It should print "http://test.com/query?q=++e:xyz/en"
but it actually prints "http://test.com/query?q=%2B%2Be%3Axyz%2Fen"
.
I also tried a lot of other methods like fromUserInput() but I could not make the code work correctly in Qt5.3.
Can someone explain me how to do this and why the above code doesn't work (i.e. showing the decoded URL) even when using QUrl::FullyDecoded?
UPDATE
After getting the fromPercentEncoding() hint, I tried the following code:
This allows the user to input unicode URLs and percent-encoded URLs and it is possible to decode both kinds of URLs for displaying/matching. However the percent-encoded URLs did not work in QWebView... the web-server responded differently (it returned a different page). So obviously QUrl::fromPercentEncoding() is not a clean solution since it effectively changes the URL. I could create two QUrl objects in the above function... one constructed directly, one constructed using fromPercentEncoding(), using the first for QWebView and the latter for displaying/matching only... but this seems absurd.