Разработка идеи объединения сторонних решений и реализация многофункционального, легко масштабируемого приложения

Разработка функциональной и структурной схемы программного средства. Реализация основного модуля программы. Реализация модуля печати и модуля обновлений. Изучение взаимодействия информационных технологий, методов их интеграции и обмена данными.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 27.10.2017
Размер файла 3,2 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

QMetaEnum removePolicyEnum = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("RemovePolicy"));

m_removePolicy = removePolicyEnum.keyToValue(value) == -1 ?

Never:

static_cast<RemovePolicy>(removePolicyEnum.keyToValue(value));

int i = 0;

QString key = QString(QLatin1String("download_%1_")).arg(i);

while (settings.contains(key + QLatin1String("url"))) {

QUrl url = settings.value(key + QLatin1String("url")).toUrl();

QString fileName = settings.value(key + QLatin1String("location")).toString();

bool done = settings.value(key + QLatin1String("done"), true).toBool();

if (done && !url.isEmpty() && !fileName.isEmpty()) {

DownloadWidget *widget = new DownloadWidget(0, this);

widget->m_file.setFile(fileName);

widget->fileNameLabel->setText(widget->m_file.fileName());

widget->m_url = url;

widget->stopButton->setVisible(false);

widget->stopButton->setEnabled(false);

widget->progressBar->hide();

addItem(widget);

}

key = QString(QLatin1String("download_%1_")).arg(++i);

}

cleanupButton->setEnabled(m_downloads.count() - activeDownloads() > 0);

}

void DownloadManager::cleanup()

{

if (m_downloads.isEmpty())

return;

m_model->removeRows(0, m_downloads.count());

updateItemCount();

if (m_downloads.isEmpty() && m_iconProvider) {

delete m_iconProvider;

m_iconProvider = 0;

}

m_autoSaver->changeOccurred();

}

void DownloadManager::updateItemCount()

{

int count = m_downloads.count();

itemCount->setText(count == 1 ? tr("1 Download"): tr("%1 Downloads").arg(count));

}

DownloadModel::DownloadModel(DownloadManager *downloadManager, QObject *parent)

: QAbstractListModel(parent)

, m_downloadManager(downloadManager)

{}

QVariant DownloadModel::data(const QModelIndex &index, int role) const

{

if (index.row() < 0 || index.row() >= rowCount(index.parent()))

return QVariant();

if (role == Qt::ToolTipRole)

if (!m_downloadManager->m_downloads.at(index.row())->downloadedSuccessfully())

return m_downloadManager->m_downloads.at(index.row())->downloadInfoLabel->text();

return QVariant();

}

int DownloadModel::rowCount(const QModelIndex &parent) const

{ return (parent.isValid()) ? 0: m_downloadManager->m_downloads.count();}

bool DownloadModel::removeRows(int row, int count, const QModelIndex &parent)

{

if (parent.isValid())

return false;

int lastRow = row + count - 1;

for (int i = lastRow; i >= row; --i) {

if (m_downloadManager->m_downloads.at(i)->downloadedSuccessfully()) {

beginRemoveRows(parent, i, i);

m_downloadManager->m_downloads.takeAt(i)->deleteLater();

endRemoveRows();

}

}

m_downloadManager->m_autoSaver->changeOccurred();

return true;

}

Приложение Ж

(Обязательное)

Исходный код диалогового окона печати в pdf

#include "headers/printtopdfdialog.h"

#include "ui_printtopdfdialog.h"

#include <QtCore/QDir>

#ifndef QT_NO_PRINTER

#include <QtPrintSupport/QPageSetupDialog>

#include <QtPrintSupport/QPrinter>

#endif // QT_NO_PRINTER

#include <QtWidgets/QFileDialog>

PrintToPdfDialog::PrintToPdfDialog(const QString &filePath, QWidget *parent):

QDialog(parent),

currentPageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0))),

ui(new Ui::PrintToPdfDialog)

{

ui->setupUi(this);

setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

connect(ui->chooseFilePathButton, &QToolButton::clicked, this, &PrintToPdfDialog::onChooseFilePathButtonClicked);

#ifndef QT_NO_PRINTER

connect(ui->choosePageLayoutButton, &QToolButton::clicked, this, &PrintToPdfDialog::onChoosePageLayoutButtonClicked);

#else

ui->choosePageLayoutButton->hide();

#endif // QT_NO_PRINTER

updatePageLayoutLabel();

setFilePath(filePath);

}

PrintToPdfDialog::~PrintToPdfDialog()

{

delete ui;

}

void PrintToPdfDialog::onChoosePageLayoutButtonClicked()

{

#ifndef QT_NO_PRINTER

QPrinter printer;

printer.setPageLayout(currentPageLayout);

QPageSetupDialog dlg(&printer, this);

if (dlg.exec() != QDialog::Accepted)

return;

currentPageLayout.setPageSize(printer.pageLayout().pageSize());

currentPageLayout.setOrientation(printer.pageLayout().orientation());

updatePageLayoutLabel();

#endif // QT_NO_PRINTER

}

void PrintToPdfDialog::onChooseFilePathButtonClicked()

{

QFileInfo fi(filePath());

QFileDialog dlg(this, tr("Save PDF as"), fi.absolutePath());

dlg.setAcceptMode(QFileDialog::AcceptSave);

dlg.setDefaultSuffix(QStringLiteral(".pdf"));

dlg.selectFile(fi.absoluteFilePath());

if (dlg.exec() != QDialog::Accepted)

return;

setFilePath(dlg.selectedFiles().first());

}

