問題タブ [qtcore]
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.
c++ - QString から char* への変換
次の方法で QString を char* 型に変換しようとしましたが、うまくいかないようです。
この方法で考えられる欠陥を詳しく説明するか、別の方法を教えてください。
qt - Qt:*。proと* .pri
qmakeの設定ファイル*.proとの違いは何ですか?*.pri
* .proファイルには何を入れ、*。priファイルには何を入れる必要がありますか?
c++ - QByteArrayからQString
とに問題がQByteArrayありQStringます。
私はファイルを読んでいて、その情報をに保存していますQByteArray。ファイルはUnicodeであるため、次のようなものが含まれています。t\0 e\0 s\0 t\0 \0 \0
この値を指定した値と比較しようとしていますが、デバッガーでユニコード文字列ではないことがわかるため、失敗します。
コードはすべてを説明します:
デバッガーでは、変数Dataに値があり、値が"t\0 e\0 s\0 t\0 \0 \0"であることが示されてmyValueいます"test"。どうすれば修正できますか?
c++ - Can't call slot or Q_INVOKABLE from QML in subclass of QQmlPropertyMap
I'm trying to test drive the QQmlPropertyMap class. It seems like it might work well for what I want, if I can subclass it. The documentation here even gives some rudimentary instructions on what to do for subclassing it. Said documentation also indicates that this class derives from QObject.
For what it's worth, I'm using QtCreator 2.6.1 on Qt 5.0.0 with QtQuick 2.0.
My main.qml:
My main.cpp:
My TestMap.h
When I run, I get a window saying "value", as I'd expect. But when I click on the window, I get a console output saying
I've looked for similar problems, but all the search results are about people that forgot to include the Q_OBJECT macro. It must be something I'm doing wrong in the code, because if I make all the changes indicated in the comments of the TestMap file (and leave the main.cpp and main.qml exactly as is), I get the qDebug message I expect.
I'm not sure whether I'm supposed to Q_DECLARE_METATYPE or not (I think the 2-arg protected constructor is supposed to do it for me), but it doesn't work either way.
For the record, the only things I have to change to get it to work are:
1) Derive from QObject instead of QQmlPropertyMap.
2) Change the constructor to:
And that's it. Since it works when I don't change anything about the main.cpp, main.qml, or the slot itself, I have to conclude it's nothing wrong with those. Can anyone tell me what I'm doing wrong?
c++ - Qt 同期プリミティブを非 QThread スレッドで使用できますか?
QSemaphoreたとえば、 boost スレッドまたは c++ 11 スレッドで使用したいと考えています。それは許されますか?
c++ - QString[] と QStringList の違いは何ですか
QStringList のオブジェクトと QStrings の配列の違いは何ですか? どちらも配列として動作するようです。
qt - Qt リンカー エラー: -lQtCored が見つかりません
Qt *.pro ファイルの問題:
次のリンカ エラーが発生します。
指定したディレクトリにすべての DLL が存在します。
ドキュメントはあまり役に立ちませんでした。
この pro ファイルは数日前に機能しましたが、Qt 5.1 をインストールしてから問題が発生しているようです (これはまだ使用されていません。私はまだ Qt4 を使用しています)。
プラットフォーム: Windows 7、MinGW、Qt 4.8.4
c++ - 文字列から float への変換とフォーマット
現在、私はこのようなものを持っています
現在、フロートは 2.3690000031..
私が欲しいのは2.3700000000です..どうすればそれができるかについての提案はありますか? また、2.37 ではなく 2.369 になっているのはなぜですか?
c++ - C++/Qt で HTML を解析するには?
次のHTMLを解析するにはどうすればよいですか
www.testtest.com から style="font-size:11px" を使用して "span" からデータ "12345" を取得したいのですが、そのデータだけが必要で、他には何も必要ありません。
どうすればこれを達成できますか?