Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
49ca1398
Commit
49ca1398
authored
May 29, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove bug compilation qtpopup
add buttons parameter in popup
parent
1dad1ea8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
19 deletions
+48
-19
Debug/CMakeLists.txt
Debug/CMakeLists.txt
+4
-2
Release/CMakeLists.txt
Release/CMakeLists.txt
+5
-3
include/Utils/Qt/qtpopup.h
include/Utils/Qt/qtpopup.h
+7
-4
src/Utils/Qt/qtcolorschooser.cpp
src/Utils/Qt/qtcolorschooser.cpp
+1
-1
src/Utils/Qt/qtpopup.cpp
src/Utils/Qt/qtpopup.cpp
+31
-9
No files found.
Debug/CMakeLists.txt
View file @
49ca1398
...
...
@@ -91,10 +91,12 @@ IF(WITH_QT)
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/*.hpp
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/*.h
)
file
(
GLOB
_RECURSE
GLOB
utils_qt_headers
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtgl.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtSimple.h
)
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtSimple.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtpopup.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtcolorschooser.h
)
QT4_WRAP_CPP
(
UTILS_QT_HEADERS_MOC
${
utils_qt_headers
}
)
SET
(
files_utils_withQt
${
files_utils
}
${
files_utils_qt
}
${
UTILS_QT_HEADERS_MOC
}
)
...
...
Release/CMakeLists.txt
View file @
49ca1398
...
...
@@ -79,18 +79,20 @@ file(
)
IF
(
WITH_QT
)
file
(
GLOB
files_utils_qt
${
CGoGN_ROOT_DIR
}
/src/Utils/Qt/*.cpp
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/*.hpp
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/*.h
)
file
(
GLOB
_RECURSE
GLOB
utils_qt_headers
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtgl.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtSimple.h
)
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtSimple.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtpopup.h
${
CGoGN_ROOT_DIR
}
/include/Utils/Qt/qtcolorschooser.h
)
QT4_WRAP_CPP
(
UTILS_QT_HEADERS_MOC
${
utils_qt_headers
}
)
SET
(
files_utils_withQt
${
files_utils
}
${
files_utils_qt
}
${
UTILS_QT_HEADERS_MOC
}
)
...
...
include/Utils/Qt/qtpopup.h
View file @
49ca1398
...
...
@@ -46,18 +46,21 @@ namespace QT
class
QtPopUp
:
public
QDialog
{
Q_OBJECT
QGridLayout
*
m_layout
;
public:
/**
* create an empty popup
* @param withButtons add OK/CANCEL to the popup (exec launch blocking popup & return 1/0)
*/
QtPopUp
();
QtPopUp
(
bool
withButtons
=
false
);
/**
*
create a popup with one widget
*
*/
QtPopUp
(
QWidget
*
wid
);
virtual
~
QtPopUp
(
);
/**
* add a widget in the grid layout
...
...
src/Utils/Qt/qtcolorschooser.cpp
View file @
49ca1398
...
...
@@ -36,7 +36,7 @@ namespace QT
ColorsChooser
::
ColorsChooser
(
SimpleQT
*
interf
)
:
m_interf
(
interf
)
QtPopUp
(
false
),
m_interf
(
interf
)
,
m_current
(
0
)
{
m_list
=
new
QListWidget
();
m_diag
=
new
QColorDialog
();
...
...
src/Utils/Qt/qtpopup.cpp
View file @
49ca1398
...
...
@@ -22,6 +22,9 @@
* *
*******************************************************************************/
#include "Utils/Qt/qtpopup.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
namespace
CGoGN
{
...
...
@@ -31,23 +34,42 @@ namespace QT
{
QtPopUp
::
QtPopUp
()
QtPopUp
::
QtPopUp
(
bool
withButtons
)
{
if
(
withButtons
)
{
QVBoxLayout
*
vlayout
=
new
QVBoxLayout
(
this
);
m_layout
=
new
QGridLayout
(
NULL
);
vlayout
->
addLayout
(
m_layout
);
QHBoxLayout
*
layButtons
=
new
QHBoxLayout
();
QPushButton
*
okbutton
=
new
QPushButton
(
"OK"
,
this
);
QObject
::
connect
(
okbutton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
accept
()
)
);
QPushButton
*
cancelbutton
=
new
QPushButton
(
"Cancel"
,
this
);
QObject
::
connect
(
cancelbutton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
reject
()
)
);
// TO LAYOUT
layButtons
->
addWidget
(
okbutton
);
layButtons
->
addWidget
(
cancelbutton
);
vlayout
->
addLayout
(
layButtons
);
setLayout
(
vlayout
);
}
else
{
m_layout
=
new
QGridLayout
(
this
);
setLayout
(
m_layout
);
}
}
QtPopUp
::
QtPopUp
(
QWidget
*
wid
)
QtPopUp
::
~
QtPopUp
()
{
m_layout
=
new
QGridLayout
(
this
);
m_layout
->
addWidget
(
wid
);
setLayout
(
m_layout
);
}
void
QtPopUp
::
addWidget
(
QWidget
*
wid
,
int
col
,
int
row
)
{
m_layout
->
addWidget
(
wid
,
col
,
row
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment