qse  0.5.0
qsedataexportpreviewui.cpp
Go to the documentation of this file.
2 #include <QTextEdit>
3 
5  : QDialog(parent),
6  m_Preview(preview)
7 {
8  setupUi(this);
9 
10  connect(m_Preview, SIGNAL(dataChanged()), this, SLOT(onDataChanged()));
11 }
12 
14 {
15  int nfiles = m_Preview -> countFiles();
16  int ntabs = m_PreviewTabs -> count();
17 
18  for (int i=ntabs; i>0; i--) {
19  QWidget *w = m_PreviewTabs -> widget(i);
20  m_PreviewTabs -> removeTab(i);
21  delete w;
22  }
23 
24  m_PreviewTabs -> clear();
25 
26  for (int i=0; i<nfiles; i++) {
27  QTextEdit *t = new QTextEdit();
28 
29  t -> setObjectName(m_Preview->getFile(i));
30  t -> setReadOnly(true);
31  t -> setLineWrapMode(QTextEdit::NoWrap);
32 
33 #ifdef __qse_fink
34  QString txt = m_Preview -> getLines(i);
35  txt.replace(QString("\t"),QString(" "));
36  t -> setPlainText(txt);
37 #else
38  t -> setPlainText(m_Preview -> getLines(i));
39 #endif
40 
41  m_PreviewTabs -> addTab(t, m_Preview->getFile(i));
42  }
43 }