問題描述
我正在編寫一個相當大且復雜的數據分析程序,我已經到了我認為是時候為程序構建 GUI 的時候了.所以我的問題是:
I am writing a fairly large and complex data analysis program and I have reached the point where I think it is about time to build a GUI for the program. So my question is:
我應該使用哪個 GUI 工具包?
Which GUI toolkit should I use?
我對編碼和構建 GUI 完全陌生,希望能提供任何指導.它不必是世界上最簡單的工具包,我學得相當快.但是,它確實需要能夠執行以下操作(如果不是全部的話,對于任何給定的工具包來說,如果不是全部的話,其中一些可能是非常基礎的,但我認為最好將所有這些都扔掉以防萬一).
I am completely new to coding and building GUIs and would appreciate any guidance that can be offered. It doesn't have to be the simplest tool kit in the world, I learn rather fast. However, it does need to be able to do the following things (some if not all of these are probably incredibly basic for any given toolkit but I thought that it would be good to throw all this out there just in case).
它必須允許我直接在屏幕上繪制,以便我可以將圖形(實際上是光譜)、繪圖和類似的東西放到用戶面前.我需要能夠收集有關他們點擊上述光譜的位置的位置信息.我需要能夠顯示文本并從用戶那里獲取文本輸入.它需要能夠生成菜單(您知道文件、編輯等).如果它有一些內置的小部件來生成表格,那會很方便(盡管如果我可以直接在屏幕上繪制,我可以克服它的不足).它需要能夠彈出警告、對話框、保存和打開框等.差不多就是這樣,當我寫出它們時,其中大部分看起來都很基本,但我不想讓 GUI 部分編碼和然后意識到我需要用不同的工具包重寫它.
It has to allow me to draw directly to the screen so that I can put graphs (spectra really), plots and things like them up for the user to see. I need to be able to collect position information on where they clicked on aforementioned spectra. I need to be able to display text and take text input from the user. It needs to be able to generate menus (you know File, Edit, etc). If it were to have some built in widget for generating tables that would be handy (though I can surmount a lack of that if I can draw directly to the screen). It needs to be able to pop up warnings, dialogue boxes, save and open boxes, etc. That is pretty much it, most of these seem pretty basic when I write them out but I don't want to get the GUI partly coded and then realize that I I need to rewrite it with a different toolkit.
應該注意的是,我已經用 C++ 編寫了這個程序,我不想必須用 C 或其他東西來編寫 GUI 部分,所以工具包需要支持 C++.
It should be noted that I have written this program in C++ and that I don't want to have to write the GUI part in C or something else so the toolkit needs to support C++.
此外,跨平臺工具包比單一平臺工具包更可取.但是,如果它必須是一個單一平臺的工具包,那么我更喜歡它用于 Linux.
Additionally a cross platform toolkit would be preferable over a single platform toolkit. However if it must be a single platform toolkit then I would prefer it be for Linux.
最后,與閉源工具包相比,我更喜歡開源工具包.
Finally, I would DRAMATICALLY prefer an open source toolkit to a closed source toolkit.
除此之外,我想不出要補充的內容.提前感謝您的時間和答案.
Beyond that I cannot think of anything to add. Thank you in advance for your time and answers.
嗯,根據答案,我將同時查看 Qt 和 wxWidgets,看看哪個更吸引我.我可以接受多個答案,但我不能接受,而且由于我正在考慮兩件事,因此只接受其中一個答案是不公平的,也許在一兩周內,然后我查看了工具包并認為我想用哪個.
Hmmm based on the answers I shall look at both Qt and wxWidgets and see which appeals to me more. I with I could accept multiple answers as accepted but I can't, and since I am looking at two things it would be unfair to only accept one of the answers, perhaps in a week or two then I have looked at the toolkits and figured out which I want to use.
推薦答案
對于 C++,在我看來,Qt 是最不令人沮喪且功能最齊全的工具包.它也完全跨平臺.請注意,Qt 將在 2009 年 3 月的某個時間獲得 LGPL 許可,屆時 4.5 版可用.目前,它僅以 GPL 和商業許可版本提供.
For C++, in my opinion, Qt is the least frustrating and most fully featured toolkit. Its also fully cross platform. Note that Qt will be LGPL licensed some time in March 2009, when version 4.5 becomes available. Currently, its only offered in a GPL and commercial license version.
Qt 的 GUI 設計器很好.它有很多實用功能(場景圖庫、翻譯支持、內置Javascript引擎、內置WebKit庫).通過 MOC(一種特殊的預編譯器),它還為 C++ 帶來了一些運行時綁定功能和內省.
Qt's GUI designer is good. It has lots of utility functions (scene graph library, translation support, built-in Javascript engine, built-in WebKit library). Via the MOC (a special pre-compiler) it also brings a few run-time binding capabilities and introspection to C++.
對于您的技術應用程序,您可能會發現 Qwt (http://qwt.sourceforge.net/)提供您所需要的.它建立在 Qt 之上.
For your technical application, you might find that Qwt (http://qwt.sourceforge.net/) provides what you need. It is built upon Qt.
如果您想要 Qt 的實用程序支持(例如網絡等)而無需 GUI,則它甚至可以無頭"使用.
Qt can even be used "headless" if you want its utility support (such as networking, etc) without a GUI.
另一個跨平臺的 C++ 選項是 wxWidgets,它可用但與 Qt 沒有真正的可比性.它是一個低得多的工具包,并不容易使用或全面.Gtkmm 是另一種選擇,本著 GTK+ 的精神.
The other cross platform C++ option is wxWidgets, which is usable but not really comparable to Qt. Its a much lower level toolkit, and isn't as easy to use or fully rounded. Gtkmm is another option, in the spirit of GTK+.
這篇關于Gui 工具包,我應該使用哪個?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!