# -*- mode: sh -*- ################################################
# Qwt Widget Library
# Copyright (C) 1997 Josef Wilgen
# Copyright (C) 2002 Uwe Rathmann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Qwt License, Version 1.0
###################################################################
QWT_ROOT = $$PWD
include( $${QWT_ROOT}/qwtconfig.pri )
SUFFIX_STR =
VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {
# Qt 3
debug {
SUFFIX_STR = $${DEBUG_SUFFIX}
}
else {
SUFFIX_STR = $${RELEASE_SUFFIX}
}
}
else {
CONFIG(debug, debug|release) {
SUFFIX_STR = $${DEBUG_SUFFIX}
}
else {
SUFFIX_STR = $${RELEASE_SUFFIX}
}
}
INCLUDEPATH += $${QWT_ROOT}/src
DEPENDPATH += $${QWT_ROOT}/src
QWTLIB = qwt$${SUFFIX_STR}
win32 {
contains(CONFIG, QwtDll) {
DEFINES += QWT_DLL
QWTLIB = $${QWTLIB}$${VER_MAJ}
}
win32-msvc:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc.net:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc2002:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc2003:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc2005:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-msvc2008:LIBS += $${QWT_ROOT}/lib/$${QWTLIB}.lib
win32-g++:LIBS += -L$${QWT_ROOT}/lib -l$${QWTLIB}
}
else {
LIBS += -L$${QWT_ROOT}/lib -l$${QWTLIB}
}
#=========== Files =================
HEADERS += $${PWD}\src\background.h \
$${PWD}\src\cpucurve.h \
$${PWD}\src\cpuplot.h \
$${PWD}\src\cpustat.h \
$${PWD}\src\timescaledraw.h
SOURCES += $${PWD}\src\cpuplot.cpp \
$${PWD}\src\cpustat.cpp
#========= Dependency ==============
DEPENDPATH += $${PWD}\src
INCLUDEPATH += $${PWD}\src
# --- Qt ---
# --- External ---
include($$(LIBS)\qwt-5.1.2p1\qwt.pri)
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QWidget>
class CpuPlot;
class MainWindow : public QWidget
{
Q_OBJECT
public:
MainWindow(QWidget *p_parent = 0);
protected:
CpuPlot *win;
};
#endif //MAINWINDOW_H
#include <QtGui>
#include "cpuplot.h"
#include "mainwindow.h"
MainWindow::MainWindow(QWidget* p_parent) : QWidget(p_parent)
{
win = new CpuPlot(this);
QVBoxLayout *l = new QVBoxLayout();
l->addWidget(win);
setLayout(l);
setWindowTitle(tr("Снятие осцилограммы"));
}
#include <QApplication>
#include <QTextCodec>
#include <QLocale>
#include <QTranslator>
#include <QDir>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QDir dir_plugin; // каталог плагинов
QString locale; // язык локали
QTranslator *qttr, *apptr; // переводчик программы
QStringList list_path; // Список путей
QApplication app(argc, argv);
// Устанавливаем кодеки
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); // Для функций перевода tr()
// устанавливаем путь к плагинам (добавим каталог бинаря)
dir_plugin = QDir(qApp->applicationDirPath()+"/plugins/");
list_path << dir_plugin.absolutePath() << qApp->libraryPaths();
qApp->setLibraryPaths(list_path);
// Устанавливаем превод библиотек Qt
locale = QLocale::system().name(); // запрос языка (например: "ru")
qttr = new QTranslator;
qttr->load(QString("qt_") + locale); // загрузка файла qt_*.qm
qApp->installTranslator(qttr); // установка переводчика
// Устанавливаем превод программы
apptr = new QTranslator;
apptr->load(QString("osciloscop_") + locale); // загрузка файла qt_*.qm
qApp->installTranslator(apptr); // установка переводчика
MainWindow mainWin;
mainWin.resize(300, 300);
mainWin.show();
return app.exec();
}
TARGET = myapp
TEMPLATE = app
DESTDIR = ..
CONFIG += debug_and_release build_all
CONFIG (debug, debug|release) {
TARGET = $$join(TARGET,,,.d)
CONFIG += console
}
#=========== Files =================
HEADERS += mainwindow.h
SOURCES += mainwindow.cpp
SOURCES += main.cpp
#========= Dependency ==============
DEPENDPATH += .
INCLUDEPATH += .
include(../cpuplot/cpuplot.pri)
TRANSLATIONS += $${DESTDIR}/osciloscop_ru.ts
CODECFORTR = UTF-8
In file included from qwt_picker.h:20,
from qwt_panner.cpp:20:
qwt_event_pattern.h:216: warning: type attributes ignored after type is already defined
qwt_event_pattern.h:217: warning: type attributes ignored after type is already defined
Запускается C:\Qt\qwt-5.2.1\examples\bin\bode.exe...
Не удалось запустить процесс!