Qt Quickの今後のスナック

Qtブログには、今後の5.1でのQt Quckの今後の革新についてのレビューがあります。 要するに、彼らはQMainWindowに類似したウィジェット機能を追加し、ウィジェットプロジェクトでQMLを使用できるようにしました。 このようにして、Qt Quickはアプリケーションおよびデスクトップ開発の準備ができています。



彼らは、ウィジェットで見ることに慣れているほとんどすべてのものを私たちに与えてくれました。 最初の、そしておそらく最も重要なのはリンカーです:

画像

実際に問題は何ですか。 ウィジェットでは、リンカーは表示されているウィンドウのサイズを変更する際に便利なツールです。 QMLのQt 5.1以前では、同様の機能を実装することもできましたが、今では簡単になっています。 例は、 この記事のコードです。



宛先:

ToolBar { Row { id: row spacing: 2 anchors.verticalCenter: parent.verticalCenter ToolButton { iconSource: "images/go-previous.png" } ToolButton { iconSource: "images/go-next.png" } } Slider { anchors.left: row.right anchors.leftMargin: 2 anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right } }
      
      





後:

 ToolBar { RowLayout { anchors.fill: parent spacing: 2 ToolButton { iconSource: "images/go-previous.png" } ToolButton { iconSource: "images/go-next.png" } Slider { Layout.fillWidth: true } } }
      
      







いくつかのViewクラス(または何でも)を追加しました:SplitView、ScrollView、TableView

画像

QTableViewの最後のアナログであり、これは古典的なテーブルビューです。ScrollViewはQAbstractScrollAreaのアナログの一種であり、SplitViewはQSplitterのアナログです。



追加されたクラシックコントロール:

画像

そして、彼らはあなたが好きなように曲げる機会を与えました。



そのため、次のすべてを使用するよう提案されています。

 GroupBox { id: gridBox title: "Grid layout" Layout.fillWidth: true GridLayout { id: gridLayout anchors.fill: parent rows: 3 flow: GridLayout.TopToBottom Label { text: "Line 1" } Label { text: "Line 2" } Label { text: "Line 3" } TextField { } TextField { } TextField { } TextArea { text: "This widget spans over three rows in the GridLayout.\n" + "All items in the GridLayout are implicitly positioned from top to bottom." Layout.rowSpan: 3 Layout.fillHeight: true Layout.fillWidth: true } } }
      
      





まあ、少なくともそれほど難しくはなく、最初のqml機能と一緒に、ウィジェットに忠実であり続ける意味はありません。



参照資料






All Articles