Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Library of useful Qt widgets. Contains double slider, progress bars, integer, double, string and date filters.

License

NotificationsYou must be signed in to change notification settings

przemek83/wble

Repository files navigation

Build & testCodeQLcodecov

Quality Gate StatusBugsCode SmellsCoverageDuplicated Lines (%)

Table of contents

Examples screenshot

Alt text

About project

Library of useful Qt widgets. Created as a result of the division of code of Volbx project and moving parts of it to an independent library. Library contains:

  • double slider
  • numeric filters (integer and double one)
  • string filter
  • date filter
  • infinity progress bar
  • counter progress bar

Getting Started

This section describes briefly how to setup the environment and build the project.

Prerequisites

Qt in version 6.5 or greater, C++ compiler with C++17 support as a minimum, and CMake 3.16+.

Building

Clone and use CMake directly or via any IDE supporting it. CMake should:

  • configure everything automatically,
  • compile and create binaries.

As a result of compilation, binary for simulations and binary for testing should be created.

TIP: Remember to set properly theCMAKE_PREFIX_PATH env variable. It should have a Qt installation path to let CMakefind_package command work.

CMake integration

UseFetchContent CMake module in your project:

include(FetchContent)FetchContent_Declare(   wble   GIT_REPOSITORY https://github.com/przemek83/wble.git   GIT_TAG v1.2.0)FetchContent_MakeAvailable(wble)

From that moment, wble library can be used in thetarget_link_libraries command:

add_executable(${PROJECT_NAME}${SOURCES})target_link_libraries(${PROJECT_NAME} shared wble)

Check my other projectVolbx for real world CMake integration.

Built with

WindowsWindowsUbuntu
OS version10 22H210 22H224.04
compilerGCC 13.1.0MSVC 19.29GCC 13.2.0
CMake3.30.23.30.23.28.3
Git2.46.02.46.02.43.0
Qt6.5.26.5.26.5.2

Usage

The easiest way is to check examples subproject, where you can find how to create and interact with each widget included in this library. Alternatively, tests subproject can be checked. Usage also can be found in my other project calledVolbx where widgets from this library are used.

Widgets

Double slider

Alt text
Each handle can be moved independently. Check also Integer and Double filters, which are wrapping double slider into handy adjustable widgets.

Filters

Each filter widget inherits fromQGroupBox. It means all filters can be checkable or not. Use standardsetCheckable() to alter behavior.

Integer filter

Alt text
Wrapped double slider into an adjustable widget. Dedicated for integer values.

Double filter

Alt text
Wrapped double slider into an adjustable widget. Dedicated for double values.

Date filter

Alt text
Widget allowing to pick custom date range. An additional "Ignore data with empty dates" check box can be used to filter out data entries with empty dates.

String filter

Alt text
Widget allowing to pick multiple string values as filtered set. Additional checkbox "Select/Unselect all" for quick unchecking/checking all string values in filter.

Progress bars

Widgets capable of showing progress of longer tasks. Can be used as a blend in widget or modal one.

Infinity progress bar

Alt text
Can be used for tasks with unknown end time. The progress bar displays moving arcs until it is stopped or destroyed.

Counter progress bar

Alt text
Can be used for tasks with a known end time. The progress bar displays an arc, which is moving from 0 toward 100 percent. In the middle, the current percent is displayed.

Testing

For testing purposes, the Qt Test framework is used. Build the project first. Make sure that thewble-tests target is built. Modern IDEs supporting CMake also support running tests with monitoring of failures. But in case you would like to run it manually, go to thebuild/tests directory, where the⁣ binarywble-tests should be available. Launching it should produce the following output on Linux:Example run:

$ ./wble-tests********* Start testing of DoubleSliderTest *********Config: Using QtTest library 6.5.2, Qt 6.5.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.3.1 20210422 (Red Hat 10.3.1-1)), ubuntu 24.04PASS   : DoubleSliderTest::initTestCase()PASS   : DoubleSliderTest::testSettingCurrentValues()PASS   : DoubleSliderTest::testEmittingCurrentMinChanged()(...)PASS   : UtilitiesTest::testGetSpanAngleCounterHalf()PASS   : UtilitiesTest::testGetSpanAngleCounterFull()PASS   : UtilitiesTest::cleanupTestCase()Totals: 10 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms********* Finished testing of UtilitiesTest *********

As an alternative, CTest can be used to run tests from thebuild/tests directory:

$ ctestTest project <path>/wble/build/tests    Start 1: wble-tests1/1 Test #1: wble-tests .......................   Passed    0.11 sec100% tests passed, 0 tests failed out of 1Total Test time (real) =   0.11 sec

Licensing

Wble library is published under a LGPL license.

The project uses the following software:

NameLicenseHomeDescription
QtLGPLv3https://www.qt.io/cross-platform application development framework

[8]ページ先頭

©2009-2025 Movatter.jp