Главная | Actual Topics | Обратная связь | Guest Book | В избранное | Сделать домашней
 System & Utilities
 Unix News
 OS Emulator
Каталог статей
Все статьи

Биллу Гейтсу тоже предлагают избавиться ...
Вымогательство в борьбе со спамом

September, 2017
Какой из этих ОС Вы отдаете большее предпочтение?

Mac OS
Windows XP
Windows 2003
Что такое ОС? :)

Другие опросы

Всего голосов: 325
Комментарии: 0

Архив Новостей
 September 2017 (13)
 August 2017 (13)
 February 2017 (14)
 January 2017 (19)
 December 2016 (16)
 November 2016 (16)
 October 2016 (21)
 September 2016 (18)
 August 2016 (16)
 July 2016 (16)
 June 2016 (20)
 May 2016 (18)
 April 2016 (15)
 March 2016 (22)
 February 2016 (17)
 January 2016 (15)
 December 2015 (15)
 November 2015 (22)
 October 2015 (20)
 September 2015 (17)
 August 2015 (25)
 July 2015 (20)
 June 2015 (23)
 May 2015 (21)
 April 2015 (17)
 March 2015 (19)
 February 2015 (9)
 January 2015 (23)
 December 2014 (9)
 November 2014 (13)
 October 2014 (12)
 September 2014 (18)
 August 2014 (20)
 July 2014 (10)
 June 2014 (12)
 May 2014 (12)
 April 2014 (10)
 March 2014 (22)
 February 2014 (10)
 January 2014 (8)
 December 2013 (26)
 November 2013 (53)
 October 2013 (40)
 September 2013 (48)
 August 2013 (63)
 July 2013 (56)
 June 2013 (52)
 May 2013 (49)
 April 2013 (67)
 March 2013 (74)
 February 2013 (63)
 January 2013 (62)
 December 2012 (62)
 November 2012 (66)
 October 2012 (68)
 September 2012 (48)
 August 2012 (75)
 July 2012 (60)
 June 2012 (71)
 May 2012 (69)
 April 2012 (85)
 March 2012 (86)
 February 2012 (90)
 January 2012 (81)
 December 2011 (103)
 November 2011 (118)
 October 2011 (74)
 September 2011 (2)
 June 2011 (110)
 May 2011 (118)
 April 2011 (111)
 March 2011 (112)
 February 2011 (101)
 January 2011 (119)
 December 2010 (117)
 November 2010 (118)
 October 2010 (131)
 September 2010 (117)
 August 2010 (226)
 July 2010 (351)
 June 2010 (305)
 May 2010 (319)
 April 2010 (343)
 March 2010 (329)
 February 2010 (311)
 January 2010 (312)
 December 2009 (266)
 November 2009 (156)
 July 2009 (101)
 June 2009 (279)
 May 2009 (365)
 April 2009 (348)
 March 2009 (347)
 February 2009 (323)
 January 2009 (318)
 December 2008 (237)
 November 2008 (155)
 October 2008 (334)
 September 2008 (310)
 August 2008 (343)
 July 2008 (362)
 June 2008 (322)
 May 2008 (634)
 April 2008 (1276)
 March 2008 (1658)
 February 2008 (250)
 January 2008 (6)
 November 2007 (1)
 September 2007 (1)
 June 2007 (1)
 May 2007 (1)
 March 2007 (1)
 January 2007 (2)
 December 2006 (1)
 October 2006 (2)
 September 2006 (1)
 August 2006 (2)

Native look and feel

System & Utilities

We know that many Qt users want controls styled with a native look-and-feel. But offering that on platforms with no public styling API, is hard. A classic approach is to take snapshots of the native controls, tweak them, and use them as foreground or background in our own controls. Which is somewhat OK for static appearances. But when animations and transitions are involved, static pixmaps will only take you half the way. And since an OS can change style from one update to the next, taking snapshots runtime is risky. Using pre-grabbed snapshots is also something we don’t do because of legal considerations.

