-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
282 lines (199 loc) · 6.75 KB
/
mainwindow.h
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include<QWidget>
#include <QFile>
#include <QMainWindow>
#include <QTextStream>
#include<QFileDialog>
#include<QProcess>
#include<QCursor>
#include<QTextCursor>
#include<QScrollBar>
#include<QListWidgetItem>
#include<QFontDialog>
#include<QFont>
#include<QMessageBox>
#include<QDir>
#include<QStringList>
#include<QListWidgetItem>
#include<QDebug>
#include <sstream>
#include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <ctype.h>
#include<locale>
#include<QTextEdit>
#include<QPlainTextEdit>
#include<QApplication>
#include"highlighter.h"
#include"ejemplos.h"
#include<QPainter>
#include<QItemDelegate>
namespace Ui {
class MainWindow;
}
/*
class MyTextEdit : public QTextEdit
{
Q_OBJECT
public :
//void keyPressEvent(QKeyEvent *e);
void keyPressEvent ( QKeyEvent * event );
};
*/
/*
class MyTextEdit : public QTextEdit
{
Q_OBJECT
public:
explicit MyTextEdit(QWidget *parent = 0);
//~MyTextEdit();
protected:
virtual void keyPressEvent ( QKeyEvent * event );
signals:
public slots:
};
*/
class MyDelegate : public QItemDelegate {
public:
MyDelegate( QObject *parent ) : QItemDelegate( parent ) { }
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const {
QItemDelegate::paint( painter, option, index );
painter->setPen(QPen(QColor(0,200,0),1));
//painter->drawLine(option.rect.bottomLeft(),option.rect.topLeft());
//painter->drawLine(option.rect.bottomRight(),option.rect.topRight());
if( index.data(Qt::UserRole)==1) {
painter->drawLine(option.rect.topLeft(),option.rect.topRight());
}
if( index.data(Qt::UserRole)==2) {
painter->drawLine(option.rect.bottomLeft(),option.rect.bottomRight());
}
if( index.data(Qt::UserRole)==3) {
painter->drawLine(option.rect.topLeft(),option.rect.topRight());
painter->drawLine(option.rect.bottomLeft(),option.rect.topLeft());
}
if( index.data(Qt::UserRole)==4) {
painter->drawLine(option.rect.topLeft(),option.rect.topRight());
painter->drawLine(option.rect.bottomRight(),option.rect.topRight());
}
if( index.data(Qt::UserRole)==10) {
painter->drawLine(option.rect.bottomLeft(),option.rect.topLeft());
painter->drawLine(option.rect.topLeft(),option.rect.topRight());
painter->drawLine(option.rect.bottomRight(),option.rect.topRight());
}
}
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QString dir;
QFile file;
QFileInfo fileInfo;
QTextStream in;
QString errorConsola="nada";
QString Consola;
QString codigo[100];
QString direccion[100];
QString nombre[100];
QString dirPuro[100];
QString codigo_t[100];
QString direccion_t[100];
QString nombre_t[100];
QString dirPuro_t[100];
int i=-1,ii=-1,j=0;
QProcess process;
QString convertidorActual="decimal";
QString dirPuro_actual;
private slots:
void on_actionAbrir_triggered();
void on_pushButton_4_clicked();
void on_pushButton_2_clicked();
void on_actionGuardar_triggered();
void on_actionGuardar_como_triggered();
void on_pushButton_clicked();
void on_radioButton_clicked();
void on_radioButton_2_clicked();
void on_lineEdit_returnPressed();
void on_listWidget_clicked(const QModelIndex &index);
void on_textEdit_cursorPositionChanged();
void on_pushButton_6_clicked();
void on_checkBox_clicked();
void processFinished(int code , QProcess::ExitStatus status);
void on_pushButton_7_clicked();
void on_tableWidget_cellPressed(int row, int column);
void on_pushButton_3_clicked();
void on_pushButton_5_clicked();
void on_tableWidget_pressed(const QModelIndex &index);
void on_radioButton_3_clicked();
void on_radioButton_4_clicked();
void on_actionmodo_Blanco_triggered();
void on_actionmodo_Dark_triggered();
void on_actionFuente_2_triggered();
void on_textEdit_textChanged();
void on_actionNuevo_triggered();
void resizeEvent(QResizeEvent* event);
void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
void on_lineEdit_7_returnPressed();
void on_pushButton_9_clicked();
void on_pushButton_8_clicked();
void on_listWidget_currentRowChanged(int currentRow);
void on_pushButton_10_clicked();
void on_textEdit_copyAvailable(bool b);
void on_pushButton_11_clicked();
void on_pushButton_13_clicked();
void on_pushButton_14_clicked();
void on_pushButton_12_clicked();
void on_actionEjemplos_triggered();
void on_actionAgregar_componente_triggered();
void saveNew();
void on_menu_clicked(QAction*);
void on_menu2_clicked(QAction*);
void showContextMenu(const QPoint &pt);
void on_pushButton_15_clicked();
void on_actionGuardar_todo_triggered();
void on_treeView_clicked(const QModelIndex &index);
void on_listView_doubleClicked(const QModelIndex &index);
void on_listView_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
void on_treeView_doubleClicked(const QModelIndex &index);
void on_listWidget_itemChanged(QListWidgetItem *item);
void on_treeView_collapsed(const QModelIndex &index);
bool eventFilter(QObject *object, QEvent *event);
void closeEvent (QCloseEvent *event);
//QString get_component2(QString dir);
//void keyPressEvent(QKeyEvent *e);
QString get_component3(QString dir, QString codigo);
void insertCompletion(const QString& completion);
void insertCompletion2(const QString& completion);
void on_actionInstanciar_componente_triggered();
void on_actionCompilar_triggered();
void declarar_componente();
void instancear_componente();
bool compilar(QString dir);
void guardar(QString dir) ;
void on_listWidget_itemClicked(QListWidgetItem *item);
void on_listWidget_2_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
void on_tabWidget_tabBarClicked(int index);
void on_tabWidget_currentChanged(int index);
void on_actionSalir_triggered();
void on_lineEdit_6_returnPressed();
void on_horizontalSlider_valueChanged(int value);
void on_pushButton_17_clicked();
void on_pushButton_18_clicked();
void on_pushButton_19_clicked();
void on_tableWidget_cellClicked(int row, int column);
private:
Ui::MainWindow *ui;
Highlighter *highlighter;
ejemplos ejemplo;
};
#endif // MAINWINDOW_H