QString PrintToPdfDialog::filePath() const

{

return QDir::fromNativeSeparators(ui->filePathLineEdit->text());

}

void PrintToPdfDialog::setFilePath(const QString &filePath)

{

ui->filePathLineEdit->setText(QDir::toNativeSeparators(filePath));

}

QPageLayout PrintToPdfDialog::pageLayout() const

{

return currentPageLayout;

}

void PrintToPdfDialog::updatePageLayoutLabel()

{

ui->pageLayoutLabel->setText(QString("%1, %2").arg(

currentPageLayout.pageSize().name()).arg(

currentPageLayout.orientation() == QPageLayout::Portrait

? tr("Portrait"): tr("Landscape")

));

}

Приложение З

(Обязательное)

Скрипт Inno Setup

#define Name "InterinClient"

#define Version "2.0.5"

#define Publisher "ООО Интерин технологии"

#define URL "http://www.interin.ru"

#define ExeName "InterinClient.exe"

[Setup]

AppId={{89ED2222-8C22-4F0B-A1CC-84770F5498F3}}

AppName={#Name}

AppVersion={#Version}

AppPublisher={#Publisher}

AppPublisherURL={#URL}

AppSupportURL={#URL}

AppUpdatesURL={#URL}

AppVerName={#Name} версия {#Version}

DefaultDirName=c:\Interin\InterinAlpha

DefaultGroupName=Interin

UninstallDisplayIcon={app}\{#ExeName}

OutputDir=D:\repos\Development\Builds\Windows\x32\InterinClient\install

OutputBaseFileName={#Name}_{#Version}_setup

Compression=lzma

SolidCompression=yes

;DiskSpanning=yes

;SlicesPerDisk=3

;DiskSliceSize=10000000

;ArchitecturesAllowed=x64

;ArchitecturesInstallIn64BitMode=x64

[Languages]

Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "License_ENG.txt"

Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"; LicenseFile: "License_RUS.txt"

[Tasks]

Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; Flags: unchecked

[Files]

Source: "D:\repos\Development\Builds\Windows\x32\InterinClient\release\{#ExeName}"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "D:\repos\Development\Projects\InterinClient\setup\qt.conf"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "D:\repos\Development\Projects\InterinClient\docs\changelog.txt"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "D:\repos\Development\Builds\Windows\x32\InterinClntMainWnd\release\InterinClntMainWnd.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\msvcp120.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\msvcr120.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\opengl32sw.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Qml.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Quick.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5WebChannel.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5WebEngineCore.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5WebEngineWidgets.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5Xml.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\QtWebEngineProcess.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\bin\Qt5PrintSupport.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\plugins\platforms\qminimal.dll"; DestDir: "{app}\plugins\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\plugins\platforms\qoffscreen.dll"; DestDir: "{app}\plugins\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\plugins\platforms\qwindows.dll"; DestDir: "{app}\plugins\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\resources\*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\Qt\Qt5.7.0\5.7\msvc2013\translations\qtwebengine_locales\*"; DestDir: "{app}\translations\qtwebengine_locales"; Flags: ignoreversion recursesubdirs createallsubdirs

;Source: "E:\install\dotNetFx40_Full_x86_x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: not IsRequiredDotNetDetected

[Registry]

Root: HKCU; Subkey: Software\Interin; Flags: createvalueifdoesntexist uninsdeletekey;

Root: HKCU; Subkey: Software\Interin\InterinClient; Flags: createvalueifdoesntexist;

Root: HKCU; Subkey: Software\Interin\InterinClient\ModulesManager; Flags: createvalueifdoesntexist;

Root: HKCU; Subkey: Software\Interin\InterinClient\ModulesManager; ValueType: string; ValueName: main_module; ValueData: MainWindow; Flags: createvalueifdoesntexist;

Root: HKCU; Subkey: Software\Interin\InterinClient\ModulesManager\MainWindow; Flags: createvalueifdoesntexist;

Root: HKCU; Subkey: Software\Interin\InterinClient\ModulesManager\MainWindow; ValueType: string; ValueName:module_file; ValueData: InterinClntMainWnd.dll; Flags: createvalueifdoesntexist;

Root: HKCU; Subkey: Software\Interin\InterinClient\ModulesManager\MainWindow; ValueType: string; ValueName: module_path; ValueData: c:/Interin/InterinAlpha/; Flags: createvalueifdoesntexist;

[Icons]

Name: "{group}\Interin"; Filename: "{app}\{#ExeName}"

Name: "{group}\{cm:UninstallProgram, {#Name}}"; Filename: "{uninstallexe}"

Name: "{userdesktop}\Интерин Alpha"; Filename: "{app}\{#ExeName}"; Tasks: desktopicon

;[Messages]

;#include "messages_rus.txt"

;[Code]

;#include "InterinClient.pas"

[Run]

;Filename: regedit.exe; Parameters: "/s {tmp}\registry.reg";

;Filename: {tmp}\dotNetFx40_Full_x86_x64.exe; Parameters: "/q:a /c:""install /l /q"""; Check: not IsRequiredDotNetDetected; StatusMsg: Microsoft Framework 4.0 is installed. Please wait...

[UninstallRun]

Filename: regedit.exe; Parameters: "/s -HKEY_CURRENT_USER\Software\Interin";

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.