git-svn-id: svn://db.shs.com.ru/libs@338 a8b55f48-bf90-11e4-a774-851b48703e85
@@ -1,4 +1,5 @@
|
||||
#include "edockwidget.h"
|
||||
#include "qad_types.h"
|
||||
#include <QStyle>
|
||||
|
||||
|
||||
@@ -16,7 +17,12 @@ void EDockWidget::init() {
|
||||
lay->setContentsMargins(2, 2, 2, 2);
|
||||
lay->setSpacing(2);
|
||||
lbl_icon = new QLabel();
|
||||
lbl_icon->setPixmap(windowIcon().pixmap(QSize(24, 24)));
|
||||
QIcon wi = windowIcon();
|
||||
if (!wi.isNull()) {
|
||||
lbl_icon->setPixmap(wi.pixmap(QSize(256,256)));
|
||||
lbl_icon->setScaledContents(true);
|
||||
lbl_icon->setFixedSize(preferredIconSize(1.5));
|
||||
}
|
||||
lbl_icon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
lbl_title = new QLabel(windowTitle());
|
||||
lbl_title->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
|
||||
@@ -233,7 +233,7 @@ void EMainWindow::changedDock() {
|
||||
tbars << t;
|
||||
connect(t, SIGNAL(tabCloseRequested(int)), this, SLOT(closeDock(int)));
|
||||
t->installEventFilter(this);
|
||||
t->setIconSize(dockTabsIconSIze());
|
||||
t->setIconSize(dockTabsIconSize());
|
||||
t->setTabsClosable(true);
|
||||
}
|
||||
// qDebug() << "tab" << t << t->count();
|
||||
@@ -241,6 +241,7 @@ void EMainWindow::changedDock() {
|
||||
dock = (QDockWidget * )t->tabData(i).toULongLong();
|
||||
//qDebug() << i << t->tabData(i);
|
||||
if (dock == 0) continue;
|
||||
t->setIconSize(dockTabsIconSize());
|
||||
t->setTabIcon(i, dock->windowIcon());
|
||||
docks_tabs << dock;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
void loadSession();
|
||||
virtual void savingSession(QPIConfig & conf) {}
|
||||
virtual void loadingSession(QPIConfig & conf) {}
|
||||
virtual QSize dockTabsIconSIze() const {return iconSize();}
|
||||
virtual QSize dockTabsIconSize() const {return iconSize();}
|
||||
virtual QString loadFilter() {return "All files(*)";}
|
||||
virtual QString saveFilter() {return "All files(*)";}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_blockview.qrc">
|
||||
<normaloff>:/icons/document-edit-.png</normaloff>:/icons/document-edit-.png</iconset>
|
||||
<normaloff>:/icons/document-edit.png</normaloff>:/icons/document-edit.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
<file>../icons/format-fill-color.png</file>
|
||||
<file>../icons/format-stroke-color.png</file>
|
||||
<file>../icons/document-open.png</file>
|
||||
<file>../icons/document-edit-.png</file>
|
||||
<file>../icons/align-bottom-center.png</file>
|
||||
<file>../icons/align-bottom-left.png</file>
|
||||
<file>../icons/align-bottom-right.png</file>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 533 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 880 B |
@@ -1,5 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>../icons/edit-table-insert-row-below.png</file>
|
||||
<file>../icons/dialog-close.png</file>
|
||||
<file>../icons/edit-clear.png</file>
|
||||
<file>../icons/edit-guides.png</file>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QItemDelegate>
|
||||
#include <QApplication>
|
||||
#include "qad_types.h"
|
||||
|
||||
|
||||
QString SQLTableWidget::_dir;
|
||||
@@ -335,12 +336,15 @@ SQLTableWidget::SQLTableWidget(QWidget * parent): QWidget(parent), filters_group
|
||||
connection_name = QSqlDatabase::defaultConnection;
|
||||
filters_active = first_update = true;
|
||||
table_opened = read_only = false;
|
||||
ui->labelNew->setFixedSize(preferredIconSize(1.2));
|
||||
ui->labelFilter->setFixedSize(preferredIconSize(1.2));
|
||||
ui->view->installEventFilter(this);
|
||||
ui->view->viewport()->installEventFilter(this);
|
||||
ui->view->horizontalHeader()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
ui->view->horizontalHeader()->viewport()->installEventFilter(this);
|
||||
ui->view->setItemDelegate(new SQLItemDelegate(column_props, column_indexes, read_only, connection_name));
|
||||
ui->view->horizontalHeader()->setItemDelegate(new QItemDelegate());
|
||||
ui->view->verticalHeader()->setDefaultSectionSize(fontHeight() * 1.5);
|
||||
//qDebug() << view->horizontalHeader()->itemDelegate();
|
||||
//qDebug() << fontMetrics().elidedText(, Qt::ElideNone, 30, Qt::TextWordWrap);
|
||||
setTableVisible(false);
|
||||
@@ -526,8 +530,8 @@ bool SQLTableWidget::checkTable() {
|
||||
q.value(5).toString().toLower().indexOf("auto_increment") >= 0,
|
||||
q.value(3).toString().toLower().indexOf("pri") >= 0);
|
||||
}*/
|
||||
ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
//ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
//ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
ui->scrollAreaNew->setFixedHeight(QLineEdit().sizeHint().height() + 2);
|
||||
ui->scrollAreaFilter->setFixedHeight(QLineEdit().sizeHint().height() + 2);
|
||||
qDeleteAll(column_news);
|
||||
@@ -626,8 +630,8 @@ void SQLTableWidget::updateTable(bool save_selection) {
|
||||
ui->view->horizontalHeader()->resizeSection(i, 100);
|
||||
first_update = false;
|
||||
}
|
||||
ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
//ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
//ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||
ui->layoutNew->invalidate();
|
||||
if (save_selection) {
|
||||
QItemSelectionModel * sm = ui->view->selectionModel();
|
||||
|
||||
@@ -7,21 +7,42 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>422</height>
|
||||
<height>570</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>SQLTableWidget</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pageEmpty">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -38,7 +59,16 @@
|
||||
</widget>
|
||||
<widget class="QWidget" name="pageTable">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@@ -50,7 +80,16 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -62,7 +101,10 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>:/icons/edit-table-insert-row-below.png</pixmap>
|
||||
<pixmap resource="qad_sql_table.qrc">:/icons/edit-table-insert-row-below.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
@@ -94,15 +136,24 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>401</width>
|
||||
<height>87</height>
|
||||
<width>352</width>
|
||||
<height>154</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="layoutNew">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -131,15 +182,9 @@
|
||||
<string>Add record</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="qad_sql_table.qrc">
|
||||
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@@ -148,7 +193,16 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -160,7 +214,10 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>:/icons/edit-find.png</pixmap>
|
||||
<pixmap resource="qad_sql_table.qrc">:/icons/edit-find.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
@@ -192,15 +249,24 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>401</width>
|
||||
<height>87</height>
|
||||
<width>154</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="layoutFilter">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -229,15 +295,9 @@
|
||||
<string>Configure filters</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="qad_sql_table.qrc">
|
||||
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
@@ -263,9 +323,6 @@
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>24</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -275,7 +332,7 @@
|
||||
</layout>
|
||||
<action name="actionFiltersClear">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="qad_sql_table.qrc">
|
||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -305,6 +362,8 @@
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="qad_sql_table.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -38,7 +38,7 @@ EComboBox::EComboBox(QWidget * parent): QComboBox(parent) {
|
||||
iv.setMinimumHeight(100);
|
||||
icon.setPixmap(QPixmap(":/icons/edit-find.png"));
|
||||
icon.setScaledContents(true);
|
||||
icon.setFixedSize(QSize(fontHeight(), fontHeight()));
|
||||
icon.setFixedSize(preferredIconSize(1.2));
|
||||
ifont = nfont = font();
|
||||
ifont.setItalic(true);
|
||||
#if QT_VERSION >= 0x040700
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QLabel>
|
||||
#include <QIcon>
|
||||
#include <QHBoxLayout>
|
||||
#include "qad_types.h"
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
@@ -23,7 +24,7 @@ public:
|
||||
explicit IconedLabel(QWidget * parent = 0): QFrame(parent) {
|
||||
label_.setAlignment(Qt::AlignCenter);
|
||||
icon_.setAlignment(Qt::AlignCenter);
|
||||
size_ = QSize(16, 16);
|
||||
size_ = preferredIconSize();
|
||||
setDirection(LeftToRight);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,9 +58,9 @@ StringListEdit::StringListEdit(QWidget * parent): QWidget(parent), lay(QBoxLayou
|
||||
/*butt_add->setIconSize(QSize(16, 16));
|
||||
butt_del->setIconSize(QSize(16, 16));
|
||||
butt_clear->setIconSize(QSize(16, 16));*/
|
||||
butt_add->setMaximumWidth(combo->height());
|
||||
butt_del->setMaximumWidth(combo->height());
|
||||
butt_clear->setMaximumWidth(combo->height());
|
||||
butt_add->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
butt_del->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
butt_clear->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
butt_add->setIcon(QIcon(":/icons/list-add.png"));
|
||||
butt_del->setIcon(QIcon(":/icons/edit-delete.png"));
|
||||
butt_clear->setIcon(QIcon(":/icons/edit-clear.png"));
|
||||
|
||||