81 fetchButton = new QPushButton(tr("Fetch"), this); |
81 fetchButton = new QPushButton(tr("Fetch"), this); |
82 abortButton = new QPushButton(tr("Abort"), this); |
82 abortButton = new QPushButton(tr("Abort"), this); |
83 abortButton->setEnabled(false); |
83 abortButton->setEnabled(false); |
84 |
84 |
85 treeWidget = new QTreeWidget(this); |
85 treeWidget = new QTreeWidget(this); |
86 connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*, int)), |
86 connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), |
87 this, SLOT(itemActivated(QTreeWidgetItem*))); |
87 this, SLOT(itemActivated(QTreeWidgetItem*))); |
88 QStringList headerLabels; |
88 QStringList headerLabels; |
89 headerLabels << tr("Title") << tr("Link"); |
89 headerLabels << tr("Title") << tr("Link"); |
90 treeWidget->setHeaderLabels(headerLabels); |
90 treeWidget->setHeaderLabels(headerLabels); |
91 treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); |
91 treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); |
92 |
92 |
93 connect(&http, SIGNAL(readyRead(const QHttpResponseHeader &)), |
93 connect(&http, SIGNAL(readyRead(QHttpResponseHeader)), |
94 this, SLOT(readData(const QHttpResponseHeader &))); |
94 this, SLOT(readData(QHttpResponseHeader))); |
95 |
95 |
96 connect(&http, SIGNAL(requestFinished(int, bool)), |
96 connect(&http, SIGNAL(requestFinished(int,bool)), |
97 this, SLOT(finished(int, bool))); |
97 this, SLOT(finished(int,bool))); |
98 |
98 |
99 connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch())); |
99 connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch())); |
100 connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch())); |
100 connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch())); |
101 connect(abortButton, SIGNAL(clicked()), &http, SLOT(abort())); |
101 connect(abortButton, SIGNAL(clicked()), &http, SLOT(abort())); |
102 |
102 |