Since December last year, the controls team has been researching a bit small scale on a new project to offer controls with true native look-and-feel. The aim is to do the alternative to the above standing, and explore how feasible it would be to wrap actual native controls into a cross platform Qt API. Such ideas is nothing new of course, and have been discussed many times, at least internally. One of the problems is that different platforms can vary quite much API-wise, especially for more complex controls like tab-, and split views, with some having a rich API, while others are more limited. And unifying that into a common useable Qt API is a challenge.

Currently we have prototyped a set of controls, together with a plugin-based framework and a few backends for testing (uikit, appkit, android). The API is small and strict so that it can be realized on all supported (and future) platforms. As such, the controls become rather black box, since we cannot make assumptions on how they are implemented by the backends. Still, there will be times when you need to detail how your application should work on a specific platform. For that reason we plan to open up, and factor out, the various backends into separate libraries that can be accessed directly. Those libraries will wrap parts of the native APIs more closely, and offer building blocks specific to the platform, or controls with a broader set of functions and properties. They will be more open than the common controls, giving access to the native controls they wrap, to let you dig into to native development whenever you need to fill gaps that falls outside our own scope. In the end, it should be easy and straightforward to mix cross-platform controls, platform-specific controls, and native code in your application.

I’ve mentioned “APIs” a couple of times. This of course includes QML. But we also plan to offer direct access to the underlying C++ libraries, making it easy to extend the API, and write application using C++ only. That way you can choose whether you want to use QML, C++, or a combination.

Here is a snippet showing how things look so far. The app mixes a couple of cross-platform controls (common controls) together with a control directly from the AppKit backend.

import QtQml 2.0
import Qt.CommonControls 1.0 as Common
import Qt.AppKitControls 1.0 as AppKit

Window {
id: window
visible: true

Common.Button {
id: button
x: 20
y: 20
text: \"Click me\"
onClicked: text =\"You clicked me!\"

Common.TextField {
id: textField
placeholderText: \"TextField\"
x: 20
y: button.bottom + 8

AppKit.SearchField {
placeholderText: \"Search\"
x: 20
y: textField.bottom + 8

The next snippet shows the same app, but this time in C++

int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QCommonWindow window;

QCommonButton commonButton(QStringLiteral(\"Click me\"), &window);
commonButton.move(20, 20);
QObject::connect(&commonButton, &QCommonButton::clicked, [&commonButton](){

QCommonTextField textField(&window);
textField.move(20, commonButton.bottom() + 8);

#if defined(Q_OS_MACOS)
QAppKitSearchField searchField;
searchField.move(20, textField.bottom() + 8);
NSSearchField *nsSearchField = searchField.nsSearchFieldHandle();
nsSearchField.placeholderString = @\"Search...\";

return app.exec();

As mentioned, we plan to keep the API rather strict. The common controls will only contain the basics, with few, or no possibilities for tweaking the style, catching internal events, or overriding default behaviour. You basically get native controls with native look, feel and behaviour. If you, on the other hand, need custom styling, or your own custom controls, Qt offer solutions like QtQuickControls2, or Widgets, for that already. Our current thinking is that this module will be something for Qt6.

The post Native look and feel appeared first on Qt Blog.


Разместил: Planet KDE | Дата: 06.02.2017 | Прочитано: 279 | Раздел: System & Utilities   

Рейтинг статьи

Средняя оценка: 0.00/0Средняя оценка: 0Всего голосов:0

Хорошо Нормально Пойдёт Плохо

Смотрите также связанные темы

28.02.2008 www/tomcat-native - 1.1.13
Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets). These features allows making Tomcat a general purposewebserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver plat...
28.02.2008 devel/rhtvision - 2.0.3_2
Fix the homegrew ar(1) detection on 8.0 by adding FreeBSD to the list of platforms with native ar(1). Submitted by: kaiw
02.03.2008 x11/nvidia-driver - 169.07
- Fix the build with OS-native (FreeBSD) AGP support - Correct textual typo in comments while here
15.04.2008 emulators/linux_base-f8 - 8_2
Remove all traces of LINUXBASE/etc/fonts from the port. This is needed to use native FreeBSD fonts and font configuration files (a link to a native directory will be created when an apropriate linux-fontconfig port is installed).
20.06.2008 Virtual web servers scale better than native
Link: Scaling real-life Web server workloads Most real life web server workloads suffer from scalability issues such as those observed in our tests. In order to circumvent these issues, lots of businesses choose to deploy web server workloads on a...
27.06.2008 Scaling real-life Web server workloads
In an earlier blog, we compared the performance aspects (such as latency, throughput and CPU resource utilization) of real-life web server workloads in a native environment and a virtualized data center environment. In this post, we focus on yet another...
15.08.2008 Updated U2 releases out; letter from Paul; build numbers
In case you've been at the beach this week (lucky you!), please feel free to read this letter regarding the problems this week with ESX 3.5 U2. Link: VMware: The Console: Letter from VMware CEO Paul Maritz. Express patches were...
19.08.2008 Chocolatier TCHO Uses VMware Fusion to Seamlessly Run Macintosh Apps and Windows-Based apps on Mac Desktops
Virtualization Allows Confectioner to Benefit from Productivity and Creativity of the Mac and Address the Business Imperative for Robust Windows Environment . PALO ALTO, Calif. -- August 18, 2008 -- VMware, Inc. (NYSE: VMW), the global leader in virtualization solutions from the desktop to the datacenter, today announced that TCHO, an emerging and innovative manufacturer of premium chocolate, has deployed VMware Fusion across the company’s Macintosh desktop systems to provide its staff with the flexibility to move seamlessly between native Macintosh applications and virtualized Windows-based a...
20.10.2008 Memory overcommit and more: Communities Roundtable #21
Upcoming Communities Roundtable podcasts. Please feel free to tune in live -- we take questions from chat & phone, or listen to the recording afterwards. Wednesday, October 22, Noon PDT. vCloud Wednesday, October 29, Noon PDT. VMware Server 2.0 Wednesday,...
10.12.2008 Google представила Native Client как ответ на Flash и Java
Компания Google представила свой очередной Open Source-проект, призванный стать конкурентом таким популярным для Web-окружения технологиям, как Flash, ActiveX и Java...
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search


Топ Новостей
1: KDE Community announces fully open source Plasma Mobile
Просмотров - 547

2: Using Digikam and ownCloud to share family pictures
Просмотров - 517

3: Apply agile methodologies to upstream development environments.... if you can.
Просмотров - 492

4: KWallet5 can be auto-unlocked during login again
Просмотров - 479

5: Interview with Laura
Просмотров - 454

6: Use ownCloud provided Packages, then VM, then Zip, no distro packages.
Просмотров - 451

7: Plasma Components on Android: Accelerating Subsurface Mobile Development
Просмотров - 441

8: VMware Workstation 11 and kwin - hangs and hiccups (solved?)
Просмотров - 420

9: debian/rake: Ruby DH Sequencing?
Просмотров - 420

10: Plasma 5 Powers KaOS Productivity
Просмотров - 410

11: KWrite on Mac – Application Bundle
Просмотров - 404

12: One year old: Document Liberation Project
Просмотров - 385

13: FOSDEM Desktops DevRoom 2016 Call for Participation
Просмотров - 383

14: New Year Calligra Words Sprint
Просмотров - 380

15: digiKam 5.0.0-beta2 is released
Просмотров - 378

Google 120X240

Главная | Actual Topics | Статьи | Обратная связь | Guest Book
Генерация: 1.352 сек. и 13 запросов к базе данных за 1.304 сек.
Powered by SLAED CMS © 2005-2007 SLAED. All rights reserved.