Commit 46df7657 authored by Alessandro Portale's avatar Alessandro Portale

MimeTypeSettings: Use QTreeView instead of QTableView

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
DPI.

Change-Id: I0a4091585d4745fd91179c82a55682f88f8d2549
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent c778d7a3
......@@ -30,6 +30,8 @@
#include "mimetypemagicdialog.h"
#include "mimedatabase.h"
#include <utils/headerviewstretcher.h>
#include <QMessageBox>
using namespace Core;
......
This diff is collapsed.
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>593</width>
<height>403</height>
<width>712</width>
<height>696</height>
</rect>
</property>
<property name="windowTitle">
......@@ -15,174 +15,158 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="mimeTypesGroupBox">
<property name="title">
<string>Registered MIME Types</string>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLineEdit" name="filterLineEdit">
<property name="placeholderText">
<string>Filter</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTableView" name="mimeTypesTableView">
<property name="showGrid">
<bool>false</bool>
</property>
<property name="gridStyle">
<enum>Qt::NoPen</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="resetButton">
<property name="toolTip">
<string>Reset all to default.</string>
</property>
<property name="text">
<string>Reset All</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>476</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="detailsGroupBox">
<property name="title">
<string>Details</string>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="patternsLabel">
<property name="text">
<string>Patterns:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="patternsLineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTableWidget" name="magicHeadersTableWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="gridStyle">
<enum>Qt::NoPen</enum>
</property>
<column>
<widget class="QGroupBox" name="mimeTypesGroupBox">
<property name="title">
<string>Registered MIME Types</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLineEdit" name="filterLineEdit">
<property name="placeholderText">
<string>Filter</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="resetButton">
<property name="toolTip">
<string>Reset all to default.</string>
</property>
<property name="text">
<string>Reset All</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>476</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="QTreeView" name="mimeTypesTreeView">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="detailsGroupBox">
<property name="title">
<string>Details</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="patternsLabel">
<property name="text">
<string>Magic Header</string>
<string>Patterns:</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</widget>
</item>
<item>
<widget class="QLineEdit" name="patternsLineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTreeWidget" name="magicHeadersTreeWidget">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
</column>
<column>
<property name="text">
<string>Range</string>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
</column>
<column>
<property name="text">
<string>Priority</string>
<property name="columnCount">
<number>4</number>
</property>
</column>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="addMagicButton">
<column>
<property name="text">
<string>Add...</string>
<string notr="true">Magic Header</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editMagicButton">
</column>
<column>
<property name="text">
<string>Edit...</string>
<string>Type</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeMagicButton">
</column>
<column>
<property name="text">
<string>Remove</string>
<string>Range</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>72</width>
<height>18</height>
</size>
</column>
<column>
<property name="text">
<string>Priority</string>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</column>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="addMagicButton">
<property name="text">
<string>Add...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editMagicButton">
<property name="text">
<string>Edit...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeMagicButton">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>72</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>504</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
......
Markdown is supported
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