filter panel
This commit is contained in:
+92
-2
@@ -1,14 +1,104 @@
|
||||
#include "cfilterpanel.h"
|
||||
#include "ui_cfilterpanel.h"
|
||||
|
||||
|
||||
cFilterPanel::cFilterPanel(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cFilterPanel)
|
||||
ui(new Ui::cFilterPanel),
|
||||
m_bLoading(false),
|
||||
m_lpPersonList(nullptr),
|
||||
m_lpLocationList(nullptr),
|
||||
m_lpTagList(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initUI();
|
||||
createActions();
|
||||
}
|
||||
|
||||
cFilterPanel::~cFilterPanel()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cFilterPanel::initUI()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_lpPersonListModel = new QStandardItemModel;
|
||||
ui->m_lpPersonList->setModel(m_lpPersonListModel);
|
||||
|
||||
m_lpLocationListModel = new QStandardItemModel;
|
||||
ui->m_lpLocationList->setModel(m_lpLocationListModel);
|
||||
|
||||
m_lpTagListModel = new QStandardItemModel;
|
||||
ui->m_lpTagList->setModel(m_lpTagListModel);
|
||||
}
|
||||
|
||||
void cFilterPanel::createActions()
|
||||
{
|
||||
}
|
||||
|
||||
void cFilterPanel::clearPersonList()
|
||||
{
|
||||
m_lpPersonListModel->clear();
|
||||
}
|
||||
|
||||
void cFilterPanel::setPersonList(cPersonList* lpPersonList)
|
||||
{
|
||||
m_bLoading = true;
|
||||
|
||||
m_lpPersonList = lpPersonList;
|
||||
|
||||
for(cPersonList::iterator i = lpPersonList->begin();i != lpPersonList->end();i++)
|
||||
{
|
||||
QStandardItem* lpItem = new QStandardItem((*i)->name());
|
||||
lpItem->setData(QVariant::fromValue(*i), Qt::UserRole+1);
|
||||
lpItem->setCheckable(true);
|
||||
m_lpPersonListModel->appendRow(lpItem);
|
||||
}
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
void cFilterPanel::clearLocationList()
|
||||
{
|
||||
m_lpLocationListModel->clear();
|
||||
}
|
||||
|
||||
void cFilterPanel::setLocationList(cLocationList* lpLocationList)
|
||||
{
|
||||
m_bLoading = true;
|
||||
|
||||
m_lpLocationList = lpLocationList;
|
||||
|
||||
for(cLocationList::iterator i = lpLocationList->begin();i != lpLocationList->end();i++)
|
||||
{
|
||||
QStandardItem* lpItem = new QStandardItem((*i)->name());
|
||||
lpItem->setData(QVariant::fromValue(*i), Qt::UserRole+1);
|
||||
lpItem->setCheckable(true);
|
||||
m_lpLocationListModel->appendRow(lpItem);
|
||||
}
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
void cFilterPanel::clearTagList()
|
||||
{
|
||||
m_lpTagListModel->clear();
|
||||
}
|
||||
|
||||
void cFilterPanel::setTagList(cTagList* lpTagList)
|
||||
{
|
||||
m_bLoading = true;
|
||||
|
||||
m_lpTagList = lpTagList;
|
||||
|
||||
for(cTagList::iterator i = lpTagList->begin();i != lpTagList->end();i++)
|
||||
{
|
||||
QStandardItem* lpItem = new QStandardItem((*i)->name());
|
||||
lpItem->setData(QVariant::fromValue(*i), Qt::UserRole+1);
|
||||
lpItem->setCheckable(true);
|
||||
m_lpTagListModel->appendRow(lpItem);
|
||||
}
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
+74
-1
@@ -1,7 +1,15 @@
|
||||
#ifndef CFILTERPANEL_H
|
||||
#define CFILTERPANEL_H
|
||||
|
||||
|
||||
#include "ctag.h"
|
||||
#include "cperson.h"
|
||||
#include "clocation.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelection>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cFilterPanel;
|
||||
@@ -15,8 +23,73 @@ public:
|
||||
explicit cFilterPanel(QWidget *parent = nullptr);
|
||||
~cFilterPanel();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn clearPersonList
|
||||
*/
|
||||
void clearPersonList();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\param lpPersonList
|
||||
\fn setPersonList
|
||||
*/
|
||||
void setPersonList(cPersonList* lpPersonList);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn clearLocationList
|
||||
*/
|
||||
void clearLocationList();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\param lpLocationList
|
||||
\fn setLocationList
|
||||
*/
|
||||
void setLocationList(cLocationList* lpLocationList);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn clearTagList
|
||||
*/
|
||||
void clearTagList();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\param lpTagList
|
||||
\fn setTagList
|
||||
*/
|
||||
void setTagList(cTagList* lpTagList);
|
||||
|
||||
private:
|
||||
Ui::cFilterPanel *ui;
|
||||
Ui::cFilterPanel* ui;
|
||||
bool m_bLoading; /*!< TODO: describe */
|
||||
|
||||
QStandardItemModel* m_lpPersonListModel; /*!< TODO: describe */
|
||||
cPersonList* m_lpPersonList; /*!< TODO: describe */
|
||||
|
||||
QStandardItemModel* m_lpLocationListModel; /*!< TODO: describe */
|
||||
cLocationList* m_lpLocationList; /*!< TODO: describe */
|
||||
|
||||
QStandardItemModel* m_lpTagListModel; /*!< TODO: describe */
|
||||
cTagList* m_lpTagList; /*!< TODO: describe */
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn initUI
|
||||
*/
|
||||
void initUI();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn createActions
|
||||
*/
|
||||
void createActions();
|
||||
};
|
||||
|
||||
#endif // CFILTERPANEL_H
|
||||
|
||||
+42
-3
@@ -26,7 +26,20 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpPersonList"/>
|
||||
<widget class="QTreeView" name="m_lpPersonList">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -41,7 +54,20 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpLocationList"/>
|
||||
<widget class="QTreeView" name="m_lpLocationList">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -56,7 +82,20 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpTagsList"/>
|
||||
<widget class="QTreeView" name="m_lpTagList">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
+75
-2
@@ -79,9 +79,9 @@ void cMainWindow::initUI()
|
||||
|
||||
QIcon::setThemeName("TangoMFK");
|
||||
|
||||
ui->m_lpSpoiler->setTitle(tr("Filter"));
|
||||
ui->m_lpFilter->setTitle(tr("Filter"));
|
||||
m_lpFilterPanel = new cFilterPanel(this);
|
||||
ui->m_lpSpoiler->setContentWidget(m_lpFilterPanel);
|
||||
ui->m_lpFilter->setContentWidget(m_lpFilterPanel);
|
||||
|
||||
m_lpFolderViewModel = new QStandardItemModel;
|
||||
m_lpFolderSortFilterProxyModel = new cFolderSortFilterProxyModel(this);
|
||||
@@ -136,6 +136,21 @@ void cMainWindow::createActions()
|
||||
connect(ui->m_lpThumbnailView, &QListView::customContextMenuRequested, this, &cMainWindow::onThumbnailViewContextMenu);
|
||||
|
||||
connect(ui->m_lpThumbnailView, &QListView::doubleClicked, this, &cMainWindow::onThumbnailDoubleClicked);
|
||||
|
||||
connect(ui->m_lpToolBoxTags, &cToolBoxTag::tagAdded, this, &cMainWindow::onTagAdded);
|
||||
connect(ui->m_lpToolBoxTags, &cToolBoxTag::tagRemoved, this, &cMainWindow::onTagRemoved);
|
||||
connect(ui->m_lpToolBoxTags, &cToolBoxTag::tagEdited, this, &cMainWindow::onTagEdited);
|
||||
connect(ui->m_lpToolBoxTags, &cToolBoxTag::tagListChanged, this, &cMainWindow::onTagListChanged);
|
||||
|
||||
connect(ui->m_lpToolBoxPerson, &cToolBoxPerson::personAdded, this, &cMainWindow::onPersonAdded);
|
||||
connect(ui->m_lpToolBoxPerson, &cToolBoxPerson::personRemoved, this, &cMainWindow::onPersonRemoved);
|
||||
connect(ui->m_lpToolBoxPerson, &cToolBoxPerson::personEdited, this, &cMainWindow::onPersonEdited);
|
||||
connect(ui->m_lpToolBoxPerson, &cToolBoxPerson::personListChanged, this, &cMainWindow::onPersonListChanged);
|
||||
|
||||
connect(ui->m_lpToolBoxLocation, &cToolBoxLocation::locationAdded, this, &cMainWindow::onLocationAdded);
|
||||
connect(ui->m_lpToolBoxLocation, &cToolBoxLocation::locationRemoved, this, &cMainWindow::onLocationRemoved);
|
||||
connect(ui->m_lpToolBoxLocation, &cToolBoxLocation::locationEdited, this, &cMainWindow::onLocationEdited);
|
||||
connect(ui->m_lpToolBoxLocation, &cToolBoxLocation::locationListChanged, this, &cMainWindow::onLocationListChanged);
|
||||
}
|
||||
|
||||
void cMainWindow::createContextActions()
|
||||
@@ -256,6 +271,10 @@ void cMainWindow::displayData()
|
||||
ui->m_lpToolBoxLocation->setLocationList(&m_locationList);
|
||||
ui->m_lpToolBoxTags->setTagList(&m_tagList);
|
||||
|
||||
m_lpFilterPanel->setPersonList(&m_personList);
|
||||
m_lpFilterPanel->setLocationList(&m_locationList);
|
||||
m_lpFilterPanel->setTagList(&m_tagList);
|
||||
|
||||
m_lpRootItem = new QStandardItem("library");
|
||||
m_lpFolderViewModel->appendRow(m_lpRootItem);
|
||||
|
||||
@@ -820,3 +839,57 @@ void cMainWindow::onUnsetHDR()
|
||||
m_lpFolderSortFilterProxyModel->sort(0);
|
||||
m_lpThumbnailSortFilterProxyModel->invalidate();
|
||||
}
|
||||
|
||||
void cMainWindow::onTagAdded(cTag* /*lpTag*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onTagRemoved(cTag* /*lpTag*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onTagEdited(cTag* /*lpTag*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onTagListChanged()
|
||||
{
|
||||
m_lpFilterPanel->clearTagList();
|
||||
m_lpFilterPanel->setTagList(&m_tagList);
|
||||
}
|
||||
|
||||
void cMainWindow::onPersonAdded(cPerson* /*lpPerson*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onPersonRemoved(cPerson* /*lpPerson*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onPersonEdited(cPerson* /*lpPerson*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onPersonListChanged()
|
||||
{
|
||||
m_lpFilterPanel->clearPersonList();
|
||||
m_lpFilterPanel->setPersonList(&m_personList);
|
||||
}
|
||||
|
||||
void cMainWindow::onLocationAdded(cLocation* /*lpLocation*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onLocationRemoved(cLocation* /*lpLocation*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onLocationEdited(cLocation* /*lpLocation*/)
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onLocationListChanged()
|
||||
{
|
||||
m_lpFilterPanel->clearLocationList();
|
||||
m_lpFilterPanel->setLocationList(&m_locationList);
|
||||
}
|
||||
|
||||
@@ -270,6 +270,87 @@ private slots:
|
||||
\fn onUnsetHDR
|
||||
*/
|
||||
void onUnsetHDR();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onTagAdded
|
||||
\param lpTag
|
||||
*/
|
||||
void onTagAdded(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onTagRemoved
|
||||
\param lpTag
|
||||
*/
|
||||
void onTagRemoved(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onTagEdited
|
||||
\param lpTag
|
||||
*/
|
||||
void onTagEdited(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onTagListChanged
|
||||
*/
|
||||
void onTagListChanged();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onPersonAdded
|
||||
\param lpPerson
|
||||
*/
|
||||
void onPersonAdded(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onPersonRemoved
|
||||
\param lpPerson
|
||||
*/
|
||||
void onPersonRemoved(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onPersonEdited
|
||||
\param lpPerson
|
||||
*/
|
||||
void onPersonEdited(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onPersonListChanged
|
||||
*/
|
||||
void onPersonListChanged();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onLocationAdded
|
||||
\param lpLocation
|
||||
*/
|
||||
void onLocationAdded(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onLocationRemoved
|
||||
\param lpLocation
|
||||
*/
|
||||
void onLocationRemoved(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onLocationEdited
|
||||
\param lpLocation
|
||||
*/
|
||||
void onLocationEdited(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onLocationListChanged
|
||||
*/
|
||||
void onLocationListChanged();
|
||||
};
|
||||
|
||||
#endif // CMAINWINDOW_H
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="cSpoiler" name="m_lpSpoiler" native="true"/>
|
||||
<widget class="cSpoiler" name="m_lpFilter" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
+10
-1
@@ -208,6 +208,9 @@ void cToolBoxLocation::onLocationAdd()
|
||||
m_lpLocationListModel->appendRow(lpItem);
|
||||
m_lpLocationListModel->sort(0);
|
||||
|
||||
emit locationAdded(lpLocation);
|
||||
emit locationListChanged();
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
@@ -237,6 +240,9 @@ void cToolBoxLocation::onLocationEdit()
|
||||
return;
|
||||
|
||||
lpItem->setText(input.textValue());
|
||||
|
||||
emit locationEdited(lpLocation);
|
||||
emit locationListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxLocation::onLocationDelete()
|
||||
@@ -255,12 +261,15 @@ void cToolBoxLocation::onLocationDelete()
|
||||
if(!m_lpLocationList->remove(lpLocation))
|
||||
QMessageBox::critical(this, tr("Delete Location"), QString(tr("%1 is in use and can't be deleted!")).arg(lpLocation->name()));
|
||||
else
|
||||
{
|
||||
m_lpLocationListModel->removeRow(index.row());
|
||||
emit locationRemoved(lpLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit locationListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxLocation::onLocationViewContextMenu(const QPoint& pos)
|
||||
|
||||
@@ -143,6 +143,35 @@ private slots:
|
||||
\param lpItem
|
||||
*/
|
||||
void onLocationChanged(QStandardItem* lpItem);
|
||||
|
||||
signals:
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn locationAdded
|
||||
\param lpTag
|
||||
*/
|
||||
void locationAdded(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn locationRemoved
|
||||
\param lpTag
|
||||
*/
|
||||
void locationRemoved(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn locationEdited
|
||||
\param lpTag
|
||||
*/
|
||||
void locationEdited(cLocation* lpLocation);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn locationListChanged
|
||||
*/
|
||||
void locationListChanged();
|
||||
};
|
||||
|
||||
#endif // CTOOLBOXLOCATION_H
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
|
||||
+10
-1
@@ -213,6 +213,9 @@ void cToolBoxPerson::onPersonAdd()
|
||||
m_lpPersonListModel->appendRow(lpItem);
|
||||
m_lpPersonListModel->sort(0);
|
||||
|
||||
emit personAdded(lpPerson);
|
||||
emit personListChanged();
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
@@ -242,6 +245,9 @@ void cToolBoxPerson::onPersonEdit()
|
||||
return;
|
||||
|
||||
lpItem->setText(input.textValue());
|
||||
|
||||
emit personEdited(lpPerson);
|
||||
emit personListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxPerson::onPersonDelete()
|
||||
@@ -260,12 +266,15 @@ void cToolBoxPerson::onPersonDelete()
|
||||
if(!m_lpPersonList->remove(lpPerson))
|
||||
QMessageBox::critical(this, tr("Delete Person"), QString(tr("%1 is in use and can't be deleted!")).arg(lpPerson->name()));
|
||||
else
|
||||
{
|
||||
m_lpPersonListModel->removeRow(index.row());
|
||||
emit personRemoved(lpPerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit personListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxPerson::onPersonViewContextMenu(const QPoint& pos)
|
||||
|
||||
@@ -142,6 +142,35 @@ private slots:
|
||||
\param lpItem
|
||||
*/
|
||||
void onPersonChanged(QStandardItem* lpItem);
|
||||
|
||||
signals:
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn personAdded
|
||||
\param lpPerson
|
||||
*/
|
||||
void personAdded(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn personRemoved
|
||||
\param lpPerson
|
||||
*/
|
||||
void personRemoved(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn personEdited
|
||||
\param lpPerson
|
||||
*/
|
||||
void personEdited(cPerson* lpPerson);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn personListChanged
|
||||
*/
|
||||
void personListChanged();
|
||||
};
|
||||
|
||||
#endif // CTOOLBOXPERSON_H
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
|
||||
+10
-1
@@ -213,6 +213,9 @@ void cToolBoxTag::onTagAdd()
|
||||
m_lpTagListModel->appendRow(lpItem);
|
||||
m_lpTagListModel->sort(0);
|
||||
|
||||
emit tagAdded(lpTag);
|
||||
emit tagListChanged();
|
||||
|
||||
m_bLoading = false;
|
||||
}
|
||||
|
||||
@@ -242,6 +245,9 @@ void cToolBoxTag::onTagEdit()
|
||||
return;
|
||||
|
||||
lpItem->setText(input.textValue());
|
||||
|
||||
emit tagEdited(lpTag);
|
||||
emit tagListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxTag::onTagDelete()
|
||||
@@ -260,12 +266,15 @@ void cToolBoxTag::onTagDelete()
|
||||
if(!m_lpTagList->remove(lpTag))
|
||||
QMessageBox::critical(this, tr("Delete Tag"), QString(tr("%1 is in use and can't be deleted!")).arg(lpTag->name()));
|
||||
else
|
||||
{
|
||||
m_lpTagListModel->removeRow(index.row());
|
||||
emit tagRemoved(lpTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit tagListChanged();
|
||||
}
|
||||
|
||||
void cToolBoxTag::onTagViewContextMenu(const QPoint& pos)
|
||||
|
||||
@@ -143,6 +143,35 @@ private slots:
|
||||
\param lpItem
|
||||
*/
|
||||
void onTagChanged(QStandardItem* lpItem);
|
||||
|
||||
signals:
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn tagAdded
|
||||
\param lpTag
|
||||
*/
|
||||
void tagAdded(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn tagRemoved
|
||||
\param lpTag
|
||||
*/
|
||||
void tagRemoved(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn tagEdited
|
||||
\param lpTag
|
||||
*/
|
||||
void tagEdited(cTag* lpTag);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn tagListChanged
|
||||
*/
|
||||
void tagListChanged();
|
||||
};
|
||||
|
||||
#endif // CTOOLBOXTAG_H
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
|
||||
Reference in New Issue
Block a user