Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9675

Segmentation fault with template

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • Qt Creator 2.7.2
    • Qt Creator 2.7.1
    • C/C++/Obj-C++ Support
    • None
    • Linux qwerty-Computer 3.5.0-19-generic #30-Ubuntu SMP Tue Nov 13 17:49:53 UTC 2012 i686 i686 i686 GNU/Linux
      Qt 4.8.3
      QtCreator 2.7.1

    Description

      If I had the key word this on With this simple code, QtCreator Segfault...

      #include <QWidget>
      
      template <class T>
      class QWidgetDraw : public T
      {
      	public:
      		explicit QWidgetDraw( QWidget* parent = 0 ) : QWidget(parent) {}
      
      	protected:
      		virtual void paintEvent( QPaintEvent* event );
      };
      
      template <class T>
      virtual void QWidgetDraw<T>::paintEvent( QPaintEvent* event )
      {
      	Q_UNUSED(event);
      
      	QPainter painter(this);
      	painter.setRenderHint( QPainter::Antialiasing );
      
      	// Draw simple widget
      	QStyleOption opt;
      	opt.init(this);
      
      
      	////////////////////////////////////////////////////////////////////////////
      	// Try to add this-> to this line
      	style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            ipc IPC
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes