1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fixed problem of setting listWidget's height from recent commit: f27137f8ae

This commit is contained in:
S. Razi Alavizadeh 2012-12-29 11:31:01 +03:30
parent 653f1478ec
commit 6f5d32eddf
2 changed files with 16 additions and 4 deletions

View File

@ -34,6 +34,7 @@
#include <QClipboard>
#include <QWebSecurityOrigin>
#include <QWebDatabase>
#include <QTimer>
QString SiteInfo::showCertInfo(const QString &string)
{
@ -50,12 +51,13 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
, ui(new Ui::SiteInfo)
, m_certWidget(0)
, m_view(view)
, m_delegate(0)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
ListItemDelegate* delegate = new ListItemDelegate(24, ui->listWidget);
ui->listWidget->setItemDelegate(delegate);
m_delegate = new ListItemDelegate(24, ui->listWidget);
ui->listWidget->setItemDelegate(m_delegate);
ui->listWidget->item(0)->setIcon(QIcon::fromTheme("document-properties", QIcon(":/icons/preferences/document-properties.png")));
ui->listWidget->item(1)->setIcon(QIcon::fromTheme("applications-graphics", QIcon(":/icons/preferences/applications-graphics.png")));
@ -63,8 +65,6 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->listWidget->item(3)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
ui->listWidget->item(0)->setSelected(true);
ui->listWidget->setFixedHeight(delegate->itemHeight());
WebPage* webPage = view->page();
QWebFrame* frame = view->page()->mainFrame();
QString title = view->title();
@ -175,6 +175,8 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->treeImages->sortByColumn(-1);
ui->treeTags->sortByColumn(-1);
QTimer::singleShot(0, this, SLOT(heightChange()));
}
void SiteInfo::imagesCustomContextMenuRequested(const QPoint &p)
@ -245,6 +247,13 @@ void SiteInfo::downloadImage()
}
}
void SiteInfo::heightChange()
{
if (m_delegate) {
ui->listWidget->setFixedHeight(m_delegate->itemHeight());
}
}
void SiteInfo::showImagePreview(QTreeWidgetItem* item)
{
if (!item) {

View File

@ -33,6 +33,7 @@ class QTreeWidgetItem;
class WebView;
class CertificateInfoWidget;
class ListItemDelegate;
class QT_QUPZILLA_EXPORT SiteInfo : public QDialog
{
@ -52,11 +53,13 @@ private slots:
void imagesCustomContextMenuRequested(const QPoint &p);
void copyActionData();
void downloadImage();
void heightChange();
private:
Ui::SiteInfo* ui;
CertificateInfoWidget* m_certWidget;
WebView* m_view;
ListItemDelegate* m_delegate;
QPixmap m_activePixmap;
QUrl m_baseUrl;