Fix qstring conversion 2
This commit is contained in:
parent
efc2385bb8
commit
e8854fb252
2
build.sh
2
build.sh
|
@ -3,5 +3,5 @@
|
|||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make -j9
|
||||
make -j${1:-1}
|
||||
cd ..
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j9
|
||||
make -j${1:1}
|
||||
cd ..
|
||||
|
|
|
@ -44,11 +44,7 @@ static auto contract_getExpiry(const Contract &contract) -> QDate {
|
|||
}
|
||||
|
||||
static auto contract_setExpiry(Contract &contract, QDate date) -> void {
|
||||
#ifdef __LINUX__
|
||||
contract._expiry = date.toString(DATE_FORMAT).toUtf8().constData();
|
||||
#elif defined(__WIN32__)
|
||||
contract._expiry = date.toString(DATE_FORMAT).toLocal8Bit().constData();
|
||||
#endif
|
||||
contract._expiry = date.toString(DATE_FORMAT).toStdString();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ auto MainWindow::on_deleteBtn_clicked() -> void {
|
|||
this->updateDB();
|
||||
}
|
||||
|
||||
auto MainWindow::on_treeView_itemClicked() -> void {
|
||||
auto MainWindow::on_treeView_itemClicked(QTreeWidgetItem* _item, int col) -> void {
|
||||
// Reset state.
|
||||
this->_selectedContract = nullptr;
|
||||
this->_selectedCategory = nullptr;
|
||||
|
@ -149,11 +149,7 @@ auto MainWindow::on_treeView_itemClicked() -> void {
|
|||
this->deleteBtn->setEnabled(false);
|
||||
|
||||
// Get item selected
|
||||
#ifdef __LINUX__
|
||||
auto item = this->treeView->currentItem()->text(0).toUtf8().constData();
|
||||
#elif defined(__WIN32__)
|
||||
auto item = this->treeView->currentItem()->text(0).toLocal8Bit().constData();
|
||||
#endif
|
||||
auto item = _item->text(0).toStdString();
|
||||
|
||||
// Check if the item is from expired category.
|
||||
for (int i = 0; i < _db._deactivatedCategory._contracts.size(); i++) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public slots:
|
|||
void on_settingsBtn_clicked();
|
||||
void on_deleteBtn_clicked();
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void on_treeView_itemClicked();
|
||||
void on_treeView_itemClicked(QTreeWidgetItem* _item, int column);
|
||||
void on_actionExport_triggered();
|
||||
void on_actionImport_triggered();
|
||||
void on_actionAdd_Contract_triggered();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>438</width>
|
||||
<height>441</height>
|
||||
<height>492</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -20,60 +20,78 @@
|
|||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>421</width>
|
||||
<height>401</height>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeBtn">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settingsBtn">
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLineEdit" name="searchBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<widget class="QPushButton" name="searchBtn">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="deleteBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeBtn">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settingsBtn">
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="infoBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Info</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="deleteBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="infoBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue