Merge pull request 'Contact widget: New contact button' (#98) from new-contact into master

Reviewed-on: https://git.wownero.com/wowlet/wowlet/pulls/98
This commit is contained in:
dsc 2022-04-24 14:39:18 +00:00
commit 73747e05a7
3 changed files with 39 additions and 19 deletions

View file

@ -2,14 +2,9 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# pthread
find_package(Threads REQUIRED)
if(QML)
# PNG
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
endif()
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
# Compile these source files (.h/.cpp)
file(GLOB SOURCE_FILES

View file

@ -32,6 +32,10 @@ ContactsWidget::ContactsWidget(QWidget *parent) :
this->newContact();
});
connect(ui->btn_addContact, &QPushButton::pressed, [this]{
this->newContact();
});
connect(ui->contacts, &QTreeView::customContextMenuRequested, [=](const QPoint & point){
QModelIndex index = ui->contacts->indexAt(point);
if (index.isValid()) {

View file

@ -6,17 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>589</width>
<height>416</height>
<width>310</width>
<height>283</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>9</number>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
@ -29,14 +26,38 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="search">
<property name="placeholderText">
<string>Search contacts...</string>
<property name="verticalSpacing">
<number>9</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>9</number>
</property>
</widget>
<item>
<widget class="QLineEdit" name="search">
<property name="placeholderText">
<string>Search contacts...</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_addContact">
<property name="text">
<string>New contact</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<item row="1" column="0">
<widget class="QTreeView" name="contacts">
<property name="rootIsDecorated">
<bool>false</bool>