我希望mysql查询返回,即使结果为null

时间:2017-05-20 16:20:42

标签: mysql

即使结果为null,我也希望返回一个查询。

我这样做了:

class thumbnail_item: public QListWidgetItem {
  using super = QListWidgetItem;
public:
  explicit thumbnail_item (const QString &filename)
    : super(filename)
    {}
  virtual QVariant data (int role) const override
    {
      if (role == Qt::DecorationRole) {
        QIcon i = super::icon();
        if (i.isNull()) {

          /*
           * The existing thumbnail (if any) is empty so create one
           * from the file name and use it -- remembering to call
           * setIcon so we don't need to go through all this again
           * next time.
           */
          i = QIcon(data(Qt::DisplayRole));
          setIcon(i);
        }
        return(i);
      }
      return(super::data(role));
    }
};

从那以后,我有一个名为orders的表有一个列orderStatus而另一个表叫做order_status。

...谢谢

0 个答案:

没有答案