Commit 8173961e authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Git: Remotedialog, replace QTableView with QTreeView

QTreeView is a better list view with columns than QTableView.
One special reason for this change is that QTreeView
finds a proper default row height regardless of the system

Change-Id: I3342e2295a3782b480ea811bfe335e3a77482891
Reviewed-by: default avatarOrgad Shaneh <>
parent bb4031dc
......@@ -36,6 +36,7 @@
#include "ui_remotedialog.h"
#include "ui_remoteadditiondialog.h"
#include <utils/headerviewstretcher.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <QMessageBox>
......@@ -94,8 +95,7 @@ RemoteDialog::RemoteDialog(QWidget *parent) :
m_ui->remoteView->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
new Utils::HeaderViewStretcher(m_ui->remoteView->header(), 1);
connect(m_ui->addButton, SIGNAL(clicked()), this, SLOT(addRemote()));
connect(m_ui->fetchButton, SIGNAL(clicked()), this, SLOT(fetchFromRemote()));
......@@ -2,14 +2,6 @@
<ui version="4.0">
<widget class="QDialog" name="Git::Internal::RemoteDialog">
<property name="geometry">
<property name="windowTitle">
......@@ -62,7 +54,7 @@
<widget class="QTableView" name="remoteView">
<widget class="QTreeView" name="remoteView">
<property name="minimumSize">
......@@ -78,22 +70,29 @@
<property name="selectionBehavior">
<property name="showGrid">
<property name="rootIsDecorated">
<property name="wordWrap">
<property name="uniformRowHeights">
<attribute name="horizontalHeaderVisible">
<attribute name="verticalHeaderVisible">
<layout class="QHBoxLayout" name="horizontalLayout">
<spacer name="horizontalSpacer">
<property name="orientation">
<property name="sizeHint" stdset="0">
<widget class="QPushButton" name="addButton">
<property name="text">
......@@ -139,6 +139,14 @@ QVariant RemoteModel::data(const QModelIndex &index, int role) const
return QVariant();
QVariant RemoteModel::headerData(int section, Qt::Orientation orientation, int role) const
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
return QVariant();
return (section == 0) ? tr("Name") : tr("Url");
bool RemoteModel::setData(const QModelIndex &index, const QVariant &value, int role)
if (role != Qt::EditRole)
......@@ -59,6 +59,8 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
Qt::ItemFlags flags(const QModelIndex &index) const;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment