Commit 67c78689 authored by hkrishna's avatar hkrishna

Adding Qt5Support

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23584 18c085ea-50e0-402c-830e-de6fd14e8384
parent 85f2ecdc
......@@ -3,12 +3,13 @@ IF(NOT DEFINED VISIT_QT_DIR)
MESSAGE(FATAL_ERROR "Qt5 installation directory not specified")
ENDIF()
SET(QT_MOC_EXECUTABLE ${VISIT_QT_DIR}/bin/moc)
set(QT_MOC_EXECUTABLE ${VISIT_QT_DIR}/bin/moc)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#set(QT5_INCLUDE_DIRS "")
set(QT5_LIBRARIES "")
set(visit_qt_modules Core Gui Widgets OpenGL Network PrintSupport Xml UiTools)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${VISIT_QT_DIR}/lib/cmake)
find_package (Qt5 REQUIRED ${visit_qt_modules})
......
......@@ -1146,22 +1146,25 @@ ENDIF(VISIT_PYTHON_FILTERS AND VISIT_DBIO_ONLY)
# Configure Qt4 support.
IF(NOT VISIT_DBIO_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_SERVER_COMPONENTS_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindVisItQt4.cmake)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindVisItQt.cmake)
ENDIF(NOT VISIT_DBIO_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_SERVER_COMPONENTS_ONLY)
# Configure PySide Support
IF(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND
AND NOT VISIT_DBIO_ONLY
AND NOT VISIT_ENGINE_ONLY
AND NOT VISIT_SERVER_COMPONENTS_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindPySide.cmake)
IF(PYSIDE_FOUND)
SET(HAVE_PYSIDE 1)
ENDIF(PYSIDE_FOUND)
ENDIF(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND
AND NOT VISIT_DBIO_ONLY
AND NOT VISIT_ENGINE_ONLY
AND NOT VISIT_SERVER_COMPONENTS_ONLY)
# But not for Qt5 yet..
IF(NOT DEFINED VISIT_QT5)
IF(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND
AND NOT VISIT_DBIO_ONLY
AND NOT VISIT_ENGINE_ONLY
AND NOT VISIT_SERVER_COMPONENTS_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindPySide.cmake)
IF(PYSIDE_FOUND)
SET(HAVE_PYSIDE 1)
ENDIF(PYSIDE_FOUND)
ENDIF(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND
AND NOT VISIT_DBIO_ONLY
AND NOT VISIT_ENGINE_ONLY
AND NOT VISIT_SERVER_COMPONENTS_ONLY)
ENDIF(NOT DEFINED VISIT_QT5)
# Treat GLEW as a 3rd party builtin.
IF(VISIT_USE_GLEW)
......
......@@ -47,7 +47,7 @@
#include <vtkRubberBandMapper2D.h>
#include <vtkDashedXorGridMapper2D.h>
#ifdef Q_WS_X11
#if defined(Q_WS_X11) || defined(Q_OS_LINUX)
// We only need WindowMetrics here if we're on X11.
#include <WindowMetrics.h>
#endif
......@@ -296,7 +296,7 @@ VisWinRenderingWithWindow::Iconify(void)
{
if (realized && ownRenderWindow)
{
#if defined(Q_WS_WIN) || defined(Q_WS_MACX)
#if defined(Q_WS_WIN) || defined(Q_WS_MACX) || defined(Q_OS_WIN) || defined(Q_OS_MAC)
renWin->hide();
#else
if (! renWin->isMinimized())
......@@ -457,7 +457,7 @@ VisWinRenderingWithWindow::DeIconify(void)
{
if (realized)
{
#if defined(Q_WS_WIN) || defined(Q_WS_MACX)
#if defined(Q_WS_WIN) || defined(Q_WS_MACX) || defined(Q_OS_WIN) || defined(Q_OS_MAC)
renWin->show();
#else
renWin->showNormal();
......
......@@ -65,7 +65,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QPainter>
#include <QLine>
#if defined(HAVE_XLIB)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
# include <QX11Info>
#endif
# include <X11/Intrinsic.h>
#endif
......@@ -289,6 +291,7 @@ vtkDashedXorGridMapper2D::RenderOverlay(vtkViewport* viewport, vtkActor2D* actor
void
vtkDashedXorGridMapper2D::RenderOverlay_X11(vtkViewport* viewport, vtkActor2D* actor)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if defined(HAVE_XLIB)
#define SET_FOREGROUND_D(rgba) \
aColor.red = (unsigned short) (rgba[0] * 65535.0); \
......@@ -346,6 +349,7 @@ vtkDashedXorGridMapper2D::RenderOverlay_X11(vtkViewport* viewport, vtkActor2D* a
#include <vtkDashedXorGridMapper2D_body.C>
#endif
#endif
}
// ****************************************************************************
......
......@@ -62,7 +62,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QPainter>
#include <QLine>
#if defined(HAVE_XLIB)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
# include <QX11Info>
#endif
# include <X11/Intrinsic.h>
#endif
......@@ -282,6 +284,7 @@ vtkRubberBandMapper2D::RenderOverlay(vtkViewport* viewport, vtkActor2D* actor)
void
vtkRubberBandMapper2D::RenderOverlay_X11(vtkViewport* viewport, vtkActor2D* actor)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if defined(HAVE_XLIB)
#define STORE_POINT(P, X, Y) P.x = short(X); P.y = short(Y);
......@@ -356,6 +359,7 @@ vtkRubberBandMapper2D::RenderOverlay_X11(vtkViewport* viewport, vtkActor2D* acto
#include <vtkRubberBandMapper2D_body.C>
#endif
#endif
}
// ***************************************************************************
......
......@@ -250,8 +250,9 @@ KeyframeDataModel::SubjectRemoved(Subject *subj)
void
KeyframeDataModel::Update(Subject *)
{
beginResetModel();
RebuildRowInfo();
reset();
endResetModel();
}
// ****************************************************************************
......@@ -438,7 +439,7 @@ KeyframeDataModel::PlotIcon(int plotType) const
GUIPlotPluginInfo *GUIInfo = plotPluginManager->GetGUIPluginInfo(
plotPluginManager->GetEnabledID(plotType));
if(GUIInfo != 0 && GUIInfo->XPMIconData() != 0)
retval = QIcon(GUIInfo->XPMIconData());
retval = QIcon(QPixmap(GUIInfo->XPMIconData()));
return retval;
}
......@@ -712,7 +713,7 @@ bool
KeyframeDataModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
bool retval = false;
if (qVariantCanConvert<PlotRangeData>(value))
if (value.canConvert<PlotRangeData>())
{
PlotRangeData s = value.value<PlotRangeData>();
GetViewerMethods()->SetPlotFrameRange(s.id,
......@@ -720,7 +721,7 @@ KeyframeDataModel::setData(const QModelIndex &index, const QVariant &value, int
qMax(s.start, s.end));
retval = true;
}
else if (qVariantCanConvert<KeyframePoints>(value))
else if (value.canConvert<KeyframePoints>())
{
KeyframePoints s = value.value<KeyframePoints>();
int id = (int)index.internalId();
......
......@@ -54,20 +54,20 @@
// Tables of available styles.
//
static const char *styleNamesInMenu[] = {
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
"Macintosh",
#endif
#ifdef Q_WS_WIN
#if defined(Q_WS_WIN) || defined(Q_OS_WIN)
"Windows XP", "Windows Vista",
#endif
"Windows", "Motif", "CDE", "Plastique", "CleanLooks"
};
static const char *styleNames[] = {
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
"macintosh",
#endif
#ifdef Q_WS_WIN
#if defined(Q_WS_WIN) || defined(Q_OS_WIN)
"windowsxp", "windowsvista",
#endif
"windows", "motif", "cde", "plastique", "cleanlooks"
......
......@@ -40,7 +40,7 @@
#include <QMenuBar>
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
// Include some MacOS X stuff
#include <Carbon/Carbon.h>
#include <visit-config.h>
......@@ -65,7 +65,7 @@
QvisApplication::QvisApplication( int &argc, char **argv) :
QApplication(argc, argv)
{
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
needToMakeActive = false;
eventLoop = 0;
#endif
......@@ -74,7 +74,7 @@ QvisApplication::QvisApplication( int &argc, char **argv) :
QvisApplication::QvisApplication( int &argc, char **argv, bool GUIenabled ) :
QApplication(argc, argv, GUIenabled)
{
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
needToMakeActive = false;
eventLoop = 0;
#endif
......@@ -97,7 +97,8 @@ QvisApplication::~QvisApplication()
{
}
#ifdef Q_WS_MACX
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
// ****************************************************************************
// Method: QvisApplication::macEventFilter
//
......@@ -287,6 +288,7 @@ QvisApplication::macEventFilter(EventHandlerCallRef er, EventRef event)
return ret;
}
#endif
#endif
// ****************************************************************************
// Method: QvisApplication::exitTheLoop
......@@ -305,7 +307,7 @@ QvisApplication::macEventFilter(EventHandlerCallRef er, EventRef event)
void
QvisApplication::exitTheLoop()
{
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
eventLoop->exit();
delete eventLoop;
eventLoop = 0;
......
......@@ -40,7 +40,7 @@
#define QVIS_APPLICATION_H
#include <QApplication>
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
class QEventLoop;
#endif
......@@ -79,9 +79,11 @@ signals:
private slots:
void exitTheLoop();
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
public:
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
virtual bool macEventFilter(EventHandlerCallRef, EventRef);
#endif
bool needToMakeActive;
QEventLoop *eventLoop;
#endif
......
......@@ -740,7 +740,7 @@ QvisCMFEWizard::CreateDonorAndTargetPage(void)
targetDatabase = new QComboBox(main_widget);
targetDatabaseOpen = new QPushButton("...", this);
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
targetDatabaseOpen->setMaximumWidth(fontMetrics().boundingRect("...").width() + 6);
#endif
......@@ -779,7 +779,7 @@ QvisCMFEWizard::CreateDonorAndTargetPage(void)
donorDatabaseLabel = new QLabel(tr("Donor Database:"), main_widget);
donorDatabase = new QComboBox(main_widget);
donorDatabaseOpen = new QPushButton("...", this);
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
donorDatabaseOpen->setMaximumWidth(fontMetrics().boundingRect("...").width() + 6);
#endif
......
......@@ -464,7 +464,7 @@ QvisColorButton::popupPressed()
// Show the popup menu.
popup->move(menuX, menuY);
popup->show();
setDown(FALSE);
setDown(false);
}
}
......
......@@ -83,7 +83,7 @@ QvisDialogLineEdit::QvisDialogLineEdit(QWidget *parent)
this, SIGNAL(textChanged(const QString &)));
hLayout->addWidget(lineEdit);
pushButton = new QPushButton("...", this);
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
pushButton->setMaximumWidth(
fontMetrics().boundingRect("...").width() + 6);
#endif
......@@ -198,7 +198,7 @@ QvisDialogLineEdit::setFallbackPath(const QString &p)
void
QvisDialogLineEdit::changeEvent(QEvent *e)
{
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
if(e->type() == QEvent::FontChange)
{
pushButton->setMaximumWidth(
......
......@@ -299,7 +299,7 @@ QvisElementButton::popupPressed()
// Show the popup menu.
sharedpopup->move(menuX, menuY);
sharedpopup->show();
setDown(FALSE);
setDown(false);
}
}
......
......@@ -294,7 +294,7 @@ QvisExportDBWindow::CreateWindowContents()
directoryLayout->addWidget(directoryNameLineEdit);
directoryLayout->addWidget(directorySelectButton);
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
directorySelectButton->setMaximumWidth(
fontMetrics().boundingRect("...").width() + 6);
#endif
......
......@@ -1965,7 +1965,7 @@ QvisExpressionsWindow::QuoteVariable(const QString &var)
for (int i=0; i<var.length(); i++)
{
char c = var[i].toAscii();
char c = var[i].toLatin1();
if ((c < 'A' || c > 'Z') &&
(c < 'a' || c > 'z') &&
(c < '0' || c > '9') &&
......
......@@ -437,7 +437,7 @@ QvisFileOpenDialog::exec()
show();
in_loop = TRUE;
in_loop = true;
QEventLoop eventLoop;
connect(this, SIGNAL(quitloop()),
&eventLoop, SLOT(quit()));
......
......@@ -276,7 +276,7 @@ QvisFileOpenWindow::CreateWindowContents()
// the intermediateFile list.
intermediateFileList = fileServer->GetAppliedFileList();
#if defined(Q_WS_MACX) && QT_VERSION >= 0x040800
#if (defined(Q_WS_MACX) || defined(Q_OS_MAC)) && QT_VERSION >= 0x040800
// On Mac with Qt 4.8, we run into problems with the window not
// coming back fully after calling setEnabled(true) on the window.
// As a workaround, we disable the central widget instead of the
......
......@@ -326,7 +326,7 @@ QvisFileSelectionWindow::CreateWindowContents()
// the intermediateFile list.
intermediateFileList = fileServer->GetAppliedFileList();
#if defined(Q_WS_MACX) && QT_VERSION >= 0x040800
#if (defined(Q_WS_MACX) || defined(Q_OS_MAC)) && QT_VERSION >= 0x040800
// On Mac with Qt 4.8, we run into problems with the window not
// coming back fully after calling setEnabled(true) on the window.
// As a workaround, we disable the central widget instead of the
......
......@@ -2101,7 +2101,7 @@ DecodeQualifiedFilename(const QVariant &v)
f.host = values[0].toString().toStdString();
f.path = values[1].toString().toStdString();
f.filename = values[2].toString().toStdString();
f.separator = values[3].toChar().toAscii();
f.separator = values[3].toChar().toLatin1();
f.SetAccess(values[4].toBool());
f.SetVirtual(values[5].toBool());
}
......
......@@ -57,7 +57,7 @@
#include <QStyle>
#include <QTranslator>
#if defined(Q_WS_MACX)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
// On MacOS X, we manage the printer options window instead of letting
// Qt do it when we use the Mac or Aqua style.
#include <Carbon/Carbon.h>
......@@ -392,7 +392,7 @@ LongFileName(const std::string &shortName)
// X server.
//
// ****************************************************************************
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
static void
GUI_LogQtMessages(QtMsgType type, const char *msg)
{
......@@ -429,6 +429,44 @@ GUI_LogQtMessages(QtMsgType type, const char *msg)
break;
}
}
#else
static void
GUI_LogQtMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
const int n_strs_to_suppress = 1;
const char *strs_to_suppress[] =
{ "Invalid XLFD" };
bool shouldPrint = true;
for (int i = 0 ; i < n_strs_to_suppress ; i++)
{
if (strstr(msg.toStdString().c_str(), strs_to_suppress[i]) != NULL)
{
shouldPrint = false;
break;
}
}
if (shouldPrint)
cerr << msg.toStdString() << endl;
switch(type)
{
case QtDebugMsg:
debug1 << "Qt: Debug: " << msg.toStdString() << endl;
break;
case QtWarningMsg:
debug1 << "Qt: Warning: " << msg.toStdString() << endl;
break;
case QtCriticalMsg:
debug1 << "Qt: Critical: " << msg.toStdString() << endl;
break;
case QtFatalMsg:
debug1 << "Qt: Fatal: " << msg.toStdString() << endl;
abort(); // HOOKS_IGNORE
break;
}
}
#endif
// ****************************************************************************
// Method: QvisGUIApplication::QvisGUIApplication
......@@ -763,7 +801,11 @@ QvisGUIApplication::QvisGUIApplication(int &argc, char **argv, ViewerProxy *prox
qt_argv[argc+4] = NULL;
debug1 << "QvisApplication::QvisApplication: -font " << qt_argv[argc+1] << endl;
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
qInstallMsgHandler(GUI_LogQtMessages);
#else
qInstallMessageHandler(GUI_LogQtMessages);
#endif
if(QApplication::instance()) //if application instance already exists..
{
......@@ -1660,7 +1702,7 @@ QvisGUIApplication::FinalInitialization()
visitTimer->StopTimer(timeid, "stage 3");
break;
case 4:
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
// If we're not on MacOS X, hide the splashscreen now.
if(splash)
splash->hide();
......@@ -1732,7 +1774,7 @@ QvisGUIApplication::FinalInitialization()
visitTimer->StopTimer(timeid, "stage 9");
break;
case 10:
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
// On MacOS X, we hide the splashscreen last thing so we are very
// near 100% likely to get the GUI's menu in the main Mac menu.
if(splash)
......@@ -1757,7 +1799,7 @@ QvisGUIApplication::FinalInitialization()
if(code == CONFIGSTATE_FIRSTTIME)
{
QTimer::singleShot(1000, this, SLOT(displayReleaseNotesIfAvailable()));
#if defined(Q_WS_MACX)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
QTimer::singleShot(1001, this, SLOT(setupHostProfilesAndConfig()));
#endif
}
......@@ -2425,10 +2467,10 @@ QvisGUIApplication::ProcessArguments(int &argc, char **argv)
}
std::string style(argv[i + 1]);
if(
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
style == "macintosh" ||
#endif
#ifdef Q_WS_WIN
#if defined(Q_WS_WIN) || defined(Q_OS_WIN)
style == "windowsxp" ||
style == "windowsvista" ||
#endif
......@@ -2725,7 +2767,7 @@ QvisGUIApplication::MoveAndResizeMainWindow(int orientation)
mainWin->setMinimumHeight(h);
#endif
// GUI need to be offset 20 pixels from the MenuBar, only on i386?
#if defined(Q_WS_MACX)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
if (y == 0) {
y = 20;
if (orientation < 2) h = h - y;
......@@ -6676,7 +6718,7 @@ QvisGUIApplication::SplashScreenProgress(const QString &msg, int prog)
{
if(splash)
{
#if defined(Q_WS_MACX)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
splash->activateWindow();
#endif
splash->Progress(msg, prog);
......@@ -6757,8 +6799,8 @@ void
QvisGUIApplication::PrintWindow()
{
PrinterAttributes *p = GetViewerState()->GetPrinterAttributes();
#if defined(Q_WS_MACX) && !defined(VISIT_MAC_NO_CARBON)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if (defined(Q_WS_MACX) || defined(Q_OS_MAC)) && !defined(VISIT_MAC_NO_CARBON)
//
// If we're on MacOS X and the Mac application style is being used, manage
// the printer setup ourselves since the QPrinter object does not return
......@@ -6961,9 +7003,10 @@ QvisGUIApplication::PrintWindow()
//
GetViewerMethods()->PrintWindow();
}
#if defined(Q_WS_MACX) && !defined(VISIT_MAC_NO_CARBON)
#if (defined(Q_WS_MACX) || defined(Q_OS_MAC)) && !defined(VISIT_MAC_NO_CARBON)
}
#endif
#endif
}
// ****************************************************************************
......
......@@ -947,7 +947,7 @@ QvisGridWidget::drawHighlightedItem(QPainter &paint, int index)
// Draw the button and the color over the button.
drawBox(paint, r, palette().color(QPalette::Light),
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
Qt::black
#else
palette().color(QPalette::Shadow)
......@@ -1007,7 +1007,7 @@ QvisGridWidget::drawSelectedItem(QPainter &paint, int index)
// Draw a sunken button.
drawBox(paint, r,
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
Qt::black,
#else
palette().color(QPalette::Dark),
......
......@@ -38,6 +38,7 @@
#include <QvisHostProfileWindow.h>
#include <QMimeData>
#include <QButtonGroup>
#include <QCheckBox>
#include <QComboBox>
......
......@@ -112,14 +112,14 @@ void
QvisKeyframeDelegate::paint(QPainter *p, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
if (qVariantCanConvert<PlotRangeData>(index.data()))
if (index.data().canConvert<PlotRangeData>())
{
PlotRangeData s = index.data().value<PlotRangeData>();
drawer->setCurrentIndex(s.currentIndex);
drawer->setNumFrames(s.numFrames);
drawer->drawPlotRange(p, option.rect, s.start, s.end);
}
else if(qVariantCanConvert<KeyframePoints>(index.data()))
else if(index.data().canConvert<KeyframePoints>())
{
KeyframePoints s = index.data().value<KeyframePoints>();
......@@ -198,7 +198,7 @@ QvisKeyframeDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QWidget *w = 0;
if (qVariantCanConvert<PlotRangeData>(index.data()))
if (index.data().canConvert<PlotRangeData>())
{
QvisKeyframePlotRangeWidget *edit = new QvisKeyframePlotRangeWidget(parent);
edit->setDrawer(drawer);
......@@ -206,7 +206,7 @@ QvisKeyframeDelegate::createEditor(QWidget *parent,
this, SIGNAL(commitData(QWidget *)));
w = edit;
}
else if(qVariantCanConvert<KeyframePoints>(index.data()))
else if(index.data().canConvert<KeyframePoints>())
{
QvisKeyframeWidget *edit = new QvisKeyframeWidget(parent);
edit->setDrawer(drawer);
......@@ -266,7 +266,7 @@ QvisKeyframeDelegate::updateEditorGeometry(QWidget *editor,
void
QvisKeyframeDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
if (qVariantCanConvert<PlotRangeData>(index.data()))
if (index.data().canConvert<PlotRangeData>())
{
PlotRangeData s = index.data().value<PlotRangeData>();
QvisKeyframePlotRangeWidget *edit = (QvisKeyframePlotRangeWidget *)editor;
......@@ -274,7 +274,7 @@ QvisKeyframeDelegate::setEditorData(QWidget *editor, const QModelIndex &index) c
drawer->setNumFrames(s.numFrames);
edit->setData(s.start, s.end);
}
else if(qVariantCanConvert<KeyframePoints>(index.data()))
else if(index.data().canConvert<KeyframePoints>())
{
KeyframePoints s = index.data().value<KeyframePoints>();
QvisKeyframeWidget *edit = (QvisKeyframeWidget *)editor;
......@@ -306,14 +306,14 @@ void
QvisKeyframeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
if (qVariantCanConvert<PlotRangeData>(index.data()))
if (index.data().canConvert<PlotRangeData>())
{
PlotRangeData s(index.data().value<PlotRangeData>());
QvisKeyframePlotRangeWidget *edit = (QvisKeyframePlotRangeWidget *)editor;
edit->getData(s.start, s.end);
model->setData(index, qVariantFromValue(s));
}
else if (qVariantCanConvert<KeyframePoints>(index.data()))
else if (index.data().canConvert<KeyframePoints>())
{
KeyframePoints s(index.data().value<KeyframePoints>());
QvisKeyframeWidget *edit = (QvisKeyframeWidget *)editor;
......
......@@ -264,7 +264,11 @@ QvisKeyframeWindow::CreateWindowContents()
kv, SLOT(expandAll()));
connect(kv->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
this, SLOT(newSelection()));
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
kv->header()->setResizeMode(QHeaderView::ResizeToContents);
#else
kv->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif
kv->setEditTriggers(QAbstractItemView::AllEditTriggers);
kv->setItemDelegateForColumn(1, new QvisKeyframeDelegate(this));
mainLayout->addWidget(kv, row,0,1,3);
......
......@@ -36,6 +36,7 @@
*
*****************************************************************************/
#include <qdrawutil.h>
#include <QvisLightingWidget.h>
#include <math.h>
#include <QMouseEvent>
......
......@@ -44,7 +44,7 @@
#include <QPixmap>
#include <QMenuBar>
#include <QMenu>
#include <QMenuItem>
//#include <QMenuItem>
#include <QComboBox>
#include <QSplitter>
#include <QStatusBar>
......@@ -543,7 +543,7 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
filePopup->addSeparator();
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
filePopup->addAction(tr("&Quit"),this, SIGNAL(quit()),
QKeySequence(Qt::CTRL + Qt::Key_Q));
#else
......@@ -601,7 +601,7 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
this, SIGNAL(activatePickWindow()),
QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P));
#ifdef Q_WS_MACX
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
ctrls->addAction(tr("Quer&y . . ."),
this, SIGNAL(activateQueryWindow()),
QKeySequence(Qt::CTRL + Qt::Key_Y));
......@@ -663,7 +663,7 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
winPopup->addAction(QPixmap(newwindow_xpm), tr("New"),
this, SLOT(windowAdd())
#ifndef Q_WS_MACX
#if !(defined(Q_WS_MACX) || defined(Q_OS_MAC))
, QKeySequence(Qt::CTRL + Qt::Key_Insert)
#endif
);
......@@ -841,7 +841,7 @@ QvisMainWindow::QvisMainWindow(int orientation, const char *captionString)
SetShowSelectedFiles(false);
#ifdef Q_WS_X11
#if defined(Q_WS_X11) || defined(Q_OS_LINUX)
// Move the window to a known position on the screen
// so we can take some measurements later
move(QPoint(100,100));
......@@ -2025,7 +2025,7 @@ QvisMainWindow::CreateNode(DataNode *parentNode)
parentNode->AddNode(node);
// Add generic window attributes
#if defined(Q_WS_MACX)
#if defined(Q_WS_MACX) || defined(Q_OS_MAC)
int yval = y() > 0 ? 20 : 0;
node->AddNode(new DataNode("x", x()));
node->AddNode(new DataNode("y", y() - yval));
......
......@@ -36,6 +36,7 @@
*
*****************************************************************************/
#include <qdrawutil.h>
#include <QvisOpacitySlider.h>
#include <QBitmap>
#include <QColor>
......@@ -453,7 +454,7 @@ void
QvisOpacitySlider::drawSliderGroove(QPainter *p, int x, int y, int w, int,
int c)
{
qDrawWinPanel(p, x, y + c - 2, w, 4, palette(), TRUE);