diff --git a/src/Wt/WItemDelegate.C b/src/Wt/WItemDelegate.C index b25e526a79..dcafb42ae2 100644 --- a/src/Wt/WItemDelegate.C +++ b/src/Wt/WItemDelegate.C @@ -103,9 +103,12 @@ std::unique_ptr WItemDelegate::update(WWidget *widget, const WModelInde { bool editing = widget && widget->find("t") == nullptr; + WidgetRef widgetRef(widget); + if (flags.test(ViewItemRenderFlag::Editing)) { if (!editing) { - widget = createEditor(index, flags).release(); + widgetRef.created = createEditor(index, flags); + widgetRef.w = widgetRef.created.get(); WInteractWidget *iw = dynamic_cast(widget); if (iw) { // Disable drag & drop and selection behaviour @@ -115,11 +118,9 @@ std::unique_ptr WItemDelegate::update(WWidget *widget, const WModelInde } } else { if (editing) - widget = nullptr; + widgetRef.w = nullptr; } - WidgetRef widgetRef(widget); - bool isNew = false; bool haveCheckBox = index.isValid() ? !index.data(ItemDataRole::Checked).empty() : false; diff --git a/src/Wt/WTimer b/src/Wt/WTimer index 1e55e2acf7..6a9139be05 100644 --- a/src/Wt/WTimer +++ b/src/Wt/WTimer @@ -79,11 +79,11 @@ public: /*! \brief Returns the interval */ - std::chrono::steady_clock::duration interval() const { return interval_; } + std::chrono::milliseconds interval() const { return interval_; } /*! \brief Sets the interval */ - void setInterval(std::chrono::steady_clock::duration interval); + void setInterval(std::chrono::milliseconds interval); /*! \brief Returns if the timer is running. */ @@ -114,7 +114,7 @@ public: * \endcode */ template - static void singleShot(std::chrono::steady_clock::duration interval, T *receiver, void (V::*method)()); + static void singleShot(std::chrono::milliseconds interval, T *receiver, void (V::*method)()); /*! \brief This static function calls a function after a given time interval. * @@ -122,7 +122,7 @@ public: * template function object (which supports operator ()). */ template - static void singleShot(std::chrono::steady_clock::duration interval, const F& f); + static void singleShot(std::chrono::milliseconds interval, const F& f); #endif // WT_TARGET_JAVA /*! \brief Starts the timer. @@ -153,7 +153,7 @@ private: WTimerWidget *timerWidget_; bool singleShot_; - std::chrono::steady_clock::duration interval_; + std::chrono::milliseconds interval_; bool active_; bool timeoutConnected_; @@ -167,13 +167,13 @@ private: #ifndef WT_TARGET_JAVA template -void WTimer::singleShot(std::chrono::steady_clock::duration interval, T *receiver, void (V::*method)()) +void WTimer::singleShot(std::chrono::milliseconds interval, T *receiver, void (V::*method)()) { singleShot(interval, std::bind(method, receiver)); } template -void WTimer::singleShot(std::chrono::steady_clock::duration interval, const F& f) +void WTimer::singleShot(std::chrono::milliseconds interval, const F& f) { WTimer *timer = new WTimer(); timer->setSingleShot(true); diff --git a/src/Wt/WTimer.C b/src/Wt/WTimer.C index adb30ea7ff..4262678a97 100644 --- a/src/Wt/WTimer.C +++ b/src/Wt/WTimer.C @@ -37,7 +37,7 @@ WTimer::~WTimer() delete timerWidget_; } -void WTimer::setInterval(std::chrono::steady_clock::duration msec) +void WTimer::setInterval(std::chrono::milliseconds msec) { interval_ = msec; }