Скачать 0.89 Mb.
|
2.2 Windows CE (Mobile)Qt поддерживаются Windows mobile 5 и 6 версии. Qt WinCE содержит все основные библиотеки Qt SDK, включая OpenGL. Необходимое ПО (указаны версии на 05.2009):
Вводим в переменную PATH пути до папки IDE и bin Visual Studio и Windows Mobile 6 SDK. Из под командной строки Visual Studio Command Promt кофигурируем Qt под Windows Mobile 6: configure -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 Утилита создаёт программу checksdk.exe для интегрирования Qt с выбранным SDK. А также в корне Qt WinCE – скрипт wm6.bat, в нём прописывыаться необходимые пути до Qt программ и библиотек. Запускаем программу и скрипт: checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script wm6.bat wm6.bat К тому же результату приводит скрипт setcepaths.bat для автоматического поиска необходимого SDK. Далее воспользуемся утилитой nmake для компиляции библиотек под формат Visual Studio: nmake Последующую компиляцию будем производить под IDE VS2008 на Windows Mobile 6 Professional Emulator. В настройках Qt в среде VS2008 укажем пути до Qt win и wince библиотек. Возможна компиляция как debug так и release версий программы. Последующая сборка под устройство не требуется, необходимо лишь создать static версию или скопировать необходимые библиотеки (QtCore4, QtGui4, QtOpenGL4), а также native-библиотеку msvcrt90 в папку с программой. Так выглядит приложение на эмуляторе: Рис.2.2 В ходе тестирования выявлена полная идентичность функциональности с Win32 версией программы. Из недостатков стоит отметить низкую производительность класса QGraphicsScene, из-за чего в ходе навигации задержки отклика программы находятся в окрестности 100 мс. Ощущение таких задержек, возможно, нивелировать путём управления навигацией программы с помощью клавиатуры устройства, где перемещение происходит не «плавно» (частый перехват событий с шагом около 0), а с фиксированным шагом, что позволит программе при перемещении к одной и той же точке обрабатывать меньше событий. Тестирование программы на реальном устройстве не производилось. ТестированиеТестирование проводилость на трёх платформах. Приведём их основные характеристики. PC: Процессор: Athlon64 2.5 ГГц Память: 2.5 Гб S60 (Nokia N82): Процессор: ARM11 332 МГц Память: 128 Мб Win Mobile (Windows Mobile 6 Emulator): Эмулятор запускался на PC. Рассмотрим 3 параметра, влияющие на удобство работы с программой. Время загрузки – время загрузки программы до появления основного окна и прорисовки всего интерфейса. Время отклика – время, которое необходимо программе, чтобы по запросу пользователя переместить вид в другую точку, а также совершить увеличение/уменьшение или поворот. Объём используемой памяти – объём оперативной памяти, который необходим для успешной загрузки и работы программы. На PC объём может варьироваться в зависимости от размера окна программы (за минимум берётся окно 320×240, за максимум - 640×400). В режиме Full Screen программе требуется 20.5 Мб, если разрешение монитора пользователя установлено в режиме не менее 800×600. Результаты представлены в таблице
Заключение В ходе выполнения работы было выполнено:
литература
Материал с интернет-ресурсов:
приложение Листинг 1 main.cpp #include "mainwindow.h" #include #include int main(int argc, char **argv) { Q_INIT_RESOURCE(images); QApplication app(argc, argv); app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); QSplashScreen splash(QPixmap(":/splsh.png")); splash.show(); app.processEvents(); MainWindow window; window.resize(240,270); window.show(); splash.finish(&window); return app.exec(); } Листинг 2 mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include QT_FORWARD_DECLARE_CLASS(QGraphicsScene) class MainWindow : public QWidget { Q_OBJECT public: MainWindow(QWidget *parent = 0); public slots: void setValue(int nValue1, int nValue2); private: void populateScene(int dH, int dG); QGraphicsScene *scene; QProgressBar *progressBar; }; #endif Листинг 3 mainwindow.сpp #include "mainwindow.h" #include "view.h" #include "star.h" #include "ruler.h" #include "constellation.h" #include MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { scene = new QGraphicsScene; progressBar = new QProgressBar; QString dH, dG; QFile file(":/coord.ini"); if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); if (stream.status() != QTextStream::Ok) { qDebug() << "Ошибка чтения файла"; file.close ();} while(!stream.atEnd()){ stream.readLine(); dH = stream.readLine(); dG = stream.readLine();} file.close();} int intDh = dH.mid(dH.indexOf("=")+1,dH.indexOf(";")-dH.indexOf("=")-1).toInt(); int intDg = dG.mid(dG.indexOf("=")+1,dG.indexOf(";")-dG.indexOf("=")-1).toInt(); populateScene(intDh,intDg); progressBar->setRange(0,5807); View *view = new View("*"); view->view()->setScene(scene); scene->installEventFilter(view); scene->setItemIndexMethod(QGraphicsScene::NoIndex); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->addWidget(view); layout->addWidget(progressBar); setLayout(layout); setWindowTitle(tr("Constellations")); connect(view, SIGNAL(valueChanged(int, int)), this, SLOT(setValue(int, int)));} void MainWindow::populateScene(int dH, int dG) { int H = dH; int G = dG; if (dH>12) dH = 36 - dH; else dH = 12 - dH; // Populate scene scene->clear(); progressBar->setValue(0); if (this->isVisible()) progressBar->show(); QGraphicsItem *camera = scene->addEllipse(0,0,1,1); QGraphicsLineItem *GMTline = scene->addLine(0,0,0,0,QPen(QColor(Qt::NoBrush),0)); GMTline->setData(0,"ruler"); int h = 24 - dH; if (h == 24) h = 0; for (int i = 0; i<24; i++){ QFont font("Times", 40); font.setStyleStrategy(QFont::ForceOutline); QVariant hStr = h; QGraphicsTextItem *hour = new Ruler(hStr.toString()); hour->setData(0,"ruler"); hour->setParentItem(GMTline); hour->setPos(i*942.47,-8); QGraphicsLineItem *hLine = scene->addLine(0,0,0,30,QPen(QColor(Qt::magenta),0)); hLine->setParentItem(hour); hLine->setData(0,"ruler"); h++; if (h == 24) h = 0;} GMTline->setZValue(20); QGraphicsLineItem *GradLine = scene->addLine(0,0,0,0,QPen(QColor(Qt::NoBrush),0)); GradLine->setData(0,"ruler"); GradLine->setZValue(21); int g; if (dG>0) g = dG - 90; else g = dG + 90; for (int i = -6; i<6; i++){ QFont font("Times", 40); font.setStyleStrategy(QFont::ForceOutline); QVariant hStr = g; QGraphicsTextItem *grad = new Ruler(hStr.toString()); grad->setData(0,"ruler"); grad->setParentItem(GradLine); grad->setPos(0,i*15*62.8318); QGraphicsLineItem *gLine = scene->addLine(0,-10,30,-10,QPen(QColor(Qt::magenta),0)); gLine->setParentItem(grad); gLine->setData(0,"ruler"); g = g - 15; if (g < -90) g = g + 180;} QString starData, consName="", consPrevName; QPointF posStar1, posStar2; int idStar1, idStar2; QFile file(":/mycat.txt"); if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); if (stream.status() != QTextStream::Ok) { qDebug() << "Ошибка чтения файла"; file.close ();} while(!stream.atEnd()){ starData = stream.readLine(); QGraphicsItem *item = new Star(starData, dH, dG); scene->addItem(item); progressBar->setValue(progressBar->value()+1);} file.close();} QRectF sceneRect = scene->sceneRect(); QGraphicsItem *constellation = new Constellation("",QColor(Qt::white)); file.setFileName(":/Sozvezd.txt"); if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); if (stream.status() != QTextStream::Ok) { qDebug() << "Ошибка чтения файла"; file.close ();} while(!stream.atEnd()){ consPrevName = consName; stream >> consName; stream >> idStar1; stream >> idStar2; posStar1 = QPointF(-1,-1); posStar2 = QPointF(-1,-1); for (int i=0; i if (scene->items().at(i)->data(2) == "star" && scene->items().at(i)->data(0) == idStar1) posStar1 = scene->items().at(i)->pos(); if (scene->items().at(i)->data(2) == "star" && scene->items().at(i)->data(0) == idStar2) posStar2 = scene->items().at(i)->pos();} QLineF Line[10]; Line[0] = QLineF(posStar1,posStar2); Line[1] = QLineF(posStar1,posStar2+QPointF(sceneRect.width(),0)); Line[2] = QLineF(posStar1,posStar2+QPointF(sceneRect.width(),-scene->height())); Line[3] = QLineF(posStar1,posStar2+QPointF(0,-sceneRect.height())); Line[4] = QLineF(posStar1,posStar2+QPointF(-sceneRect.width(),-sceneRect.height())); Line[5] = QLineF(posStar1,posStar2+QPointF(-sceneRect.width(),0)); Line[6] = QLineF(posStar1,posStar2+QPointF(-sceneRect.width(),sceneRect.height())); Line[7] = QLineF(posStar1,posStar2+QPointF(0,sceneRect.height())); Line[8] = QLineF(posStar1,posStar2+QPointF(sceneRect.width(),sceneRect.height())); Line[9] = QLineF(posStar1,posStar2); for(int i = 1; i < 9; ++i) { progressBar->setValue(progressBar->value()+1); if (Line[i].length() < Line[9].length()) Line[9] = Line[i]; } if (posStar1 != QPointF(-1,-1) && posStar2 != QPointF(-1,-1)){ QGraphicsLineItem *line = scene->addLine(Line[9],QPen(QColor(Qt::white),7)); QGraphicsRectItem *boundRect = scene->addRect(Line[9].x1(),Line[9].y1(),-Line[9].x1()+Line[9].x2(),-Line[9].y1()+Line[9].y2(),Qt::NoPen,Qt::NoBrush); if (consPrevName == consName){ boundRect->setParentItem(constellation); } else{ constellation = new Constellation(consName,QColor(Qt::white)); scene->addItem(constellation); constellation->setPos(Line[9].x1(),Line[9].y1()); } if (Line[9].length() != Line[0].length()){ QLineF Line[10]; Line[0] = QLineF(posStar1,posStar2); Line[1] = QLineF(posStar1+QPointF(sceneRect.width(),0),posStar2); Line[2] = QLineF(posStar1+QPointF(sceneRect.width(),-sceneRect.height()),posStar2); Line[3] = QLineF(posStar1+QPointF(0,-sceneRect.height()),posStar2); Line[4] = QLineF(posStar1+QPointF(-sceneRect.width(),-sceneRect.height()),posStar2); Line[5] = QLineF(posStar1+QPointF(-sceneRect.width(),0),posStar2); Line[6] = QLineF(posStar1+QPointF(-sceneRect.width(),sceneRect.height()),posStar2); Line[7] = QLineF(posStar1+QPointF(0,sceneRect.height()),posStar2); Line[8] = QLineF(posStar1+QPointF(sceneRect.width(),sceneRect.height()),posStar2); Line[9] = QLineF(posStar1,posStar2); for(int i = 1; i < 9; ++i) { if (Line[i].length() < Line[9].length()) Line[9] = Line[i]; } progressBar->setValue(progressBar->value()+1); QGraphicsItem *line = scene->addLine(Line[9],QPen(QColor(Qt::white),7)); scene->addItem(line); } } } file.close();} scene->setSceneRect(sceneRect.x()+20,sceneRect.y(),sceneRect.width(),sceneRect.height()); GMTline->setLine(0,0,sceneRect.width(),0); GradLine->setLine(0,sceneRect.y(),0,sceneRect.height()); progressBar->hide(); file.setFileName(":/coord.ini"); if (!file.open(QIODevice::ReadOnly)) { qDebug() << "Ошибка открытия для записи"; } QVariant dHstr = H; QVariant dGstr = G; QByteArray descr = file.readLine(); QByteArray ArrAscension = file.readLine(); QByteArray ArrDeclination = file.readLine(); file.close(); if (!file.open(QIODevice::ReadWrite)) { qDebug() << "Ошибка открытия для записи"; } QVariant AscValOld = ArrAscension; QString StrAscValStrOld = AscValOld.toString(); AscValOld = StrAscValStrOld.mid(StrAscValStrOld.indexOf("=")+1,StrAscValStrOld.indexOf(";")-StrAscValStrOld.indexOf("=")-1); int intAscValOld = AscValOld.toInt(); AscValOld = intAscValOld; ArrAscension.replace(AscValOld.toByteArray(),dHstr.toByteArray()); QVariant DecValOld = ArrDeclination; QString StrDecValStrOld = DecValOld.toString(); DecValOld = StrDecValStrOld.mid(StrDecValStrOld.indexOf("=")+1,StrDecValStrOld.indexOf(";")-StrDecValStrOld.indexOf("=")-1); int intDecValOld = DecValOld.toInt(); DecValOld = intDecValOld; ArrDeclination.replace(DecValOld.toByteArray(),dGstr.toByteArray()); file.write(descr); file.write(ArrAscension); ArrDeclination.resize(ArrDeclination.size()); file.write(ArrDeclination); file.close(); } void MainWindow::setValue(int nValue1, int nValue2){ populateScene(nValue1,nValue2); update(); } Листинг 4 view.h #ifndef VIEW_H #define VIEW_H #include #include #include QT_FORWARD_DECLARE_CLASS(QGraphicsView) class View : public QFrame { Q_OBJECT public: View(const QString &name, QWidget *parent = 0); QGraphicsView *view() const; protected: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void keyPressEvent(QKeyEvent *event); void wheelEvent(QWheelEvent *event); void timerEvent(QTimerEvent*); void paintEvent(QPaintEvent *); bool eventFilter(QObject* pobj, QEvent* pe); private slots: void resetView(); void setResetButtonEnabled(); void setupMatrix(); void goToNextItem(); void toggleFullScreen(); void toggleOpenGL(); void toggleAntialiasing(); void toggleShowRule(); void searchStar(); void searchConstellation(); void setGMT(); void zoomIn(); void zoomOut(); void rotateLeft(); void rotateRight(); void about(); void quit(); signals: void valueChanged(int nValue1, int nValue2); private: QGraphicsView *graphicsView; QLabel *label; QToolButton *nextItemButton; QToolButton *searchButton; QToolButton *resetButton; QSlider *zoomSlider; QSlider *rotateSlider; QToolButton *rotateLeftIcon; QToolButton *rotateRightIcon; QToolButton *zoomInIcon; QToolButton *zoomOutIcon; QToolButton *menuButton; QToolButton *hourButton; QMenu *searchMenu; QMenu *menu; QAction* FullScreen; QAction* Antialising; QAction* OpenGl; QAction* showRule; QAction* showCons; int timerId; int rotateCount; bool rotateL; bool nextItem; int itemsCount; QGraphicsView *compView; }; #endif Листинг 5 view.cpp #include "view.h" #include "InputDialog.h" #include #ifndef QT_NO_OPENGL #include #endif #include View::View(const QString &name, QWidget *parent) : QFrame(parent),timerId(0),rotateCount(1), itemsCount(74), rotateL(false), nextItem(false) { setFrameStyle(Sunken | StyledPanel); graphicsView = new QGraphicsView; graphicsView->setRenderHint(QPainter::Antialiasing, false); graphicsView->setOptimizationFlags(QGraphicsView::DontSavePainterState); graphicsView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); graphicsView->setBackgroundBrush(QBrush(QColor(Qt::black))); graphicsView->setCacheMode(QGraphicsView::CacheBackground); graphicsView->setFocus(); graphicsView->setDragMode(QGraphicsView::ScrollHandDrag); QSize iconSize(10, 10); zoomInIcon = new QToolButton; zoomInIcon->setAutoRepeat(true); zoomInIcon->setAutoRepeatInterval(22); zoomInIcon->setAutoRepeatDelay(0); zoomInIcon->setText(tr("+")); //zoomInIcon->setIcon(QPixmap(":/zoomin.png")); zoomInIcon->setIconSize(iconSize); zoomOutIcon = new QToolButton; zoomOutIcon->setAutoRepeat(true); zoomOutIcon->setAutoRepeatInterval(22); zoomOutIcon->setAutoRepeatDelay(0); zoomOutIcon->setText(tr("-")); // zoomOutIcon->setIcon(QPixmap(":/zoomout.png")); zoomOutIcon->setIconSize(iconSize); zoomSlider = new QSlider; zoomSlider->setMinimum(0); zoomSlider->setMaximum(300); zoomSlider->setValue(100); zoomSlider->setTickPosition(QSlider::TicksRight); // Zoom slider layout QVBoxLayout *zoomSliderLayout = new QVBoxLayout; zoomSliderLayout->addWidget(zoomSlider); zoomSliderLayout->addWidget(zoomInIcon); zoomSliderLayout->addWidget(zoomOutIcon); rotateLeftIcon = new QToolButton; rotateLeftIcon->setText(tr("<-")); rotateRightIcon = new QToolButton; rotateRightIcon->setText(tr("->")); rotateRightIcon->setAutoRepeat(true); rotateSlider = new QSlider; rotateSlider->setOrientation(Qt::Horizontal); rotateSlider->setMinimum(-18000); rotateSlider->setMaximum(18000); rotateSlider->setValue(0); rotateSlider->setTickInterval(9000); rotateSlider->setTickPosition(QSlider::TicksBelow); resetButton = new QToolButton; resetButton->setText(tr("0")); resetButton->setEnabled(false); //Compas compView = new QGraphicsView; QGraphicsScene *comp = new QGraphicsScene; QGraphicsEllipseItem *compEllipse = comp->addEllipse(-9,-9,18,18,QPen(QColor(Qt::black),0),QBrush(QColor(Qt::lightGray))); QGraphicsLineItem *S = comp->addLine(0,0,0,9,QPen(QColor(Qt::red),2)); QGraphicsLineItem *N = comp->addLine(0,-9,0,0,QPen(QColor(Qt::blue),2)); S->setParentItem(compEllipse); N->setParentItem(compEllipse); compView->setFixedSize(25,25); compView->setFrameShadow(QFrame::Plain); compView->setLineWidth(0); compView->setMidLineWidth(0); compView->setFrameShape(QFrame::NoFrame); compView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); compView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); compView->setScene(comp); // Rotate slider layout QHBoxLayout *rotateSliderLayout = new QHBoxLayout; rotateSliderLayout->addWidget(compView); rotateSliderLayout->addWidget(rotateSlider); rotateSliderLayout->addWidget(rotateLeftIcon); rotateSliderLayout->addWidget(rotateRightIcon); rotateSliderLayout->addWidget(resetButton); // menu QHBoxLayout *labelLayout = new QHBoxLayout; label = new QLabel(name); menuButton = new QToolButton; menuButton->setText(tr("menu")); menu = new QMenu("&Menu"); menuButton->setPopupMode(QToolButton::InstantPopup); FullScreen = menu->addAction("FullScreen", this, SLOT(toggleFullScreen())); FullScreen->setCheckable(true); FullScreen->setChecked(false); Antialising = menu->addAction("Antialising", this, SLOT(toggleAntialiasing())); Antialising->setCheckable(true); Antialising->setChecked(false); OpenGl = menu->addAction("OpenGL", this, SLOT(toggleOpenGL())); OpenGl->setCheckable(true); OpenGl->setChecked(false); #ifndef QT_NO_OPENGL OpenGl->setEnabled(QGLFormat::hasOpenGL()); #else OpenGl->setEnabled(false); #endif showRule = menu->addAction("Show rule", this, SLOT(toggleShowRule())); showRule->setCheckable(true); showRule->setChecked(true); menu->addSeparator(); menu->addAction("About", this, SLOT(about())); menu->addSeparator(); menu->addAction("Exit", this, SLOT(quit())); menuButton->setMenu(menu); nextItemButton = new QToolButton; nextItemButton->setText(tr("next")); hourButton = new QToolButton; hourButton->setIcon(QIcon(QPixmap(":/clock.png"))); searchButton = new QToolButton; searchButton->setIcon(QIcon(QPixmap(":/filesearch.png"))); searchMenu = new QMenu("Search"); searchButton->setPopupMode(QToolButton::InstantPopup); searchMenu->addAction("&Star", this, SLOT(searchStar())); searchMenu->addAction("&Constellation", this, SLOT(searchConstellation())); searchButton->setMenu(searchMenu); labelLayout->addWidget(label); labelLayout->addWidget(menuButton); labelLayout->addStretch(); labelLayout->addWidget(hourButton); labelLayout->addWidget(nextItemButton); labelLayout->addWidget(searchButton); QGridLayout *topLayout = new QGridLayout; topLayout->addLayout(labelLayout, 0, 0); topLayout->addWidget(graphicsView, 1, 0); topLayout->addLayout(zoomSliderLayout, 1, 1); topLayout->addLayout(rotateSliderLayout, 2, 0); setLayout(topLayout); connect(resetButton, SIGNAL(clicked()), this, SLOT(resetView())); connect(zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setupMatrix())); connect(rotateSlider, SIGNAL(valueChanged(int)), this, SLOT(setupMatrix())); connect(graphicsView->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(setResetButtonEnabled())); connect(graphicsView->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(setResetButtonEnabled())); connect(nextItemButton, SIGNAL(clicked()), this, SLOT(goToNextItem())); connect(rotateLeftIcon, SIGNAL(clicked()), this, SLOT(rotateLeft())); connect(rotateRightIcon, SIGNAL(clicked()), this, SLOT(rotateRight())); connect(zoomInIcon, SIGNAL(clicked()), this, SLOT(zoomIn())); connect(zoomOutIcon, SIGNAL(clicked()), this, SLOT(zoomOut())); connect(hourButton, SIGNAL(clicked()), this, SLOT(setGMT())); setupMatrix();} QGraphicsView *View::view() const{ return graphicsView;} void View::timerEvent(QTimerEvent*){ if(timerId!=0){ if (rotateL){ rotateSlider->setValue(rotateSlider->value() - 50+rotateCount); rotateCount++; if (rotateCount==50){ killTimer(timerId); timerId = 0; rotateCount=1; rotateL = false; rotateLeftIcon->setEnabled(true); } } if(nextItem){ graphicsView->centerOn(graphicsView->items().at(0)->pos().x(), graphicsView->items().at(0)->pos().y()); graphicsView->items().at(0)->setPos(graphicsView->items().at(0)->pos()+(QPointF(graphicsView->items().at(itemsCount)->pos())-graphicsView->items().at(0)->pos())/(40)); rotateCount++; if (rotateCount==200){ killTimer(timerId); timerId = 0; rotateCount=1; nextItem = false; nextItemButton->setEnabled(true); } } }} void View::resetView(){ rotateSlider->setValue(0); graphicsView->centerOn(11310,0); setupMatrix(); resetButton->setEnabled(false);} void View::setResetButtonEnabled(){ resetButton->setEnabled(true);} void View::setupMatrix(){ qreal scale = qPow(qreal(2), (zoomSlider->value() - 250) / qreal(50)); if (rotateSlider->value() != 0){ graphicsView->setDragMode(QGraphicsView::RubberBandDrag); } else { graphicsView->setDragMode(QGraphicsView::ScrollHandDrag); setResetButtonEnabled(); } QMatrix matrix; matrix.scale(scale, scale); matrix.rotate(qreal(rotateSlider->value())/100); graphicsView->setMatrix(matrix); QMatrix compasMatrix; compasMatrix.rotate(qreal(rotateSlider->value())/100); compView->setMatrix(compasMatrix);} void View::goToNextItem(){ graphicsView->items().at(0)->setPos(graphicsView->items().at(itemsCount)->pos()); itemsCount++; if (graphicsView->items().at(itemsCount)->data(2)!="star") itemsCount = 74; nextItem = true; timerId=startTimer(13); nextItemButton->setDisabled(true);} void View::setGMT(){ bool bOk; InputDialog* pInputDialog = new InputDialog; pInputDialog->setWindowTitle("Changing view"); if (pInputDialog->exec() == QDialog::Accepted) { int dH = pInputDialog->hour().toInt(); int dG = pInputDialog->grad().toInt(); emit valueChanged(dH, dG); delete pInputDialog; }} void View::toggleFullScreen(){ //emit ValueChanged(FullScreen->isChecked()); QPoint geo = this->parentWidget()->mapFromGlobal(QPoint(0, 0)); if (FullScreen->isChecked())this->parentWidget()->showFullScreen(); else{ this->parentWidget()->showMaximized(); #if defined(Q_WS_WIN) or (Q_WS_X11) this->parentWidget()->setGeometry(200, 200, 640, 400); #endif }} void View::toggleOpenGL(){ #ifndef QT_NO_OPENGL //graphicsView->setViewport(openGlButton->isChecked() ? new QGLWidget(QGLFormat(QGL::SampleBuffers)) : new QWidget); graphicsView->setViewport(OpenGl->isChecked() ? new QGLWidget(QGLFormat(QGL::SampleBuffers)) : new QWidget); compView->setViewport(OpenGl->isChecked() ? new QGLWidget(QGLFormat(QGL::SampleBuffers)) : new QWidget); #endif} void View::toggleAntialiasing(){ graphicsView->setRenderHint(QPainter::Antialiasing, Antialising->isChecked()); compView->setRenderHint(QPainter::Antialiasing, Antialising->isChecked());} void View::toggleShowRule(){ if (!showRule->isChecked()){ graphicsView->items().at(1)->hide(); graphicsView->items().at(50)->hide();} else{ graphicsView->items().at(1)->show(); graphicsView->items().at(50)->show(); }} void View::searchStar(){ bool bOk; bool bSearched = false; QString str = QInputDialog::getText(0, "Search the star", "The Star's Name:", QLineEdit::Normal, "alpha", &bOk ); if (!bOk) { //cancel} else{int i; for (i = 0; i if (graphicsView->items().at(i)->data(1)==str.toLower() && graphicsView->items().at(i)->data(2) == "star"){ zoomSlider->setValue(270); graphicsView->centerOn(graphicsView->items().at(i)); bSearched = true; } if(!bSearched) QMessageBox::information(0, "sorry", "The star with such name is not found");}} void View::searchConstellation(){ bool bOk; bool bSearched = false; QString str = QInputDialog::getText(0, "Search the constellation", "The Constellations's Name:", QLineEdit::Normal, "cassiopea", &bOk ); if (!bOk) { //cancel} else{int i; for (i = 0; i if (graphicsView->items().at(i)->data(0)==str.toLower() && graphicsView->items().at(i)->data(1) == "constellation"){ zoomSlider->setValue(250); rotateSlider->setValue(0); setupMatrix(); graphicsView->fitInView(graphicsView->items().at(i)->childrenBoundingRect(),Qt::KeepAspectRatio); zoomSlider->setValue(50*(qLn(graphicsView->matrix().m11())/qLn(2))+245); bSearched = true; } if(!bSearched) QMessageBox::information(0, "sorry", "The constellation with such name is not found"); }} void View::zoomIn(){ zoomSlider->setValue(zoomSlider->value() + 1);} void View::zoomOut(){ zoomSlider->setValue(zoomSlider->value() - 1);} void View::rotateLeft(){ rotateSlider->setValue(rotateSlider->value() - 10); rotateL=true; timerId=startTimer(1); rotateLeftIcon->setDisabled(true);} void View::rotateRight(){ rotateSlider->setValue(rotateSlider->value() + 100);} void View::about(){ QString translatedTextAboutQt; translatedTextAboutQt = tr( " |
Реферат Флягина Т. А. Проблемы разработки многооконных интерфейсов,... Флягина Т. А. Проблемы разработки многооконных интерфейсов, квалификационная работа на степень бакалавра наук | Реферат: Коваленко А. Е. Разработка системы научной визуализации.... Коваленко А. Е. Разработка системы научной визуализации. Квалификационная работа на степень магистра наук по направлению «Математика.... | ||
Решение проблем, при реализации метафоры манипуляции «Волшебный скальпель» Попова А. В. Использование визуальных манипуляционных метафор при разработке информационной системы, квалификационная работа на степень... | Реферат: Шайдуров А. Г. Исследование и разработка некоторых графических... Шайдуров А. Г. Исследование и разработка некоторых графических алгоритмов. Квалификационная работа на степень магистра наук по направлению... | ||
Реферат Пояснительная записка: с., рис., табл., приложений, источников.... Пояснительная записка: с., рис., табл., приложений, источников | Литература Уросов А. П. Разработка методик визуализации для представления работы параллельных программ, квалификационная работа на степень бакалавра... | ||
Реферат в данном дипломном проекте всего: стр. 123, рис. 29, табл.... Тяговая подстанция, распределительное устройство, трансформатор, ток короткого замыкания, преобразовательный агрегат, стуктурная... | Реферат На стр., 12 частей, библ. 17 назв. Авторское право и смежные... «Разработка типовых лицензий на приобретаемые в рамках государственных контрактов фцп “Электронная Россия” (2002-2010 годы) права... | ||
Требования к письменным работам Объем текста работы Объем текста работы определяемом видом работы: выпускная квалификационная работа – 50-75 стр.; курсовая работа – 25-30 стр.; реферат... | Реферат (18 стр., рис., 3 табл.) Объектом исследования являлись системы централизованного и локального водоотведения мо ракитинское | ||
Правительство Российской Федерации Федеральное государственное автономное... Выпускная квалификационная работа. 81 с., 10 рис., 5 приложений, 26 источников литературы | Реферат Алаева В. С. Расчет и моделирование системы электросвязи.... Целью курсовой работы является расчёт и моделирование системы электросвязи в системе схемотехнического моделирования micro-cap 9 | ||
Реферат Объем: 119 стр., 16 рис., 7 табл., 7 использованных источников ... | Проекта: Разработка Web-приложений Разработка web-приложений, бизнес процесс разработки web-приложения, cms drupal, создание сайта кафедры | ||
Реферат Дипломный проект 117 с., 15 рис., 19 табл., 39 источников Цель работы – детальная разработка пункта технического обслуживания электровозов с комплексной механизацией | Реферат 3 3 Содержание 4 4 Определения 5 5 Введение 6 6 Основная... В ходе работы, в течении данного семестра мы изучали технологии веб-программирования и верстки позволяющие делать стабильные, удобные... |