Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4184dbd
Fixing "Set but not used" warnings
Wohlstand Apr 23, 2017
cafe071
Fixing the deprecated warnings because of QStyleOptionViewItemV3
Wohlstand Apr 23, 2017
9f24ddd
Added "Max Length" property for string field
Wohlstand Oct 7, 2018
7f9da66
[WIP] Added example of properties made from JSON
Wohlstand Oct 7, 2018
da08e4a
JSON sample: added the data restorer from the setup json
Wohlstand Oct 11, 2018
785d318
JSON: Combo-box support
Wohlstand Oct 12, 2018
aec7c75
JSON: More additions
Wohlstand Oct 13, 2018
9f71081
Try to hook value changes
Wohlstand Oct 16, 2018
a491d7b
Added support for save&restore
Wohlstand Oct 17, 2018
9358594
JSON: Jail QVariant<->Rect/Size/Point converters
Wohlstand Oct 21, 2018
c08f33a
JSON: Organize the code into proper and handy class
Wohlstand Oct 22, 2018
f2189ad
JSON: Add double-type rects, sizes and points
Wohlstand Oct 23, 2018
b0db023
JSON: Move SetupStack into the private section
Wohlstand Oct 23, 2018
dcba408
JSON: Added the signal to notify about settings change
Wohlstand Oct 23, 2018
df512f1
JSON: Fix some builds on Windows
Wohlstand Nov 13, 2018
28f8329
JSON: Allow tooltips
Wohlstand Nov 27, 2018
380b2df
JSON: Added support for "color" field
Wohlstand Dec 6, 2018
b93e94a
Remove jerkish optimization flags
Wohlstand Feb 12, 2019
f3f769c
Fixed linking warnings on macOS
Wohlstand Jun 30, 2019
a2aca2b
Fixed two "deprecated" warnings
Wohlstand Sep 28, 2019
94988be
Ouch!
Wohlstand Sep 28, 2019
3572839
Fixed build for Qt lower than 5.7
Wohlstand Sep 29, 2019
1a104eb
Added support for frameless group boxes (aka frames)
Wohlstand Oct 9, 2019
36d0b68
Ability to control "True/False" visibility
Wohlstand Oct 10, 2019
ddc0fe9
Fixed JSON sample and "groupbox" style
Wohlstand Oct 12, 2019
c3a0fc6
Color chooser: always show alpha-channel
Wohlstand Oct 12, 2019
b8f2085
Color picker: Disable native dialog usage
Wohlstand Oct 13, 2019
b450861
Frameless groupbox: don't remove frame from children
Wohlstand Oct 13, 2019
cde6a8f
Begin of internal refactoring
Wohlstand Oct 14, 2019
fa83ec7
Move color property into separated file
Wohlstand Dec 21, 2019
01ba14b
Replace 0 with nullptr and other minor fixes
Wohlstand Dec 21, 2019
1be6d49
Split up the string property
Wohlstand Dec 21, 2019
8f82c79
Split up Date, Time, DateTime properties
Wohlstand Dec 21, 2019
515c0b1
More refactoring and improve for a color picker
Wohlstand Dec 22, 2019
e34c4ae
Fixed an installing of an important headers
Wohlstand Dec 23, 2019
7accd99
Also install hpp files
Wohlstand Dec 23, 2019
c7507fe
ColorPicker: minor UI style polishing
Wohlstand Dec 23, 2019
8715f57
CheckBox: set zero margin
Wohlstand Dec 23, 2019
c249a27
Update JSON example: Allow groups with ".." name
Wohlstand Jan 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@

# Ignores 'build' in any sub folder
build/
*.user*

