Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sauvage
CGoGN
Commits
49ca1398
Commit
49ca1398
authored
May 29, 2012
by
Sylvain Thery
Browse files
remove bug compilation qtpopup
add buttons parameter in popup
parent
1dad1ea8
Changes
5
Hide whitespace changes
Inline
Side-by-side
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
)
{
m_layout
=
new
QGridLayout
(
this
);
setLayout
(
m_layout
);
}
if
(
withButtons
)
{
QVBoxLayout
*
vlayout
=
new
QVBoxLayout
(
this
);
m_layout
=
new
QGridLayout
(
NULL
);
vlayout
->
addLayout
(
m_layout
);
QtPopUp
::
QtPopUp
(
QWidget
*
wid
)
{
m_layout
=
new
QGridLayout
(
this
);
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
);
m_layout
->
addWidget
(
wid
);
setLayout
(
vlayout
);
setLayout
(
m_layout
);
}
else
{
m_layout
=
new
QGridLayout
(
this
);
setLayout
(
m_layout
);
}
}
QtPopUp
::~
QtPopUp
()
{
}
void
QtPopUp
::
addWidget
(
QWidget
*
wid
,
int
col
,
int
row
)
{
m_layout
->
addWidget
(
wid
,
col
,
row
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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