implement extended record browser

This commit is contained in:
kvazar-network 2024-05-10 16:17:21 +03:00
parent 39e8aa306e
commit 65fee98933
2 changed files with 297 additions and 57 deletions

View File

@ -15,27 +15,62 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<!-- @TODO --> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabData">
<attribute name="title">
<string>Data</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Data">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="styleSheet">
<string notr="true">#scrollArea { background: transparent }</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="styleSheet">
<string notr="true">#scrollAreaWidgetContents { background: transparent }</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_Data">
<item>
<widget class="QLabel" name="detailKey"> <widget class="QLabel" name="detailKey">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="font"> <property name="font">
<!--
<font> <font>
<bold>true</bold> <bold>true</bold>
</font> </font>
-->
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeft</set>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="textFormat"> <property name="textFormat">
<!-- exlude remote content loading --> <!-- exlude remote content loading -->
<enum>Qt::PlainText</enum> <enum>Qt::PlainText</enum>
@ -43,28 +78,207 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QLabel" name="detailValue"> <widget class="QLabel" name="detailValue">
<property name="styleSheet">
<string notr="true">#detailValue { background: transparent }</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeft</set>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="textFormat"> <property name="textFormat">
<!-- exlude remote content loading --> <!-- exlude remote content loading -->
<enum>Qt::PlainText</enum> <enum>Qt::PlainText</enum>
</property> </property>
</widget> </widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabMeta">
<attribute name="title">
<string>Meta</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Meta">
<property name="margin">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="detailDateLabel">
<property name="text">
<string>Date</string>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailDate">
<property name="text">
<string/>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailBlockLabel">
<property name="text">
<string>Block</string>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailBlock">
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detaiNamespaceLabel">
<property name="text">
<string>Namespace</string>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailNamespace">
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailTransactionLabel">
<property name="text">
<string>Transaction ID</string>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="detailTransaction">
<property name="text">
<string/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="blankArea"/>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -21,15 +21,10 @@ KevaDetailDialog::KevaDetailDialog(const QModelIndex &idx, QWidget *parent, cons
this->nameSpace = nameSpace; this->nameSpace = nameSpace;
setWindowTitle( setWindowTitle(
idx.sibling( "Record browser"
idx.row(),
KevaTableModel::Key
).data(
Qt::DisplayRole
).toString()
); );
/* @TODO multi-tab data/meta browser // Data tab
ui->detailKey->setText( ui->detailKey->setText(
idx.sibling( idx.sibling(
idx.row(), idx.row(),
@ -38,7 +33,6 @@ KevaDetailDialog::KevaDetailDialog(const QModelIndex &idx, QWidget *parent, cons
Qt::DisplayRole Qt::DisplayRole
).toString() ).toString()
); );
*/
ui->detailValue->setText( ui->detailValue->setText(
idx.sibling( idx.sibling(
@ -48,6 +42,38 @@ KevaDetailDialog::KevaDetailDialog(const QModelIndex &idx, QWidget *parent, cons
Qt::DisplayRole Qt::DisplayRole
).toString() ).toString()
); );
// Meta tab
ui->detailDate->setText(
idx.sibling(
idx.row(),
KevaTableModel::Date
).data(
Qt::DisplayRole
).toString()
);
ui->detailBlock->setText(
idx.sibling(
idx.row(),
KevaTableModel::Block
).data(
Qt::DisplayRole
).toString()
);
ui->detailNamespace->setText(
nameSpace
);
ui->detailTransaction->setText(
idx.sibling(
idx.row(),
KevaTableModel::TransactionID
).data(
Qt::DisplayRole
).toString()
);
} }
KevaDetailDialog::~KevaDetailDialog() KevaDetailDialog::~KevaDetailDialog()