25 changes: 18 additions & 7 deletions cmake/CompileSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,36 @@ MESSAGE(STATUS "==============================================================="
MESSAGE(STATUS "============ Configuring CompileSettings =====================")


IF(APPLE)

# Unify visibility to meet llvm's default.
INCLUDE(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
IF(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
ENDIF()

ENDIF(APPLE)

IF(CMAKE_COMPILER_IS_GNUCC)

SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native -funroll-loops -ffast-math")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=native -funroll-loops")
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -funroll-loops -ffast-math")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -funroll-loops")

OPTION (USE_PEDANTIC_FLAGS "Use Pedantic Flags in GCC" ON)
IF(USE_PEDANTIC_FLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long -Wno-variadic-macros")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wno-long-long -Wno-variadic-macros")
ENDIF()

OPTION (USE_DEBUG_SYMBOLS "Use Debug Symbols" OFF)
IF(USE_DEBUG_SYMBOLS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g")
ENDIF()

ENDIF(CMAKE_COMPILER_IS_GNUCC)

IF(NOT MSVC)
Expand All @@ -38,9 +49,9 @@ IF(NOT MSVC)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)

IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
SET(USE_CPP_11 OFF)
MESSAGE(STATUS "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
Expand All @@ -65,4 +76,4 @@ IF(USE_OpenMP)
ENDIF()
ENDIF()

MESSAGE(STATUS "===============================================================")
MESSAGE(STATUS "===============================================================")
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ADD_SUBDIRECTORY(demo)
ADD_SUBDIRECTORY(extension)
ADD_SUBDIRECTORY(object_controller)
ADD_SUBDIRECTORY(simple)
ADD_SUBDIRECTORY(json)
6 changes: 3 additions & 3 deletions examples/canvas_typed/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,23 @@ MainWindow::MainWindow(QWidget *parent)
propertyEditor = new QtTreePropertyBrowser(dock);
propertyEditor->setFactoryForManager(doubleManager, doubleSpinBoxFactory);
propertyEditor->setFactoryForManager(stringManager, lineEditFactory);
propertyEditor->setFactoryForManager(colorManager->subIntPropertyManager(), spinBoxFactory);
propertyEditor->setFactoryForManager(colorManager->subStringPropertyManager(), lineEditFactory);
propertyEditor->setFactoryForManager(fontManager->subIntPropertyManager(), spinBoxFactory);
propertyEditor->setFactoryForManager(fontManager->subBoolPropertyManager(), checkBoxFactory);
propertyEditor->setFactoryForManager(fontManager->subEnumPropertyManager(), comboBoxFactory);
propertyEditor->setFactoryForManager(pointManager->subIntPropertyManager(), spinBoxFactory);
propertyEditor->setFactoryForManager(sizeManager->subIntPropertyManager(), spinBoxFactory);
dock->setWidget(propertyEditor);

currentItem = 0;
currentItem = nullptr;

connect(canvasView, SIGNAL(itemClicked(QtCanvasItem *)),
this, SLOT(itemClicked(QtCanvasItem *)));
connect(canvasView, SIGNAL(itemMoved(QtCanvasItem *)),
this, SLOT(itemMoved(QtCanvasItem *)));

fillView();
itemClicked(0);
itemClicked(nullptr);
}

void MainWindow::newRectangle()
Expand Down
17 changes: 17 additions & 0 deletions examples/json/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Tell CMake to run moc when necessary:
set(CMAKE_AUTOMOC ON)

# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)

SET(example_name json)

SET(KIT_SRCS
json_settings_widget.cpp
json.cpp
)

ADD_EXECUTABLE(${example_name} ${KIT_SRCS})
TARGET_LINK_LIBRARIES(${example_name} ${PROJECT_NAME})
target_compile_definitions(${example_name} PRIVATE -DDEBUG_BUILD)
77 changes: 77 additions & 0 deletions examples/json/json.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Nokia Corporation ([email protected])
**
** This file is part of a Qt Solutions component.
**
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
****************************************************************************/

#include "json_settings_widget.h"

#include <QApplication>
#include <QFile>

#include <QMessageBox>
#include <QtDebug>

const char *sample_layout = "sample.json";
const char *sample_settings = "setup.json";

int main(int argc, char **argv)
{
QApplication app(argc, argv);

JsonSettingsWidget extraSettings;

if(!extraSettings.loadLayoutFromFile(sample_settings, sample_layout))
{
QMessageBox::warning(nullptr, "oops", extraSettings.errorString());
return 1;
}

extraSettings.connect(&extraSettings, &JsonSettingsWidget::settingsChanged,
[]()
{
qDebug() << "Setup Changed!";
});

QWidget *w = extraSettings.getWidget();
w->show();

int ret = app.exec();

extraSettings.saveSettingsIntoFile(sample_settings);

return ret;
}
Loading