Skip to content

Commit 66c8716

Browse files
committed
Bugfix Release 0.2.1
Bugfix release for 0.2 We now support compiling on Windows with MSVC compiler and the function definitions do get exported correctly. I have also added compiling instructions for Windows to the README. There is also a new README section about qAccordion development. Signed-off-by: Christian Rapp <0x2a@posteo.org>
1 parent 027eaf8 commit 66c8716

File tree

3 files changed

+102
-25
lines changed

3 files changed

+102
-25
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ option (QACCORDION_EXTERNAL OFF)
66

77
set (qAccordion_VERSION_MAJOR 0)
88
set (qAccordion_VERSION_MINOR 2)
9-
set (qAccordion_VERSION_PATCH 0)
9+
set (qAccordion_VERSION_PATCH 1)
1010

1111
add_subdirectory(test)
1212
add_subdirectory(include/qAccordion)

README.md

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ Watch a screencast made with the [Demo Application](#demo-application) to see wh
2424

2525
## Setting up qAccordion
2626

27-
qAccordion is based on Qt5 and c++11. Make sure your development environment meets this requirements.
27+
qAccordion is based on Qt5 and c++11. Make sure your development environment meets these requirements:
28+
29+
* cmake >= 2.8.12
30+
* gcc >= 4.7
31+
* clang >= 3.4
32+
* MSVC >= 12 (Visual Studio 2013)
33+
* Qt 5.2 (Qt5Widgets, Qt5Gui, Qt5Core [Qt5Network])
2834

2935
To make use of this Qt Widget in your Project you have two choices.
3036

@@ -33,9 +39,10 @@ To make use of this Qt Widget in your Project you have two choices.
3339

3440
## Installation
3541

36-
Obtain the source from the [github repository](https://github.com/crapp/qaccordion). Either download the latest release or check out the latest commit.
42+
Obtain the source code from our [github repository](https://github.com/crapp/qaccordion). Either download the latest release or use git to check out the master branch.
3743

38-
Run the following commands to compile a shared library on Linux.
44+
### Linux
45+
Run the following commands to compile a shared library on Linux after you obtained the source code.
3946

4047
```shell
4148
# create a build directory
@@ -54,6 +61,32 @@ There are ready to use packages for the following Linux distributions:
5461

5562
* [Archlinux (AUR)](https://aur.archlinux.org/packages/qaccordion/)
5663

64+
### Windows
65+
66+
Compiling the library on Windows is possible with the Microsoft Visual C++ compiler (MinGW is currently __not__ supported).
67+
Generate a Visual Studio Solution with the appropriate cmake generator. After that you can compile the library with the Microsoft IDE.
68+
69+
```shell
70+
#create build directory
71+
mkdir build
72+
cd build
73+
# assuming you are using Visual Studio 2013 on a 64bit windows installation and Qt installed to C:\\Qt
74+
# Please change these options so they suit your build evironment.
75+
cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_PREFIX_PATH="C:\\Qt\\5.5\\msvc2013_64" ../
76+
```
77+
Open the solution file and compile the library.
78+
79+
Another possibility is to use the cmake NMake generator.
80+
81+
```shell
82+
#create build directory
83+
mkdir build
84+
cd build
85+
# check the prefix path so it matches your Qt installation
86+
cmake -G"NMake Makefiles" -DCMAKE_PREFIX_PATH="C:\\Qt\\5.5\\msvc2013_64" ../
87+
# build the library
88+
nmake
89+
```
5790
## Usage
5891

5992
Using this widget is quite easy. You can add this to your application either programmatically or by using Qt Designer. The widget does __not__ support configuration via the Designer.
@@ -84,9 +117,9 @@ qAccordion makes use of Qt memory management. This means all objects will be fre
84117
85118
### API Documentation
86119
87-
The library is documented using doxygen style comments. A static HTML version of the API documentation can be found on [github](https://crapp.github.io/qaccordion/).
120+
The library is documented using doxygen style comments. A static HTML version of the API documentation can be found on [github](https://crapp.github.io/qaccordion/). This is the documentation of the latest release.
88121
89-
The doxygen project file to generate the HTML documents is located in the `doc` folder. run the following command in a shell to generate your own local HTML documentation so you may read it offline (needs doxygen >= 1.8.6).
122+
The doxygen project file to generate the HTML documents is located in the `doc` folder. Run the following command in a shell to generate your own local HTML documentation so you may read it offline or have an updated documentation for features that are still under development (needs doxygen >= 1.8.6).
90123
91124
```shell
92125
doxygen qAccordionDoxyfile
@@ -95,14 +128,15 @@ doxygen qAccordionDoxyfile
95128
### Demo Application
96129

97130
In the `test` folder you can find a demo application that you can build with the library.
98-
You must use the CMake option `BUILD_TESTER` so it gets compiled.
131+
You must use the CMake option `BUILD_TESTER` so it gets compiled.
132+
133+
Linux example
99134

100135
```shell
101136
cd build
102137
cmake -DQACCORDION_BUILD_TESTER=ON ../
103138
make
104139
```
105-
106140
Have a look at the source code of the demo application if you are searching for a more advanced example on how to use this Qt Widget. I have recorded a short video that shows how qAccordion works.
107141

108142
## Bugs and Feature requests
@@ -115,6 +149,53 @@ If you find a Bug or have a feature request head over to github and open a new [
115149
* Definable animation type.
116150
* Trigger open / close not only on single mouse click (e.g. double click, mouse over).
117151

152+
## Development
153+
154+
Brief overview over the development process of qAccordion.
155+
156+
### Repositories
157+
The github repository of qAccordion has several different branches.
158+
159+
* master: Main development branch. Everything in here is guaranteed to compile and is tested (at least a little bit :)). This is the place for new features and bugfixes. Pull requests welcome.
160+
* develop: Test branch. Code is guaranteed to compile on the developers build environment. Nothing more nothing less.
161+
* release-x.x: Branch for a release. Only bugfixes are allowed here. Pull requests welcome.
162+
* gh-pages: Special branch for the static HTML documentation that will be hosted by github.io. Content is generated by doxygen.
163+
164+
### Coding standards
165+
166+
The source code is formatted with clang-format using the following configuration
167+
168+
```
169+
Language: Cpp,
170+
BasedOnStyle: LLVM,
171+
AccessModifierOffset: -4,
172+
AllowShortIfStatementsOnASingleLine: false,
173+
AlwaysBreakTemplateDeclarations: true,
174+
ColumnLimit: 81,
175+
IndentCaseLabels: false,
176+
Standard: Cpp11,
177+
IndentWidth: 4,
178+
TabWidth: 4,
179+
BreakBeforeBraces: Linux,
180+
CommentPragmas: '(^ IWYU pragma:)|(^.*\[.*\]\(.*\).*$)|(^.*@brief|@param|@return|@throw.*$)|(/\*\*<.*\*/)'
181+
```
182+
183+
### Versioning
184+
185+
Somehow every developer faces the problem of version numbers. I decided to use [semantic versioning](http://semver.org/) and stick to their rules.
186+
187+
> Given a version number MAJOR.MINOR.PATCH, increment the:
188+
>
189+
> 1. MAJOR version when you make incompatible API changes,
190+
>
191+
> 2. MINOR version when you add functionality in a backwards-compatible manner, and
192+
>
193+
> 3. PATCH version when you make backwards-compatible bug fixes.
194+
195+
We are currently at this stage
196+
197+
> Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
198+
118199
## FAQ ##
119200

120201
**Why does it not have feature X?**
@@ -137,4 +218,4 @@ GNU General Public License for more details.
137218
138219
You should have received a copy of the GNU General Public License
139220
along with this program. If not, see <http://www.gnu.org/licenses/>.
140-
`````
221+
```

src/CMakeLists.txt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Initialize CXXFLAGS.
2-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
3-
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") # No reorder warnings since this pop up frequently if you are using the Q_OBJECT macro
4-
if (NOT CMAKE_CXX_COMPILER_ID MATCHES MSVC)
5-
# these flags really hurt msvc so we add them here
1+
# Initialize CXXFLAGS for Linux and OS X
2+
if (NOT WIN32)
3+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
4+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
5+
# No reorder warnings because these pop up frequently if you are using the Q_OBJECT macro
66
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wextra -Wno-reorder")
7-
endif(NOT CMAKE_CXX_COMPILER_ID MATCHES MSVC)
8-
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
9-
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
10-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
7+
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
8+
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
9+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
10+
endif(NOT WIN32)
1111

1212
# Compiler-specific C++11 activation.
1313
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
@@ -39,13 +39,9 @@ elseif(WIN32)
3939
"qAccordion does not support compiling on MSVC versions earlier than 1800. "
4040
"Please use MSVC 1800 (included with Visual Studio 2013 or later).")
4141
endif (${MSVC_VERSION} LESS 1800)
42-
43-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
44-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
45-
4642
else ()
4743
message(FATAL_ERROR "Your C++ compiler does not support C++11.")
48-
endif ()
44+
endif (WIN32)
4945

5046
# include GenerateExportHeader module
5147
include(GenerateExportHeader)
@@ -63,7 +59,7 @@ if (QACCORDION_EXTERNAL)
6359
set(base_path ${CMAKE_SOURCE_DIR}/external/qaccordion/)
6460
else ()
6561
set(base_path ${CMAKE_SOURCE_DIR})
66-
endif()
62+
endif(QACCORDION_EXTERNAL)
6763

6864
include_directories(
6965
${PROJECT_BINARY_DIR} # include this directory so all moc headers and wrapped ui files are found
@@ -100,7 +96,7 @@ if (QACCORDION_BUILD_TESTER)
10096
find_package(Qt5Network REQUIRED)
10197
add_executable(accordion_tester ${TEST_HEADER} ${TEST_SOURCE} ${accordion_tester_FORMS})
10298
target_link_libraries(accordion_tester qAccordion Qt5::Widgets Qt5::Network)
103-
endif()
99+
endif(QACCORDION_BUILD_TESTER)
104100

105101
install(TARGETS qAccordion DESTINATION lib)
106102
install(FILES ${base_path}/include/qAccordion/clickableframe.h DESTINATION include/qAccordion)

0 commit comments

Comments
 (0)