Irc-Unix.net

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

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

November, 2017
ПнВтСрЧтПтСбВс
12345
6789101112
13141516171819
20212223242526
27282930
Опросы
Какой из этих ОС Вы отдаете большее предпочтение?

QNX
FreeBSD
Linux(any)
Solaris
Mac OS
Windows XP
Windows 2003
Что такое ОС? :)


Результаты
Другие опросы

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

Архив Новостей
 November 2017 (7)
 October 2017 (18)
 September 2017 (18)
 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 (604)
 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](){
commonButton.setText(QStringLiteral(\"Clicked!\"));
});

QCommonTextField textField(&window);
textField.setPlaceholderText(QStringLiteral(\"TextField\"));
textField.move(20, commonButton.bottom() + 8);

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

window.showFullScreen();
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 | Прочитано: 312 | Раздел: System & Utilities   

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

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

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


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

16.10.2017 В СУБД CockroachDB 1.1 улучшили возможности для администраторов и производительность
В четверг было представлено первое обновление свободной СУБД CockroachDB после выпуска её первого готового к production релиза пять месяцев назад — версия 1.1. CockroachDB — молодая СУБД, ориентированная на использование облачными (cloud native) приложениями и призванная «совмещать богатство функциональности SQL с горизонтальной доступностью, привычной для NoSQL». Её код и некоторые идеи базируются на разработках другой свободной СУБД — PostgreSQL. Основными направлениями, над которыми работали…
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,...
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search
Google

Web irc-unix.net

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


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

3: Interview with Laura
Просмотров - 489

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

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

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

7: Plasma 5 Powers KaOS Productivity
Просмотров - 443

8: KWrite on Mac – Application Bundle
Просмотров - 437

9: New Year Calligra Words Sprint
Просмотров - 415

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

11: digiKam 5.0.0-beta2 is released
Просмотров - 410

12: Interview with Pierre Geier
Просмотров - 401

13: back in the habit
Просмотров - 394

14: Kexi 3
Просмотров - 393

15: Amarok is slowly catching up
Просмотров - 386

Google 120X240
Ссылки

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