Why aren't more desktop apps written with Qt?

來源:互聯網
上載者:User

標籤:

Ref http://programmers.stackexchange.com/questions/88685/why-arent-more-desktop-apps-written-with-qt

 

I don‘t really intend this to be a bashing answer, but these are the reasons I do not personally use Qt. There are plenty of good things to say about it -- namely that the API works most of the time, and that it does seamlessly bridge platforms. But I do not use Qt, because:
我真的不打算這是一個bashing 的答案,但這些都是我不親自使用Qt的原因。說關於它有很多好東西 - 即該API大部分時間工作,其無縫橋接平台。但我不使用Qt的,因為:
In some cases, it just doesn‘t look like native programs look. Designing a single UI for all platforms inherently is not going to look right when moved from machine to machine, for various visual styling reasons. For example, on Mac machines, split bars are usually relatively thick, and buttons are small and rounded with icons. On Windows machines, split bars are typically narrow, and buttons are more textual, with more square designs. Just because you can write one UI for every platform does not mean that you should for most applications.
在某些情況下,它看起來並不像本地程式的外表。例如,在Mac機,拆分條通常比較厚,按鈕都很小,使用圓交表徵圖。在Windows電腦上,拆分條是典型的窄,按鍵上文本更多,更多的方形設計。你可以寫一個UI為各種平台,並不意味著你適合大多數應用。
Qt is not a C++ library. It requires a separate compilation step, which makes the build process much more complicated when compared with most other libraries.
Qt是不是C ++庫。它需要一個單獨的編譯步驟,當與其他大多數庫相比,這使得構建過程複雜得多。
As a result of (2), C++ IDEs and tools can flag Qt expressions as errors, because they do not understand Qt‘s specifics. This almost forces use of QtCreator or a textual only editor like vim.
由於(2),C ++ IDE和工具可以標誌Qt的運算式為錯誤,因為他們並不瞭解Qt的特點。這幾乎是強制使用QtCreator或文字編輯器如vim。
Qt is a large amount of source, which must be present and preinstalled on any machine you use before compiling. This can make setting up a build environment much more tedious.
Qt有大量的原始碼,必須存在,並預裝在電腦上以便編譯。這可以使建立一個構建環境更加繁瑣。
It‘s available only under LGPL, which makes it difficult to use single-binary-deployment when one needs to release under a more restrictive or less restrictive license.
它只能根據LGPL,這使得它難以用單二進位部署
It produces extremely large compiled binaries when compared with similarly written "plain ol‘ native applications" (excepting of course applications written for KDE).
當與同樣寫有“純醇‘本機應用程式”(除了為KDE編寫的課程申請)相比,它產生非常大的編譯的二進位檔案。

 

 

As people say, each tool fits to each problem and situation...

But if you‘re C++ programmer, Qt is your framework. No rival.

We develop a complex medical imaging commercial application, and Qt holds on.
正如有人說,每個工具適合於每個問題的情況...

但如果你是C ++程式員,Qt是你的架構。沒有對手。

我們開發了一個複雜的醫學成像商業應用,使用Qt。

I don‘t say that the ‘cons‘ that people say about it are false, but I have the feeling that they don‘t have tried Qt for a long time (its continously improving on each new version...) And, mostly all of the issues they comment are not a problem if you take care.
我不會說大家說的“弊”是假的,但我的感覺是,他們很長一段時間沒有嘗試過的Qt(其continously提高每個新版本...),並且大多其實他們的問題並不是問題。

UI platform inconsistency: only if you use the UI widgets ‘as they are‘, with no customization or custom art.

Qt preprocessor overload: Only if you abuse of signal-slot mechanism, or QObject inheritance, when there is no really need.

By the way, We still write applications in C#.NET, and been doing it for a long time. So I think I have enouch perspective.

As I said, each tool for each situation,

but Qt is with no doubt a consistent and useful framework.


UI平台不一致性:只有當您直接使用UI組件,沒有定製的額時候。

Qt的預先處理過載:只有當你濫用訊號插槽機制,或者QObject的繼承。

順便說一句,我們仍然在寫C#.NET應用程式,並且已經做了很長一段時間。因此,我認為我有足夠的視角。

正如我所說的,每一個工具,有適合他的情況,

但Qt是毫無疑問一致和有用的架構。

 

Of all the things I don‘t like about Qt, the fact that it doesn‘t play well with templates bugs me the most. You can‘t do this:
我最不喜歡Qt的是,它的模板有bug。你不可以這樣做:
template < typename T >
struct templated_widget : QWidget
{
Q_OBJECT;

public signals:
void something_happened(T);
};
It also doesn‘t play well with the preprocessor. You can‘t do this:
預先處理也處理的不好,你不能這樣
#define CREATE_WIDGET(name,type) \
struct name ## _widget : QWidget \
{ \
Q_OBJECT; \
\
public signals: \
void something_happened(type); \
}
That, mixed with the fact that everything that responds to a signal has to be a Q_OBJECT, makes Qt hard to work in for a C++ programmer. People used to Java or Python style programming probably fair better actually.
再就是,每個需要相應訊號的都需要時Q_OBJECT,使C ++程式員很難適應Qt。使用Java或Python編程風格可能感覺好一些。

I actually spent a lot of time and effort researching and devising a way to gain type safety back and connect a Qt signal to any functor object: http://crazyeddiecpp.blogspot.com/2011/01/quest-for-sane-signals-in-qt-step-1.html
我居然花了很多的時間和精力研究和一邊找到一種方式能安全的連結qt訊號到任意的functor比如
The kind of thing I want to do there is basic, everyday C++ development made next to impossible by the Qt moc...which itself is entirely unnecessary now days, if it ever actually was.
這種事情是基本的,載入Qt的MOC ...這本身現在是完全沒有必要
Frankly though, I‘m stuck with it because if you want to do automated UI testing, Qt is pretty much the only game in town short of MFC...which is so 1980 (it sucks working in that shit really hard). Some might say WX but it‘s got even more serious problems. GTKmm would have been my first choice but since it‘s all owner drawn and doesn‘t do accessibility...can‘t be driven by industry standard testing software. Qt is hard enough in that regard (barely works when you modify the accessibility plugin).
坦率地說,雖然,我堅持了下來,因為如果你想要做的自動化UI測試,Qt是幾乎唯一的選擇。而MFC的...這是1980年的東西。而WX有更嚴重的問題。 gtkmm的將是我的第一選擇,但因為它是由一切所有者和沒有做的無障礙...無法通過行業標準的測試軟體來驅動。 Qt在這方面不錯(你幾乎沒有修改外掛程式的輔助工作)。

 

Why aren't more desktop apps written with Qt?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.