IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI Discussion :

Intégrer Qwt


Sujet :

EDI

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 117
    Par défaut Intégrer Qwt
    Bonjour,
    Depuis hier je n'arrive pas à intégrer dans le designer de Qt eclipse integration le plugin QWT.
    Quelqu'un pourra m'aider?
    Merci

  2. #2
    Responsable Qt & Livres


    Avatar de dourouc05
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2008
    Messages
    26 772
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Août 2008
    Messages : 26 772
    Par défaut
    Salut,

    Qu'essayes-tu ? Qu'est-ce qui ne va pas ? Des messages d'erreur ?
    Vous souhaitez participer aux rubriques Qt (tutoriels, FAQ, traductions) ou HPC ? Contactez-moi par MP.

    Créer des applications graphiques en Python avec PyQt5
    Créer des applications avec Qt 5.

    Pas de question d'ordre technique par MP !

  3. #3
    Membre confirmé
    Inscrit en
    Mai 2008
    Messages
    117
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 117
    Par défaut
    En fait, j'ai parvenu à intégrer dans le Qtdesigner les plugins de QWT.
    Mais je n'ai pas réussi à les intégrer dans Qt eclipse integration et plus précisément dans son designer, pourtant j'ai copié les dlls suivantes : qwt_designer_plugin5.dll et qwt5.dll dans le chemin suivant :
    C:\eclipse\plugins\com.trolltech.qtcppdesignerplugins.win32.x86_1.4.3

    En outre, j'ai ajouté l'exemple dataplot ( "data_plot.h" et "data_plot.cpp") dans mon application et dans .pro de mon application les lignes suivantes :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    INCLUDEPATH += C:/qwt-5.1.2/include
    LIBS = -LC:/qwt-5.1.2/lib -lqwt5
    l'application se plante.
    et losque je supprime les deux fichiers ajoutées c'est à dire "data_plot.h" et "data_plot.cpp", l'application marche à merveille, je crois il y'a un problème avec la bibliothèque QWT, pourant, il n'y a pas d'erreur lorsque je l'ai compilé.
    ou j'ai mal introduit QWT dans mon .pro

    "data_plot.h"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
    #ifndef _DATA_PLOT_H
    #define _DATA_PLOT_H 1
     
    #include "ManagementConsoleView.h"
     
    #include <qwt_plot.h>
     
    class ManagementConsoleView;
     
    const int PLOT_SIZE = 201;      // 0 to 200
     
    class DataPlot : public QwtPlot
    {
        Q_OBJECT
     
    public:
     
        DataPlot(ManagementConsoleView * console, QWidget *parent = 0);
     
    public slots:
     
        void setTimerInterval(double interval);
     
    protected:
     
        virtual void timerEvent(QTimerEvent *e);
     
    private:
     
    	ManagementConsoleView * console;
        void alignScales();
     
        double d_x[PLOT_SIZE];
        double d_y[PLOT_SIZE];
        double d_z[PLOT_SIZE];
     
        int d_interval; // timer in ms
        int d_timerId;
    };
     
    #endif
    et "data_plot.cpp"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
     
    #include <stdlib.h>
    #include <qwt_painter.h>
    #include <qwt_plot_canvas.h>
    #include <qwt_plot_marker.h>
    #include <qwt_plot_curve.h>
    #include <qwt_scale_widget.h>
    #include <qwt_legend.h>
    #include <qwt_scale_draw.h>
    #include <qwt_math.h>
    #include "data_plot.h"
     
    DataPlot::DataPlot(ManagementConsoleView * console,
    		QWidget *parent):
        QwtPlot(parent),
        d_interval(0),
        d_timerId(-1)
    {
    	this->console = console;
        // Disable polygon clipping
        QwtPainter::setDeviceClipping(false);
     
        // We don't need the cache here
        canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
        canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
     
    #if QT_VERSION >= 0x040000
    #ifdef Q_WS_X11
        /*
           Qt::WA_PaintOnScreen is only supported for X11, but leads
           to substantial bugs with Qt 4.2.x/Windows
         */
        canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
    #endif
    #endif
     
        alignScales();
     
        //  Initialize data
        for (int i = 0; i< PLOT_SIZE; i++)
        {
            d_x[i] = 0.5 * i;     // time axis
            d_y[i] = 0;
            d_z[i] = 0;
        }
     
        // Assign a title
        setTitle("A Test for High Refresh Rates");
        insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
     
        // Insert new curves
        QwtPlotCurve *cRight = new QwtPlotCurve("Data Moving Right");
        cRight->attach(this);
     
        QwtPlotCurve *cLeft = new QwtPlotCurve("Data Moving Left");
        cLeft->attach(this);
     
        // Set curve styles
        cRight->setPen(QPen(Qt::red));
        cLeft->setPen(QPen(Qt::blue));
     
        // Attach (don't copy) data. Both curves use the same x array.
        cRight->setRawData(d_x, d_y, PLOT_SIZE);
        cLeft->setRawData(d_x, d_z, PLOT_SIZE);
     
    #if 0
        //  Insert zero line at y = 0
        QwtPlotMarker *mY = new QwtPlotMarker();
        mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
        mY->setLineStyle(QwtPlotMarker::HLine);
        mY->setYValue(0.0);
        mY->attach(this);
    #endif
     
        // Axis
        setAxisTitle(QwtPlot::xBottom, "Time/seconds");
        setAxisScale(QwtPlot::xBottom, 0, 100);
     
        setAxisTitle(QwtPlot::yLeft, "Values");
        setAxisScale(QwtPlot::yLeft, -1.5, 1.5);
     
        setTimerInterval(0.0);
    }
     
    //
    //  Set a plain canvas frame and align the scales to it
    //
    void DataPlot::alignScales()
    {
        // The code below shows how to align the scales to
        // the canvas frame, but is also a good example demonstrating
        // why the spreaded API needs polishing.
     
        canvas()->setFrameStyle(QFrame::Box | QFrame::Plain );
        canvas()->setLineWidth(1);
     
        for ( int i = 0; i < QwtPlot::axisCnt; i++ )
        {
            QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(i);
            if ( scaleWidget )
                scaleWidget->setMargin(0);
     
            QwtScaleDraw *scaleDraw = (QwtScaleDraw *)axisScaleDraw(i);
            if ( scaleDraw )
                scaleDraw->enableComponent(QwtAbstractScaleDraw::Backbone, false);
        }
    }
     
    void DataPlot::setTimerInterval(double ms)
    {
        d_interval = qRound(ms);
     
        if ( d_timerId >= 0 )
        {
            killTimer(d_timerId);
            d_timerId = -1;
        }
        if (d_interval >= 0 )
            d_timerId = startTimer(d_interval);
    }
     
    //  Generate new values
    void DataPlot::timerEvent(QTimerEvent *)
    {
        static double phase = 0.0;
     
        if (phase > (M_PI - 0.0001))
            phase = 0.0;
     
        // y moves from left to right:
        // Shift y array right and assign new value to y[0].
     
        for ( int i = PLOT_SIZE - 1; i > 0; i-- )
            d_y[i] = d_y[i-1];
        d_y[0] = sin(phase) * (-1.0 + 2.0 * double(rand()) / double(RAND_MAX));
     
        for ( int j = 0; j < PLOT_SIZE - 1; j++ )
            d_z[j] = d_z[j+1];
     
        d_z[PLOT_SIZE - 1] = 0.8 - (2.0 * phase/M_PI) + 0.4 *
            double(rand()) / double(RAND_MAX);
     
        // update the display
        replot();
     
        phase += M_PI * 0.02;
    }

Discussions similaires

  1. intégrer un fichier image dans une base de donnée?
    Par Lody dans le forum Requêtes
    Réponses: 9
    Dernier message: 16/03/2006, 19h08
  2. [CR][Access] intégrer un viewer dans un formulaire access
    Par nicolak dans le forum SAP Crystal Reports
    Réponses: 7
    Dernier message: 13/01/2003, 15h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo