./gdb programe_name
diff -Naur qwt-6.1.0/qwtconfig.pri qwt-6.1.0_m/qwtconfig.pri
--- qwt-6.1.0/qwtconfig.pri Thu May 30 22:18:27 2013
+++ qwt-6.1.0_m/qwtconfig.pri Sun May 25 00:49:50 2014
@@ -23,7 +23,7 @@
}
win32 {
- QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION
+ QWT_INSTALL_PREFIX = C:/Qt/Qwt-$$QWT_VERSION
}
QWT_INSTALL_DOCS = $${QWT_INSTALL_PREFIX}/doc
qmake qwt.pro
mingw32-make -j3
mingw32-make install
diff -Naur qwtpolar-1.1.0/qwtpolarconfig.pri qwtpolar-1.1.0_m/qwtpolarconfig.pri
--- qwtpolar-1.1.0/qwtpolarconfig.pri Fri Jan 31 15:23:39 2014
+++ qwtpolar-1.1.0_m/qwtpolarconfig.pri Sun May 25 01:06:57 2014
@@ -20,7 +20,7 @@
}
win32 {
- QWT_POLAR_INSTALL_PREFIX = C:/QwtPolar-$$QWT_POLAR_VERSION
+ QWT_POLAR_INSTALL_PREFIX = C:/Qt/QwtPolar-$$QWT_POLAR_VERSION
}
QWT_POLAR_INSTALL_DOCS = $${QWT_POLAR_INSTALL_PREFIX}/doc
qmake -set QMAKEFEATURES "c:/Qt/Qwt-6.1.0/features"
qmake qwtpolar.pro
mingw32-make -j3
mingw32-make install
qmake -set QMAKEFEATURES "f:/Qt/Qwt-6.1.0/features"
#include <QVector>
#include <QFile>
#include <QString>
#include <QTextStream>
#include <QStringList>
#include <iostream>
const QString allFileToString(QFile &aFile)
{
if (!aFile.open(QFile::ReadOnly | QFile::Text)) {
std::cout << "Error opening file!" << std::endl;
return NULL;
}
QTextStream in(&aFile);
return in.readAll();
}
void setDataToVector(const QStringList &aStringList,
QVector< QVector <int> > &aVector)
{
size_t x = aStringList.size() - 1; // Count of line, 8
size_t y = aStringList.at(0).count("\t") + 1; // Count of digits in line, 6
for (size_t i = 0; i < x; ++i) {
QVector<int> temp_vector;
for (size_t j = 0; j < y; ++j) {
temp_vector.push_back(aStringList.at(i).split("\t").at(j).toInt());
}
aVector.push_back(temp_vector);
}
}
void printVector(const QVector< QVector <int> > &aVector)
{
for (int i = 0; i < aVector.size(); ++i) {
for (int j = 0; j < aVector.at(0).size(); ++j) {
std::cout << aVector.at(i).at(j) << "\t";
}
std::cout << std::endl;
}
}
int main(/*int argc, char *argv[]*/)
{
QVector< QVector <int> > vector;
QFile file("test.txt");
setDataToVector(allFileToString(file).split("\n"), vector);
printVector(vector);
return 0;
}
void ScriptWidget::onSaveButtonClick()
{
QFile updateScriptFile("update-script");
if (!updateScriptFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::critical(this, tr("I/O Error"), tr("Error opening file %1\n"
"Error: %2")
.arg(updateScriptFile.fileName())
.arg(updateScriptFile.errorString()));
return;
}
QTextStream out(&updateScriptFile);
out << ui->textEdit->toPlainText(); // Get text from the QTextEdit Widget
updateScriptFile.close();
emit signalSendMessageToStatusBar(QString(tr("File Saved.")));
}
Может кто-нибудь направить на путь истинный?
#include <QApplication>
#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <algorithm>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget() {
gridLayout = new QGridLayout(this);
labelString = new QLabel(tr("String:"));
labelRevertString = new QLabel(tr("Revert string:"));
lineEdit[0] = new QLineEdit();
lineEdit[1] = new QLineEdit();
gridLayout->addWidget(labelString, 0, 0);
gridLayout->addWidget(labelRevertString, 0, 1);
gridLayout->addWidget(lineEdit[0], 1, 0);
gridLayout->addWidget(lineEdit[1], 1, 1);
connect(lineEdit[0], SIGNAL(textEdited(QString)),
this, SLOT(slotTextChanged(QString)));
connect(lineEdit[1], SIGNAL(textEdited(QString)),
this, SLOT(slotTextChanged(QString)));
}
virtual ~Widget() {}
private:
QGridLayout *gridLayout;
QLabel *labelString;
QLabel *labelRevertString;
QLineEdit *lineEdit[2];
private slots:
void slotTextChanged(QString aString) {
std::reverse(aString.begin(), aString.end());
lineEdit[lineEdit[0]->hasFocus()]->setText(aString);
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget widget;
widget.setFixedSize(widget.sizeHint());
widget.show();
return a.exec();
}
#include "moc_main.cpp"
QMAKE_LFLAGS +=-static-libgcc -static-libstdc++
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
#include <iconv.h>
string iconv_recode(const string from, const string to, string text)
{
iconv_t cnv = iconv_open(to.c_str(), from.c_str());
if (cnv == (iconv_t) - 1) {
iconv_close(cnv);
return "";
}
char *outbuf;
if ((outbuf = (char *) malloc(text.length()*2 + 1)) == NULL) {
iconv_close(cnv);
return "";
}
char *ip = (char *) text.c_str(), *op = outbuf;
size_t icount = text.length(), ocount = text.length()*2;
if (iconv(cnv, &ip, &icount, &op, &ocount) != (size_t) - 1) {
outbuf[text.length()*2 - ocount] = '\0';
text = outbuf;
} else {
text = "";
}
free(outbuf);
iconv_close(cnv);
return text;
}
void compare_strings(const string &aString1, const string &aString2) {
cout << "String 1: " << aString1 << endl
<< "String 2: " << aString2 << endl;
if (aString1 == aString2) {
cout << "Identical strings!" << endl
<< "-----" << endl;
} else {
cout << "Different strings!" << endl
<< "-----" << endl;
}
}
int main()
{
ifstream file_1("word_1.txt"); // The "Proverka" Word in UTF-8
ifstream file_2("word_2.txt"); // The "Proverka" Word in CP1251
string word_1, word_2;
file_1 >> word_1;
file_2 >> word_2;
compare_strings(word_1, word_2);
word_2 = iconv_recode("CP1251", "UTF-8", word_2);
compare_strings(word_1, word_2);
return 0;
}
exl@exl-Lenovo-G560e:~/SandBox/text_enc > enca -L russian word_1.txt
Universal transformation format 8 bits; UTF-8
Doubly-encoded to UTF-8 from ISO-8859-5
exl@exl-Lenovo-G560e:~/SandBox/text_enc > enca -L russian word_2.txt
MS-Windows code page 1251
LF line terminators
exl@exl-Lenovo-G560e:~/SandBox/text_enc > cat word_1.txt
Проверка
exl@exl-Lenovo-G560e:~/SandBox/text_enc > cat word_2.txt
��������
exl@exl-Lenovo-G560e:~/SandBox/text_enc > ./text_coding
String 1: Проверка
String 2: ��������
Different strings!
-----
String 1: Проверка
String 2: Проверка
Identical strings!
-----
#include "qpaintwidget.h"
#include <QPainter>
#include <QDebug>
QPaintWidget::QPaintWidget(QWidget *parent)
: QWidget(parent)
{
offset = 0;
resize(800, 600);
paintTimer = new QTimer(this);
paintTimer->start(10);
connect(paintTimer, SIGNAL(timeout()), this, SLOT(updatePixmap()));
}
void QPaintWidget::paintEvent(QPaintEvent *)
{
QColor whitebrush = Qt::white;
QColor blackbrush = Qt::black;
QColor redbrush = Qt::darkRed;
QPainterPath path;
QPainter painter(this); // Создаём новый объект рисовальщика
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::NoPen);
painter.translate(1 + offset, 0);
painter.setBrush(whitebrush);
painter.drawRect(0, 0, width(), height());
QPoint triangle[3] = {
QPoint(180, 450),
QPoint(220, 450),
QPoint(200, 555),
};
painter.setBrush(blackbrush);
painter.drawEllipse(10, 15, 380, 380);
painter.setBrush(redbrush);
painter.drawEllipse(35, 8, 330, 330);
painter.setBrush(whitebrush);
painter.drawEllipse(50, -5, 300, 330);
painter.setBrush(blackbrush);
painter.drawPolygon(triangle, 3);
path.setFillRule(Qt::WindingFill);
path.addRect(180, 250, 40, 200);
path.addRect(150, 250, 100, 20);
painter.drawPath(path);
painter.setBrush(whitebrush);
painter.drawEllipse(120, 260, 60, 20);
painter.drawEllipse(220, 260, 60, 20);
}
void QPaintWidget::updatePixmap()
{
(offset >= 810) ? offset = 0 : offset+=5;
qDebug() << offset;
repaint();
}
QPaintWidget::~QPaintWidget()
{
}
#ifndef QPAINTWIDGET_H
#define QPAINTWIDGET_H
#include <QWidget>
#include <QTimer>
class QPaintWidget : public QWidget
{
Q_OBJECT
int offset;
QTimer *paintTimer;
protected:
void paintEvent(QPaintEvent *);
private slots:
void updatePixmap();
public:
QPaintWidget(QWidget *parent = 0);
~QPaintWidget();
};
#endif // QPAINTWIDGET_H
хочу по программировать на машинном коде