GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing techbase.kde.org — KDE Frameworks - KDE TechBase The KDE Frameworks, are a collection of libraries that are built on top of Qt and provide everything from simple utility classes, additional data models and widgets to asynchronous and network-transparent I/O. If Qt itself doesn't provide a certain functionality or feature, chances are, there's a KDE Framework for that. While KDE Frameworks do serve as the basic building blocks of KDE software, they can be used by any Qt application just like any third-party Qt add-on library. Like any other KDE software, KDE Frameworks use CMake as a build system, but using them with QMake is possibe, too. Many frameworks are available on multiple operating systems such as Linux, Windows, macOS and Android. Be sure to check each framework's documentation for their supported platforms. Guarantees and LicenseAll KDE Frameworks follow strict quality standards and offer source and binary compatibility. Most KDE Frameworks are licensed under LGPL, while a few are BSD/MIT licensed. This makes them usable for about any type of software. Information
Please see the release announcements for more information about the current Frameworks version.
OrganizationEach of the KDE Frameworks has a Tier and a Type, as you will see in the API documentation. While not critical to using the frameworks, this organization can help developers in determining the frameworks' dependencies. Tiers group the frameworks according to what they link to during compilation.
Types, on the other hand, refer to the framework's runtime dependencies:
Quick Start GuideHow easy is it to use KDE Frameworks 5? Just as easy as using any Qt widget or adding any C++ library to your project. You don't even have to switch away from QMake if that's your cup of tea. Here's one very quick and dirty example of how simple it is to use a framework. Note
The example below is written just for demonstration purposes and does not reflect proper coding practices or conventions. For more in-depth examples, please check our Tutorials section.
Step 1: Install the Framework you needFor this example, we'll be using the KDatePicker widget from the KWidgetsAddons framework. On KDE Neon/Ubuntu/Debian, it's as simple as: sudo apt install libkf6widgetsaddons-dev (The equivalent command in Fedora/Red Hat and derivative distributions is sudo dnf install kf6-kwidgetsaddons-devel .) Adjust according to your Linux distro's packaging system, of course. If you want the latest version of the framework and it isn't available from your distro, you will have to get it from the source (Git or tarball) and build it yourself. Check out the KDE Community's handy guide to building KDE software from source. Step 2: Add the Framework to your ProjectAdd the Framework's name, properly capitalized, in your QMake project file just like you would any other Qt module. TEMPLATE = app TARGET = kdatepicker-example QT += core widgets KWidgetsAddons SOURCES += main.cpp If you're already using CMake as your build system of choice, you'll want to also grab the Extra CMake Modules made by the KDE community to provide modules and macros to make finding and linking to Frameworks so much easier. Step 3: Use the FrameworkKDatePicker, like many other widgets from KDE Frameworks, behave just like any Qt widget. As such, you can simply slot them in or use them in Qt projects with no problem at all. Here is a contrived example where selecting a date from the calendar widget displays its string representation on the label beside it. #include <KDatePicker> #include <QApplication> #include <QLabel> #include <QHBoxLayout> int main(int argc, char* argv[]) { QApplication app(argc, argv); QWidget* window = new QWidget; QLabel* dateLabel = new QLabel(QDate::currentDate().toString()); KDatePicker* datePicker = new KDatePicker; QObject::connect(datePicker, &KDatePicker::dateSelected, [=] (const QDate &dateSelected) { dateLabel->setText(dateSelected.toString()); }); QHBoxLayout* layout = new QHBoxLayout; layout->addWidget(dateLabel); layout->addWidget(datePicker); window->setLayout(layout); window->show(); return app.exec(); } Just build the project as normal and that's it! Welcome to the wonderful world of KDE-powered software! Frameworks SamplerNow that you've seen how easy it is to add KDE Frameworks into your software, here's an appetizer of the various frameworks available and what they can do for you.
Important LinksRetrieved from "https://techbase.kde.org/index.php?title=KDE_Frameworks&oldid=107373" |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |