mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Fixes and improvement of NULL value handling in Edit DB Cell dock
Fix: NULL data are correctly indicated in the Cell Info footer when loading data from the database. Previously, the automatic trigger of editModeChanged when setting the text in the widget was causing the change to Text data type. Now the modified flag of the widget is taken into account. Fix: NULL values could not be overwritten with empty strings, since the old vs. new check was incorrectly returning false as the conversion to string was discarding the NULL information. Improvement: NULL values are visually indicated using the placeholder as already done in the Add Record dialog. The italic style is applied to both cases now for better indication and coherence to the browse data widget. Known problem: when the cell is changed from a JSON cell to a NULL cell and the automatic switch is on, the NULL information and visual indication are still lost.
This commit is contained in:
@@ -22,9 +22,11 @@ public:
|
||||
void setNull(bool value) {
|
||||
if (value) {
|
||||
clear();
|
||||
setStyleSheet("QLineEdit{ font-style: italic; }");
|
||||
setPlaceholderText(Settings::getValue("databrowser", "null_text").toString());
|
||||
setModified(false);
|
||||
} else
|
||||
setStyleSheet("");
|
||||
setPlaceholderText("");
|
||||
m_isNull = value;
|
||||
}
|
||||
@@ -51,6 +53,7 @@ protected:
|
||||
setNull(true);
|
||||
else {
|
||||
// Remove any possible NULL mark when user starts typing
|
||||
setStyleSheet("");
|
||||
setPlaceholderText("");
|
||||
QLineEdit::keyPressEvent(evt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user