Added 'Fonte' to GUI

This commit is contained in:
giomba 2019-08-03 17:48:30 +02:00
parent 6631fd16fc
commit d5ea442e22
2 changed files with 95 additions and 46 deletions

View File

@ -11,12 +11,19 @@ MainWindow::MainWindow(QWidget *parent) :
bool MainWindow::populateUi(void) {
QComboBox* comboProfessione = this->findChild<QComboBox*>("comboProfessione");
QSqlQuery query;
QSqlQuery query("SELECT id, professione FROM professione");
query = QSqlQuery("SELECT id, professione FROM professione");
while (query.next()) {
comboProfessione->addItem(query.value(1).toString().toUtf8().data(), query.value(0).toInt());
}
QComboBox* comboFonte = this->findChild<QComboBox*>("comboFonte");
query = QSqlQuery("SELECT id, fonte FROM fonte");
while (query.next()) {
comboFonte->addItem(query.value(1).toString().toUtf8().data(), query.value(0).toInt());
}
return true;
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>652</width>
<height>399</height>
<height>304</height>
</rect>
</property>
<property name="windowTitle">
@ -15,11 +15,14 @@
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>10</y>
<width>161</width>
<x>10</x>
<y>20</y>
<width>51</width>
<height>32</height>
</rect>
</property>
@ -30,8 +33,8 @@
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>80</x>
<y>20</y>
<x>10</x>
<y>0</y>
<width>14</width>
<height>18</height>
</rect>
@ -43,8 +46,8 @@
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>60</x>
<y>60</y>
<x>70</x>
<y>0</y>
<width>38</width>
<height>18</height>
</rect>
@ -56,8 +59,8 @@
<widget class="QLabel" name="label_">
<property name="geometry">
<rect>
<x>40</x>
<y>100</y>
<x>360</x>
<y>0</y>
<width>60</width>
<height>18</height>
</rect>
@ -69,9 +72,9 @@
<widget class="QLineEdit" name="lineNome">
<property name="geometry">
<rect>
<x>100</x>
<y>50</y>
<width>161</width>
<x>70</x>
<y>20</y>
<width>281</width>
<height>32</height>
</rect>
</property>
@ -82,9 +85,9 @@
<widget class="QLineEdit" name="lineCognome">
<property name="geometry">
<rect>
<x>100</x>
<y>90</y>
<width>161</width>
<x>360</x>
<y>20</y>
<width>281</width>
<height>32</height>
</rect>
</property>
@ -92,9 +95,9 @@
<widget class="QLineEdit" name="lineComuneResidenza">
<property name="geometry">
<rect>
<x>100</x>
<y>170</y>
<width>161</width>
<x>120</x>
<y>80</y>
<width>231</width>
<height>32</height>
</rect>
</property>
@ -102,9 +105,9 @@
<widget class="QLineEdit" name="lineEmail">
<property name="geometry">
<rect>
<x>100</x>
<y>210</y>
<width>161</width>
<x>360</x>
<y>80</y>
<width>281</width>
<height>32</height>
</rect>
</property>
@ -112,10 +115,10 @@
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>50</x>
<y>130</y>
<width>51</width>
<height>31</height>
<x>10</x>
<y>60</y>
<width>92</width>
<height>18</height>
</rect>
</property>
<property name="text">
@ -128,10 +131,10 @@
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>30</x>
<y>170</y>
<width>71</width>
<height>31</height>
<x>120</x>
<y>60</y>
<width>132</width>
<height>18</height>
</rect>
</property>
<property name="text">
@ -144,8 +147,8 @@
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>60</x>
<y>210</y>
<x>360</x>
<y>50</y>
<width>41</width>
<height>31</height>
</rect>
@ -160,8 +163,8 @@
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>20</x>
<y>250</y>
<x>10</x>
<y>110</y>
<width>71</width>
<height>31</height>
</rect>
@ -176,8 +179,8 @@
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>60</x>
<y>290</y>
<x>330</x>
<y>110</y>
<width>41</width>
<height>31</height>
</rect>
@ -192,9 +195,9 @@
<widget class="QDateEdit" name="dateDataNascita">
<property name="geometry">
<rect>
<x>100</x>
<y>130</y>
<width>161</width>
<x>10</x>
<y>80</y>
<width>101</width>
<height>32</height>
</rect>
</property>
@ -205,9 +208,9 @@
<widget class="QComboBox" name="comboProfessione">
<property name="geometry">
<rect>
<x>100</x>
<y>250</y>
<width>161</width>
<x>10</x>
<y>140</y>
<width>311</width>
<height>32</height>
</rect>
</property>
@ -215,13 +218,52 @@
<widget class="QComboBox" name="comboFonte">
<property name="geometry">
<rect>
<x>100</x>
<y>290</y>
<width>161</width>
<x>330</x>
<y>140</y>
<width>311</width>
<height>32</height>
</rect>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>10</x>
<y>180</y>
<width>631</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>10</x>
<y>200</y>
<width>91</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>Cerca</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>110</x>
<y>200</y>
<width>131</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>Inserisci / Modifica</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">