Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijit Kundu committed Dec 1, 2014
0 parents commit 2b9f84b
Show file tree
Hide file tree
Showing 147 changed files with 35,700 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Ignores 'build' in any sub folder
build/
53 changes: 53 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
PROJECT(QtPropertyBrowser)

########################### Misc. Configs ##############################
# Add custom cmake files folder
SET (PROJECT_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake)
SET (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_CMAKE_DIR}")



##################### Look for required libraries ######################

# Add QT dependencies
INCLUDE(AddQt)
IF (NOT QT_FOUND)
MESSAGE(FATAL "We Need some QT")
ENDIF()

#-----------------------------------------------------------------------------
# Subdirectories
#
ADD_SUBDIRECTORY(src)

OPTION (BUILD_EXAMPLES "Build Examples" ON)
IF(BUILD_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()

#-----------------------------------------------------------------------------
# Generate QtPropertyBrowserConfig file
#
CONFIGURE_FILE(UseQtPropertyBrowser.cmake.in
${QtPropertyBrowser_BINARY_DIR}/UseQtPropertyBrowser.cmake COPYONLY)

INCLUDE(GenerateQtPropertyBrowserConfig.cmake)


MESSAGE(STATUS "===============================================================")
MESSAGE(STATUS "================ Configuration Summary ======================")
MESSAGE(STATUS "Project Name: ${PROJECT_NAME}")
MESSAGE(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Build type Flags: ${CMAKE_BUILD_TYPE_FLAGS}")
MESSAGE(STATUS "C++ compile flags: ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "Install Path: ${CMAKE_INSTALL_PREFIX}")
MESSAGE(STATUS "Build Examples: ${BUILD_EXAMPLES}")
IF(QT_FOUND )
MESSAGE(STATUS "QT Version: ${QT_VERSION_STRING}")
MESSAGE(STATUS "QT_TARGETS: ${QT_TARGETS}")
MESSAGE(STATUS "QT_ALL_TARGETS: ${QT_ALL_TARGETS}")
MESSAGE(STATUS "QT_INCLUDE_DIRS: ${QT_INCLUDE_DIRS}")
MESSAGE(STATUS "QT_COMPILE_DEFS: ${QT_COMPILE_DEFS}")
ENDIF()
59 changes: 59 additions & 0 deletions GenerateQtPropertyBrowserConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
###########################################################################
#
# Library: CTK
#
# Copyright (c) Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.commontk.org/LICENSE
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################

#-----------------------------------------------------------------------------
# Settings shared between the build tree and install tree.


#-----------------------------------------------------------------------------
# Settings specific to the build tree.

# The "use" file.
SET(QtPropertyBrowser_USE_FILE ${QtPropertyBrowser_BINARY_DIR}/UseQtPropertyBrowser.cmake)

# Determine the include directories needed.
SET(QtPropertyBrowser_INCLUDE_DIRS_CONFIG
${QtPropertyBrowser_SOURCE_DIR}/src
)

# Library directory.
SET(QtPropertyBrowser_LIBRARY_DIRS_CONFIG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

# Runtime library directory.
SET(QtPropertyBrowser_RUNTIME_LIBRARY_DIRS_CONFIG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

# Build configuration information.
SET(QtPropertyBrowser_CONFIGURATION_TYPES_CONFIG ${CMAKE_CONFIGURATION_TYPES})
SET(QtPropertyBrowser_BUILD_TYPE_CONFIG ${CMAKE_BUILD_TYPE})

#-----------------------------------------------------------------------------
# Configure QtPropertyBrowserConfig.cmake for the build tree.
CONFIGURE_FILE(${QtPropertyBrowser_SOURCE_DIR}/QtPropertyBrowserConfig.cmake.in
${QtPropertyBrowser_BINARY_DIR}/QtPropertyBrowserConfig.cmake @ONLY IMMEDIATE)

#-----------------------------------------------------------------------------
# Settings specific to the install tree.

# TODO

#-----------------------------------------------------------------------------
# Configure QtPropertyBrowserConfig.cmake for the install tree.

# TODO
60 changes: 60 additions & 0 deletions QtPropertyBrowserConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
###########################################################################
#
# Library: CTK
#
# Copyright (c) Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.commontk.org/LICENSE
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################

#
# QtPropertyBrowserConfig.cmake - QtPropertyBrowser CMake configuration file for external projects.
#
# This file is configured by QtPropertyBrowser and used by the
# UseQtPropertyBrowser.cmake module to load QtPropertyBrowser's settings
# for an external project.

# The QtPropertyBrowser include file directories.
SET(QtPropertyBrowser_INCLUDE_DIRS "@QtPropertyBrowser_INCLUDE_DIRS_CONFIG@")

# The QtPropertyBrowser library directories. Note that if
# QtPropertyBrowser_CONFIGURATION_TYPES is set (see below) then these directories
# will be the parent directories under which there will be a directory
# of runtime binaries for each configuration type.
SET(QtPropertyBrowser_LIBRARY_DIRS "@QtPropertyBrowser_LIBRARY_DIRS_CONFIG@")

# The QtPropertyBrowser runtime library directories. Note that if
# QtPropertyBrowser_CONFIGURATION_TYPES is set (see below) then these directories
# will be the parent directories under which there will be a directory
# of runtime libraries for each configuration type.
SET(QtPropertyBrowser_RUNTIME_LIBRARY_DIRS "@QtPropertyBrowser_RUNTIME_LIBRARY_DIRS_CONFIG@")

# The location of the UseQtPropertyBrowser.cmake file.
SET(QtPropertyBrowser_USE_FILE "@QtPropertyBrowser_USE_FILE@")


# A QtPropertyBrowser install tree always provides one build configuration.
# A QtPropertyBrowser build tree may provide either one or multiple build
# configurations depending on the CMake generator used.
# Since QtPropertyBrowser can be used either from a build tree or an install
# tree it is useful for outside projects to know the configurations available.
# If this QtPropertyBrowserConfig.cmake is in a QtPropertyBrowser install
# tree QtPropertyBrowser_CONFIGURATION_TYPES will be empty and
# QtPropertyBrowser_BUILD_TYPE will be set to the value of
# CMAKE_BUILD_TYPE used to build QtPropertyBrowser. If QtPropertyBrowserConfig.cmake
# is in a QtPropertyBrowser build tree then QtPropertyBrowser_CONFIGURATION_TYPES
# and QtPropertyBrowser_BUILD_TYPE will have values matching CMAKE_CONFIGURATION_TYPES
# and CMAKE_BUILD_TYPE for that build tree (only one will ever be set).
SET(QtPropertyBrowser_CONFIGURATION_TYPES @QtPropertyBrowser_CONFIGURATION_TYPES_CONFIG@)
SET(QtPropertyBrowser_BUILD_TYPE @QtPropertyBrowser_BUILD_TYPE_CONFIG@)
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Qt Solutions Component: Property Browser

A property browser framework enabling the user to edit a set of
properties.

The framework provides a browser widget that displays the given
properties with labels and corresponding editing widgets (e.g.
line edits or comboboxes). The various types of editing widgets
are provided by the framework's editor factories: For each
property type, the framework provides a property manager (e.g.
QtIntPropertyManager and QtStringPropertyManager) which can be
associated with the preferred editor factory (e.g.
QtSpinBoxFactory and QtLineEditFactory). The framework also
provides a variant based property type with corresponding variant
manager and factory. Finally, the framework provides three
ready-made implementations of the browser widget:
QtTreePropertyBrowser, QtButtonPropertyBrowser and
QtGroupBoxPropertyBrowser.

Version history:

2.1: - QtTreePropertyBrowser - tooltip of property applied to
first column, while second column shows the value text of property
in its tooltip
- QtAbstractPropertyManager - initializeProperty() and
uninitializeProperty() without const modifier now
- QtTreePropertyBrowser and QtGroupBoxPropertyBrowser - internal
margin set to 0
- QtProperty - setEnabled() and isEnabled() methods added
- QtTreePropertyBrowser - "rootIsDecorated", "indentation" and
"headerVisible" properties added
- QtProperty - hasValue() method added, useful for group
properties

2.2: - FocusOut event now filtered out in case of
Qt::ActiveWindowFocusReason reason. In that case editor is not
closed when its sub dialog is executed
- Removed bug in color icon generation
- Decimals attribute added to "double" property type
- PointF, SizeF and RectF types supported
- Proper translation calls for tree property browser
- QtProperty - ensure inserted subproperty is different from
"this" property
- QtBrowserItem class introduced, useful for identifying browser's
gui elements
- Possibility to control expanded state of QtTreePropertyBrowser's
items from code
- QtTreePropertyBrowser - "resizeMode" and "splitterPosition"
properties added
- QtGroupBoxPropertyBrowser - fixed crash in case of deleting the
editor factory and then deleting the manager
- "Decoration" example added - it shows how to add new
responsibilities to the existing managers and editor factories

2.3: - Various bugfixes and improvements
- QtProperty - setModified() and isModified() methods added
- QtTreePropertyBrowser - disabling an item closes its editor
- KeySequence, Char, Locale and Cursor types supported
- Support for icons in enum type added
- Kerning subproperty exposed in Font type
- New property browser class added - QtButtonPropertyBrowser with
drop down button as a grouping element

2.4: - Fixed memory leak of QtProperty
- QtTreePropertyBrowser - group items are rendered better
- QtTreePropertyBrowser - propertiesWithoutValueMarked and
alternatingRowColors features added
- QtTreePropertyBrowser - possibility of coloring properties added
- QtTreePropertyBrowser - keyboard navigation improved
- New factories providing popup dialogs added:
QtColorEditorFactory and QtFontEditorFactory
- Single step attribute added to: QtIntPropertyManager and
QtDoublePropertyManager

2.5: - "Object Controller" example added. It implements a similar
widget to the property editor in QDesigner
- Compile with QT_NO_CURSOR
- Expand root item with single click on the '+' icon
- QtRectPropertyManager and QtRectFPropertyManager - by default
constraint is null rect meaning no constraint is applied

2.6: - QtGroupPropertyBrowser - don't force the layout to show the
whole labels' contents for read only properties, show tooltips for
them in addition.
- QtTreePropertyBrowser - fixed painting of the editor for color
property type when style sheet is used (QTSOLBUG-64).
- Make it possible to change the style of the checkboxes with a
stylesheet (QTSOLBUG-61).
- Change the minimum size of a combobox so that it can show at
least one character and an icon.
- Make it possible to properly style custom embedded editors (e.g.
the color editor provided with the solution).

36 changes: 36 additions & 0 deletions UseQtPropertyBrowser.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
###########################################################################
#
# Library: CTK
#
# Copyright (c) Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.commontk.org/LICENSE
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################

#
# This module is provided as QtPropertyBrowser_USE_FILE by QtPropertyBrowserConfig.cmake.
# It can be INCLUDED in a project to load the needed compiler and linker
# settings to use QtPropertyBrowser.
#

IF(NOT QtPropertyBrowser_USE_FILE_INCLUDED)
SET(QtPropertyBrowser_USE_FILE_INCLUDED 1)

# Add include directories needed to use QtPropertyBrowser.
INCLUDE_DIRECTORIES(${QtPropertyBrowser_INCLUDE_DIRS})

# Add link directories needed to use QtPropertyBrowser.
LINK_DIRECTORIES(${QtPropertyBrowser_LIBRARY_DIRS})

ENDIF()
55 changes: 55 additions & 0 deletions cmake/AddQt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
if(NOT QT_FOUND)
# --- QT5 ---
find_package(Qt5Core QUIET)
if(Qt5Core_FOUND)
find_package(Qt5Gui QUIET)
find_package(Qt5Widgets QUIET)
if(Qt5Gui_FOUND AND Qt5Widgets_FOUND)
set(QT5_FOUND ON)
set(QT_FOUND ON)
endif()
endif()
endif()

if(NOT QT_FOUND)
# --- QT4 ---
find_package(Qt4 QUIET)
if(QT4_FOUND)
set(QT_FOUND TRUE)
endif()
endif()



if(QT_FOUND)
if(NOT QT5_FOUND)
message ( STATUS "Using Qt4")
set( QT_VERSION_STRING "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
set( QT_TARGETS "Qt4::QtGui")
else()
message ( STATUS "Using Qt5")
set( QT_VERSION_STRING ${Qt5Core_VERSION_STRING})
set( QT_TARGETS "Qt5::Gui;Qt5::Widgets")
endif()

else()
message ( STATUS "Qt Not Found")
endif()


#include some custom CMake util functions
INCLUDE(CommonCMakeUtils)

extract_target_properties(QT_TARGETS_DEPENDENCIES QT_TARGETS INTERFACE_LINK_LIBRARIES)
set (QT_ALL_TARGETS ${QT_TARGETS} ${QT_TARGETS_DEPENDENCIES})
list(REMOVE_DUPLICATES QT_ALL_TARGETS)
extract_target_properties(QT_INCLUDE_DIRS QT_ALL_TARGETS INTERFACE_INCLUDE_DIRECTORIES)
extract_target_properties(QT_COMPILE_DEFS QT_ALL_TARGETS INTERFACE_COMPILE_DEFINITIONS)

IF(QT_FOUND )
MESSAGE(STATUS "QT Version: ${QT_VERSION_STRING}")
MESSAGE(STATUS "QT_TARGETS: ${QT_TARGETS}")
MESSAGE(STATUS "QT_ALL_TARGETS: ${QT_ALL_TARGETS}")
MESSAGE(STATUS "QT_INCLUDE_DIRS: ${QT_INCLUDE_DIRS}")
MESSAGE(STATUS "QT_COMPILE_DEFS: ${QT_COMPILE_DEFS}")
ENDIF()
Loading

0 comments on commit 2b9f84b

Please sign in to comment.