NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
nonemptydelegate.h File Reference

This file contains the declaration of the NonEmptyDelegate class. More...

#include "netrainsimmainwindow.h"
#include <QLineEdit>
#include <QStyledItemDelegate>

Go to the source code of this file.

Classes

class  NonEmptyDelegate
 The NonEmptyDelegate class provides functionality to ensure that table cells are not empty. More...
 

Detailed Description

This file contains the declaration of the NonEmptyDelegate class.

The NonEmptyDelegate class is a QStyledItemDelegate subclass that provides functionality to ensure that table cells are not empty. It checks for empty cells and displays a warning message if a cell is empty. The NonEmptyDelegate class is intended to be used with QLineEdit-based editors in a table view. It is typically used with a QAbstractItemModel-based model. The NonEmptyDelegate class is derived from QStyledItemDelegate and utilizes QLineEdit as the editor widget. This class is suitable for handling non-empty cells in a table view with QLineEdit editors. When the user finishes editing a cell, the model data is checked for emptiness and the appropriate warning message is displayed. The NonEmptyDelegate class can be used in a QWidget-based application. Note: The NonEmptyDelegate class assumes that the parent widget is of type NeTrainSim, which provides the showWarning() function.

Author
Ahmed Aredah
Date
6/7/2023