mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
RemoveGLWidget stuff
This commit is contained in:
parent
e4329fc117
commit
6df63bd854
@ -249,12 +249,6 @@ void gGraph::setZoomY(short zoom)
|
||||
redraw();
|
||||
}
|
||||
|
||||
|
||||
void gGraph::qglColor(QColor col)
|
||||
{
|
||||
m_graphview->qglColor(col);
|
||||
}
|
||||
|
||||
void gGraph::renderText(QString text, int x, int y, float angle, QColor color, QFont *font, bool antialias)
|
||||
{
|
||||
m_graphview->AddTextQue(text, x, y, angle, color, font, antialias);
|
||||
@ -456,9 +450,6 @@ QPixmap gGraph::renderPixmap(int w, int h, bool printing)
|
||||
|
||||
sg->setScaleY(1.0);
|
||||
|
||||
|
||||
sg->makeCurrent(); // has to be current for fbo creation
|
||||
|
||||
float dpr = sg->devicePixelRatio();
|
||||
sg->setDevicePixelRatio(1);
|
||||
|
||||
|
@ -110,8 +110,6 @@ class gGraph : public QObject
|
||||
short pixelsX = 0, short pixelsY = 0, short order = 0,
|
||||
bool movable = false, short x = 0, short y = 0);
|
||||
|
||||
void qglColor(QColor col);
|
||||
|
||||
//! \brief Queues text for gGraphView object to draw it.
|
||||
void renderText(QString text, int x, int y, float angle = 0.0,
|
||||
QColor color = Qt::black, QFont *font = defaultfont, bool antialias = true);
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QFontMetrics>
|
||||
#include <QGLFramebufferObject>
|
||||
#include <QGLPixelBuffer>
|
||||
#include <QLabel>
|
||||
#include <QPixmapCache>
|
||||
#include <QTimer>
|
||||
@ -235,7 +233,7 @@ gGraph *gGraphView::popGraph()
|
||||
}
|
||||
|
||||
gGraphView::gGraphView(QWidget *parent, gGraphView *shared)
|
||||
: QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer), parent, shared),
|
||||
: QWidget(parent),
|
||||
m_offsetY(0), m_offsetX(0), m_scaleY(1.0), m_scrollbar(nullptr)
|
||||
{
|
||||
m_shared = shared;
|
||||
@ -246,7 +244,6 @@ gGraphView::gGraphView(QWidget *parent, gGraphView *shared)
|
||||
m_minx = m_maxx = 0;
|
||||
m_day = nullptr;
|
||||
m_selected_graph = nullptr;
|
||||
cubetex = 0;
|
||||
|
||||
horizScrollTime.start();
|
||||
vertScrollTime.start();
|
||||
@ -314,7 +311,6 @@ void gGraphView::closeEvent(QCloseEvent * event)
|
||||
|
||||
gGraphView::~gGraphView()
|
||||
{
|
||||
doneCurrent(); // Fix for QTBUG-35363
|
||||
|
||||
#ifdef ENABLE_THREADED_DRAWING
|
||||
|
||||
@ -560,7 +556,7 @@ float gGraphView::scaleHeight()
|
||||
|
||||
void gGraphView::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
QGLWidget::resizeEvent(e); // This ques a redraw event..
|
||||
QWidget::resizeEvent(e); // This ques a redraw event..
|
||||
|
||||
updateScale();
|
||||
|
||||
@ -766,229 +762,6 @@ void gGraphView::setScrollBar(MyScrollBar *sb)
|
||||
updateScrollBar();
|
||||
this->connect(m_scrollbar, SIGNAL(valueChanged(int)), SLOT(scrollbarValueChanged(int)));
|
||||
}
|
||||
void gGraphView::initializeGL()
|
||||
{
|
||||
setAutoFillBackground(false);
|
||||
setAutoBufferSwap(false);
|
||||
// glDisable(GL_LIGHTING);
|
||||
// glDisable(GL_DEPTH_TEST);
|
||||
// glDisable(GL_TEXTURE_2D);
|
||||
|
||||
if (cubeimg.size() > 0) {
|
||||
cubetex = bindTexture(*cubeimg[0]);
|
||||
}
|
||||
|
||||
// texid.resize(images.size());
|
||||
// for(int i=0;i<images.size();i++) {
|
||||
// texid[i]=bindTexture(*images[i]);
|
||||
// }
|
||||
|
||||
// glBindTexture(GL_TEXTURE_2D, 0);
|
||||
// glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
|
||||
}
|
||||
|
||||
//void gGraphView::resizeGL(int w, int h)
|
||||
//{
|
||||
|
||||
//#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
// float dpr = devicePixelRatio();
|
||||
//#else
|
||||
// float dpr = 1;
|
||||
//#endif
|
||||
|
||||
// glViewport(0, 0, w / dpr, h / dpr);
|
||||
// glMatrixMode(GL_PROJECTION);
|
||||
// glLoadIdentity();
|
||||
|
||||
// glOrtho(0, w / dpr, h / dpr, 0, -1, 1);
|
||||
|
||||
// glMatrixMode(GL_MODELVIEW);
|
||||
// glLoadIdentity();
|
||||
//}
|
||||
|
||||
void gGraphView::renderCube(QPainter &painter, float alpha)
|
||||
{
|
||||
|
||||
if (cubeimg.size() == 0) { return; }
|
||||
|
||||
// glPushMatrix();
|
||||
float w = width();
|
||||
float h = height();
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
float dpr = devicePixelRatio();
|
||||
w *= dpr;
|
||||
h *= dpr;
|
||||
#endif
|
||||
|
||||
painter.beginNativePainting();
|
||||
|
||||
// glViewport(0, 0, w, h);
|
||||
// glMatrixMode(GL_PROJECTION);
|
||||
// glLoadIdentity();
|
||||
// gluPerspective(45.0f, (GLfloat)w / (GLfloat)h, 0.1f, 100.0f);
|
||||
// glMatrixMode(GL_MODELVIEW);
|
||||
// glLoadIdentity();
|
||||
|
||||
// /*glShadeModel(GL_SMOOTH);
|
||||
// glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
||||
// glClearDepth(1.0f); */
|
||||
// glEnable(GL_DEPTH_TEST);
|
||||
// glDepthFunc(GL_LEQUAL);
|
||||
// glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
|
||||
// // This code has been shamelessly pinched of the interwebs..
|
||||
// // When I'm feeling more energetic, I'll change it to a textured sheep or something.
|
||||
// static float rotqube = 0;
|
||||
|
||||
// static float xpos = 0, ypos = 7;
|
||||
|
||||
// glLoadIdentity();
|
||||
|
||||
// glAlphaFunc(GL_GREATER, 0.1F);
|
||||
// glEnable(GL_ALPHA_TEST);
|
||||
// glEnable(GL_CULL_FACE);
|
||||
// glDisable(GL_COLOR_MATERIAL);
|
||||
|
||||
// //int imgcount=cubeimg.size();
|
||||
|
||||
// glEnable(GL_BLEND);
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
// double xx = 0.0, yy = 0.0;
|
||||
|
||||
// // set this to 0 to make the cube stay in the center of the screen
|
||||
// if (1) {
|
||||
// xx = sin(M_PI / 180.0 * xpos) * 2; // ((4.0/width()) * m_mouse.rx())-2.0;
|
||||
// yy = cos(M_PI / 180.0 * ypos) * 2; //2-((4.0/height()) * m_mouse.ry());
|
||||
// xpos += 1;
|
||||
// ypos += 1.32F;
|
||||
|
||||
// if (xpos > 360) { xpos -= 360.0F; }
|
||||
|
||||
// if (ypos > 360) { ypos -= 360.0F; }
|
||||
// }
|
||||
|
||||
|
||||
// //m_mouse.x();
|
||||
// glTranslatef(xx, 0.0f, -7.0f + yy);
|
||||
// glRotatef(rotqube, 0.0f, 1.0f, 0.0f);
|
||||
// glRotatef(rotqube, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
|
||||
// int i = 0;
|
||||
// glEnable(GL_TEXTURE_2D);
|
||||
// cubetex = bindTexture(*cubeimg[0]);
|
||||
|
||||
// //glBindTexture(GL_TEXTURE_2D, cubetex); //texid[i % imgcount]);
|
||||
// i++;
|
||||
// glColor4f(1, 1, 1, alpha);
|
||||
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(1.0f, 1.0f, 1.0f); // Top Right Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Texture and Quad
|
||||
// glEnd();
|
||||
// // Back Face
|
||||
// //bindTexture(*cubeimg[i % imgcount]);
|
||||
// //glBindTexture(GL_TEXTURE_2D, texid[i % imgcount]);
|
||||
// i++;
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glEnd();
|
||||
// // Top Face
|
||||
// //bindTexture(*cubeimg[i % imgcount]);
|
||||
// // glBindTexture(GL_TEXTURE_2D, texid[i % imgcount]);
|
||||
// i++;
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(1.0f, 1.0f, 1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad
|
||||
// glEnd();
|
||||
// // Bottom Face
|
||||
// //bindTexture(*cubeimg[i % imgcount]);
|
||||
// //glBindTexture(GL_TEXTURE_2D, texid[i % imgcount]);
|
||||
// i++;
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, -1.0f); // Top Right Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(1.0f, -1.0f, -1.0f); // Top Left Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glEnd();
|
||||
// // Right face
|
||||
// //bindTexture(*cubeimg[i % imgcount]);
|
||||
// // glBindTexture(GL_TEXTURE_2D, texid[i % imgcount]);
|
||||
// i++;
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(1.0f, 1.0f, -1.0f); // Top Right Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(1.0f, 1.0f, 1.0f); // Top Left Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glEnd();
|
||||
// // Left Face
|
||||
// //GLuint tex=bindTexture(*images["mask"]);
|
||||
// //glBindTexture(GL_TEXTURE_2D, tex);
|
||||
// i++;
|
||||
// glBegin(GL_QUADS);
|
||||
// glTexCoord2f(0.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 0.0f);
|
||||
// glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
|
||||
// glTexCoord2f(1.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Texture and Quad
|
||||
// glTexCoord2f(0.0f, 1.0f);
|
||||
// glVertex3f(-1.0f, 1.0f, -1.0f); // Top Left Of The Texture and Quad
|
||||
// glEnd();
|
||||
|
||||
// glDisable(GL_BLEND);
|
||||
// glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
// glDisable(GL_ALPHA_TEST);
|
||||
// glDisable(GL_TEXTURE_2D);
|
||||
// glDisable(GL_CULL_FACE);
|
||||
|
||||
// glDisable(GL_DEPTH_TEST);
|
||||
|
||||
// rotqube += 0.9f;
|
||||
|
||||
// // Restore boring 2D reality..
|
||||
// glViewport(0, 0, w, h);
|
||||
// glMatrixMode(GL_PROJECTION);
|
||||
// glLoadIdentity();
|
||||
|
||||
// glOrtho(0, width(), height(), 0, -1, 1);
|
||||
// glMatrixMode(GL_MODELVIEW);
|
||||
// glLoadIdentity();
|
||||
|
||||
// glPopMatrix();
|
||||
painter.endNativePainting();
|
||||
|
||||
}
|
||||
|
||||
bool gGraphView::renderGraphs(QPainter &painter)
|
||||
{
|
||||
@ -1168,8 +941,7 @@ bool gGraphView::renderGraphs(QPainter &painter)
|
||||
return numgraphs > 0;
|
||||
}
|
||||
|
||||
|
||||
void gGraphView::paintGL()
|
||||
void gGraphView::paintEvent(QPaintEvent * event)
|
||||
{
|
||||
#ifdef DEBUG_EFFICIENCY
|
||||
QElapsedTimer time;
|
||||
@ -1207,7 +979,7 @@ void gGraphView::paintGL()
|
||||
int tp;
|
||||
|
||||
if (render_cube && this->isVisible()) {
|
||||
renderCube(painter);
|
||||
// renderCube(painter);
|
||||
|
||||
tp = height() - (y / 2);
|
||||
} else {
|
||||
@ -1261,9 +1033,7 @@ void gGraphView::paintGL()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
swapBuffers(); // Dump to screen.
|
||||
|
||||
painter.end();
|
||||
if (this->isVisible() && !graphs_drawn && render_cube) { // keep the cube spinning
|
||||
redrawtimer->setInterval(1000.0 / 50); // 50 FPS
|
||||
redrawtimer->setSingleShot(true);
|
||||
@ -1271,16 +1041,6 @@ void gGraphView::paintGL()
|
||||
}
|
||||
}
|
||||
|
||||
void gGraphView::setCubeImage(QImage *img)
|
||||
{
|
||||
cubeimg.clear();
|
||||
cubeimg.push_back(img);
|
||||
|
||||
//cubetex=bindTexture(*img);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
|
||||
// For manual scrolling
|
||||
void gGraphView::setOffsetY(int offsetY)
|
||||
{
|
||||
@ -1976,7 +1736,7 @@ void gGraphView::keyPressEvent(QKeyEvent *event)
|
||||
m_offsetY -= PROFILE.appearance->graphHeight() * 3 * m_scaleY;
|
||||
m_scrollbar->setValue(m_offsetY);
|
||||
m_offsetY = m_scrollbar->value();
|
||||
updateGL();
|
||||
repaint(rect());
|
||||
return;
|
||||
} else if (event->key() == Qt::Key_PageDown) {
|
||||
m_offsetY += PROFILE.appearance->graphHeight() * 3 * m_scaleY; //PROFILE.appearance->graphHeight();
|
||||
@ -1985,7 +1745,7 @@ void gGraphView::keyPressEvent(QKeyEvent *event)
|
||||
|
||||
m_scrollbar->setValue(m_offsetY);
|
||||
m_offsetY = m_scrollbar->value();
|
||||
updateGL();
|
||||
repaint(rect());
|
||||
return;
|
||||
// redraw();
|
||||
}
|
||||
@ -2251,6 +2011,6 @@ int gGraphView::visibleGraphs()
|
||||
void gGraphView::redraw()
|
||||
{
|
||||
if (!m_inAnimation) {
|
||||
updateGL();
|
||||
repaint(rect());
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#ifndef GGRAPHVIEW_H
|
||||
#define GGRAPHVIEW_H
|
||||
|
||||
#include <QGLWidget>
|
||||
#include <QScrollBar>
|
||||
#include <QResizeEvent>
|
||||
#include <QThread>
|
||||
@ -141,7 +140,6 @@ class gToolTip : public QObject
|
||||
bool m_visible;
|
||||
int m_spacer;
|
||||
QImage m_image;
|
||||
GLuint m_textureID;
|
||||
bool m_invalidate;
|
||||
|
||||
protected slots:
|
||||
@ -161,7 +159,7 @@ class gToolTip : public QObject
|
||||
It led to quite a performance increase over the old Qt method.
|
||||
|
||||
*/
|
||||
class gGraphView : public QGLWidget
|
||||
class gGraphView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -285,15 +283,9 @@ class gGraphView : public QGLWidget
|
||||
//! \brief Sets the message displayed when there are no graphs to draw
|
||||
void setEmptyText(QString s) { m_emptytext = s; }
|
||||
|
||||
void setCubeImage(QImage *);
|
||||
|
||||
inline const float &devicePixelRatio() { return m_dpr; }
|
||||
void setDevicePixelRatio(float dpr) { m_dpr = dpr; }
|
||||
|
||||
// Cube fun
|
||||
QVector<QImage *> cubeimg;
|
||||
GLuint cubetex;
|
||||
|
||||
#ifdef ENABLE_THREADED_DRAWING
|
||||
QMutex text_mutex;
|
||||
QMutex gl_mutex;
|
||||
@ -335,14 +327,9 @@ class gGraphView : public QGLWidget
|
||||
int strings_cached_this_frame;
|
||||
|
||||
protected:
|
||||
//! \brief Set up the OpenGL basics for the QGLWidget underneath
|
||||
virtual void initializeGL();
|
||||
|
||||
// //! \brief Resize the OpenGL ViewPort prior to redrawing
|
||||
//virtual void resizeGL(int width, int height);
|
||||
|
||||
//! \brief The heart of the OpenGL drawing code
|
||||
virtual void paintGL();
|
||||
virtual void paintEvent(QPaintEvent * event);
|
||||
|
||||
//! \brief Calculates the sum of all graph heights
|
||||
float totalHeight();
|
||||
@ -375,9 +362,6 @@ class gGraphView : public QGLWidget
|
||||
//! \brief Add Graph to drawing queue, mainly for the benefit of multithreaded drawing code
|
||||
void queGraph(gGraph *, int originX, int originY, int width, int height);
|
||||
|
||||
//! \brief Render the annoying spinning graph empty cube
|
||||
void renderCube(QPainter &painter, float alpha = 1);
|
||||
|
||||
Day *m_day;
|
||||
|
||||
//! \brief the list of graphs to draw this frame
|
||||
|
@ -708,8 +708,8 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
|
||||
py -= h;
|
||||
} else if (graphtype == GT_LINE) { // if (m_graphtype==GT_BAR
|
||||
GLuint col1 = col.rgba();
|
||||
GLuint col2 = m_colors[j].rgba();
|
||||
QColor col1 = col;
|
||||
QColor col2 = m_colors[j];
|
||||
px2 = px + barw;
|
||||
py2 = (top + height - 1) - h;
|
||||
|
||||
|
@ -415,7 +415,6 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
ui->weightSpinBox->setDecimals(3);
|
||||
ui->weightSpinBox->setSuffix(STR_UNIT_KG);
|
||||
}
|
||||
GraphView->setCubeImage(images["nodata"]);
|
||||
GraphView->setEmptyText(STR_TR_NoData);
|
||||
previous_date=QDate();
|
||||
}
|
||||
@ -1285,7 +1284,6 @@ void Daily::Load(QDate date)
|
||||
float hours=cpap->hours();
|
||||
if (GraphView->isEmpty() && (hours>0)) {
|
||||
if (!PROFILE.hasChannel(CPAP_Obstructive) && !PROFILE.hasChannel(CPAP_Hypopnea)) {
|
||||
GraphView->setCubeImage(images["brick"]);
|
||||
GraphView->setEmptyText(tr("No Graphs :("));
|
||||
|
||||
isBrick=true;
|
||||
@ -2187,15 +2185,10 @@ void Daily::updateCube()
|
||||
|
||||
if (ui->graphCombo->count()>0) {
|
||||
GraphView->setEmptyText(tr("No Graphs On!"));
|
||||
GraphView->setCubeImage(images["nographs"]);
|
||||
|
||||
} else {
|
||||
GraphView->setEmptyText(STR_TR_NoData);
|
||||
GraphView->setCubeImage(images["nodata"]);
|
||||
}
|
||||
} else {
|
||||
GraphView->setCubeImage(images["sheep"]);
|
||||
|
||||
ui->toggleGraphs->setArrowType(Qt::DownArrow);
|
||||
ui->toggleGraphs->setToolTip(tr("Hide all graphs"));
|
||||
ui->toggleGraphs->blockSignals(true);
|
||||
|
@ -326,7 +326,7 @@ void MainWindow::Startup()
|
||||
SnapshotGraph->setUsePixmapCache(false);
|
||||
#endif
|
||||
|
||||
SnapshotGraph->setFormat(daily->graphView()->format());
|
||||
// SnapshotGraph->setFormat(daily->graphView()->format());
|
||||
//SnapshotGraph->setMaximumSize(1024,512);
|
||||
//SnapshotGraph->setMinimumSize(1024,512);
|
||||
SnapshotGraph->hide();
|
||||
@ -602,7 +602,7 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
popup.show();
|
||||
mainwin->Notify(tr("Please remember to point the importer at the root folder or drive letter of your data-card, and not a subfolder."),tr("Import Reminder"),8000);
|
||||
|
||||
QFileDialog w;
|
||||
QFileDialog w(this);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||
const QString documentsFolder = QDesktopServices::storageLocation(
|
||||
QDesktopServices::DocumentsLocation);
|
||||
@ -612,24 +612,24 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
w.setDirectory(documentsFolder);
|
||||
w.setFileMode(QFileDialog::Directory);
|
||||
w.setOption(QFileDialog::ShowDirsOnly, true);
|
||||
|
||||
#if defined(Q_OS_MAC) && (QT_VERSION < QT_VERSION_CHECK(4,8,0))
|
||||
// Fix for tetragon, 10.6 barfs up Qt's custom dialog
|
||||
w.setOption(QFileDialog::DontUseNativeDialog,true);
|
||||
#else
|
||||
w.setOption(QFileDialog::DontUseNativeDialog, false);
|
||||
//#if defined(Q_OS_MAC) && (QT_VERSION < QT_VERSION_CHECK(4,8,0))
|
||||
// // Fix for tetragon, 10.6 barfs up Qt's custom dialog
|
||||
// w.setOption(QFileDialog::DontUseNativeDialog, true);
|
||||
//#else
|
||||
// w.setOption(QFileDialog::DontUseNativeDialog, false);
|
||||
|
||||
QListView *l = w.findChild<QListView *>("listView");
|
||||
if (l) {
|
||||
l->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
}
|
||||
// QListView *l = w.findChild<QListView *>("listView");
|
||||
// if (l) {
|
||||
// l->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
// }
|
||||
|
||||
QTreeView *t = w.findChild<QTreeView *>();
|
||||
if (t) {
|
||||
t->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
}
|
||||
// QTreeView *t = w.findChild<QTreeView *>();
|
||||
// if (t) {
|
||||
// t->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
// }
|
||||
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if (w.exec() != QDialog::Accepted) {
|
||||
popup.hide();
|
||||
|
@ -82,7 +82,6 @@ Overview::Overview(QWidget *parent, gGraphView *shared) :
|
||||
GraphView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
|
||||
GraphView->setEmptyText(STR_TR_NoData);
|
||||
GraphView->setCubeImage(images["nodata"]);
|
||||
|
||||
// Create the custom scrollbar and attach to GraphView
|
||||
scrollbar = new MyScrollBar(ui->graphArea);
|
||||
@ -624,11 +623,9 @@ void Overview::updateCube()
|
||||
|
||||
if (ui->graphCombo->count() > 0) {
|
||||
GraphView->setEmptyText(tr("No Graphs On!"));
|
||||
GraphView->setCubeImage(images["nographs"]);
|
||||
|
||||
} else {
|
||||
GraphView->setEmptyText(STR_TR_NoData);
|
||||
GraphView->setCubeImage(images["nodata"]);
|
||||
}
|
||||
} else {
|
||||
ui->toggleVisibility->setArrowType(Qt::DownArrow);
|
||||
|
@ -1224,7 +1224,6 @@ Oximetry::Oximetry(QWidget *parent, gGraphView *shared) :
|
||||
|
||||
ui->saveButton->setEnabled(false);
|
||||
GraphView->LoadSettings("Oximetry");
|
||||
GraphView->setCubeImage(images["oximeter"]);
|
||||
|
||||
QLocale locale = QLocale::system();
|
||||
QString shortformat = locale.dateFormat(QLocale::ShortFormat);
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui opengl network xml
|
||||
QT += core gui network xml
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION,4) {
|
||||
QT += widgets webkitwidgets
|
||||
|
Loading…
Reference in New Issue
Block a user