Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how can i get Delegate for QTableWidget?

how can i get Delegate for QTableWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
qtablewidgetqmouseevent
30 Posts 4 Posters 15.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    srikanth
    wrote on 26 Aug 2016, 07:24 last edited by
    #1

    Problem in getting delegates on QTableWidget, I'm trying to use two delegates (comboboxdelegate, spinbox delegate) to control user input in a QTableWidget with 2 columns and one row, but after reading the Delegate Classes page and looking through the SpinBox & comboox Delegate example, I thought I'd figured out how things work, but clearly haven't.

    (sorry for my english), any help is appreciated.

    The code is as follows.

    notepad.h file

    #ifndef NOTEPAD_H
    #define NOTEPAD_H
    #include <QtGui>
    
    class Notepad : public QMainWindow
    {
        Q_OBJECT
    
       public:
    		//Notepad(QWidget *parent = 0, Qt::WFlags flags = 0);
    		Notepad();
    		void test();
    		QTableWidget* table ;
        public slots:
            void add();
            void Delete();
    		void mouseReleaseEvent ( QMouseEvent * event );
    
        private:
            QAction *add_action;
            QAction *Delete_action;
    		
    };
    
    class SpinBoxDelegate : public QStyledItemDelegate,public Notepad
    {
        Q_OBJECT
    public:
        SpinBoxDelegate(QObject *parent = 0);
        QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                              const QModelIndex &index) /*const Q_DECL_OVERRIDE*/;
    
        void setEditorData(QWidget *editor, const QModelIndex &index) /*const Q_DECL_OVERRIDE*/;
        void setModelData(QWidget *editor, QAbstractItemModel *model,
                          const QModelIndex &index) /*const Q_DECL_OVERRIDE*/;
    
        void updateEditorGeometry(QWidget *editor,
            const QStyleOptionViewItem &option, const QModelIndex &index) /*const Q_DECL_OVERRIDE*/;
    };
    
    class ComboBoxDelegate : public QStyledItemDelegate,public Notepad
    {
    Q_OBJECT
    
    public:
    ComboBoxDelegate(QObject *parent = 0);
    
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
    const QModelIndex &index) const;
    
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model,
    const QModelIndex &index) const;
    
    void updateEditorGeometry(QWidget *editor,
    const QStyleOptionViewItem &option, const QModelIndex &index) const;
    };
    
    #endif // NOTEPAD_H
    

    notepad.cpp file

    #include "notepad.h"
    #include <QMessageBox>
    #include <QTableView>
    #include <QMouseEvent>
    #include <QSpinBox>
    #include <QComboBox>
    #include <QStandardItemModel>
    Notepad::Notepad()
    {
    	table = new QTableWidget();
    	 test() ;
    		SpinBoxDelegate();
    		ComboBoxDelegate();
    	add_action = new QAction(tr("Add cell"), this);
    	add_action->setIcon(QIcon("add.jpg"));
        Delete_action = new QAction(tr("Delete cell"), this);
    	Delete_action->setIcon(QIcon("delete.jpg"));
        
    	connect(Delete_action, SIGNAL(triggered()), this, SLOT(Delete()));
    	connect(add_action, SIGNAL(triggered()), this, SLOT(add()));
      	
    	//tableItem->setFlags(tableItem->flags() ^ Qt::ItemIsEditable);
    	
    	centralWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
    	centralWidget()->setAttribute(Qt::WA_MouseTracking,true);
    	
    	setMouseTracking(true);
    	
    }
    void Notepad::test() 
    {	    
    	
    	QTableWidgetItem* tableItem = new QTableWidgetItem();
    	
    	table->setRowCount(1);
    	table->setColumnCount(3);
    	table->setItem(0,0,new QTableWidgetItem());
    	table->setItem(0,1,new QTableWidgetItem());
    	table->setItem(0,2,new QTableWidgetItem());
    
    	table->setMouseTracking(true);
        table->viewport()->setMouseTracking(true);
        table->installEventFilter(this);
        table->viewport()->installEventFilter(this);
    
    	table->setSelectionBehavior(QAbstractItemView::SelectRows);
        table->setSelectionMode(QAbstractItemView::SingleSelection);
    	
    	QStandardItemModel model((table->rowCount()),(table->columnCount()));
    	SpinBoxDelegate sdelegate;
    
    	ComboBoxDelegate comDel;
    	 for (int row = 0; row < 4; ++row)
    	{
    		QWidget *parent;
    		QStyleOptionViewItem option;
            for (int column = 0; column < 1; ++column)
    		{
    			
    			table->setItemDelegateForColumn( column, &comDel);
    			QModelIndex index = model.index(row, column, QModelIndex());
                model.setData(index, QVariant((row + 1) * (column + 1)));
            }
    		for (int column = 1; column < 2; ++column) 
    		{
    		
    		table->setItemDelegateForColumn( column, &sdelegate  );
    		QModelIndex index = model.index(row, column, QModelIndex());
            model.setData(index, QVariant((row + 1) * (column + 1)));
    		}
    	}
    
    
    
    
    	table->setHorizontalHeaderItem(0, new QTableWidgetItem("combobox"));
    	table->setHorizontalHeaderItem(1, new QTableWidgetItem("spinbox"));
    	table->setHorizontalHeaderItem(2, new QTableWidgetItem("lineEdit"));
    	tableItem->setFlags(tableItem->flags() ^ Qt::ItemIsEditable);
    	table->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    	setCentralWidget(table);
    	
    }
    
    void Notepad::mouseReleaseEvent (QMouseEvent * event )
    {	
    	QMessageBox* msgBox;
    	if(event->button() == Qt::RightButton)
    	  {
    QMouseEvent *mouseEvent = static_cast<QMouseEvent*> (event);
           QMenu *menu = new QMenu(this);
           menu->addAction(add_action);
           menu->addAction(Delete_action);
           menu->exec(mouseEvent->globalPos());
    	   //msgBox->setInformativeText("u pressed right button");   	  	  
    	} 
    }
    void Notepad::add() 
    {
    					
    	table->insertRow( 1);
    	
    	setCentralWidget(table);
    	centralWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
    	setMouseTracking(true);
    }
    void Notepad::Delete() 
    {
    	
    	table->removeRow(1);
    
    	setCentralWidget(table);
    	centralWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
        setMouseTracking(true);
    }
    
    
    
    
    
    
    
    
    SpinBoxDelegate::SpinBoxDelegate(QObject *parent)
        : QStyledItemDelegate(parent)
    {
    }
    QWidget *SpinBoxDelegate::createEditor(QWidget *parent,
        const QStyleOptionViewItem &/* option */,
        const QModelIndex &/* index */)/* const*/
    {
    
        QSpinBox *editor = new QSpinBox(parent);
        editor->setFrame(false);
        editor->setMinimum(0);
        editor->setMaximum(100);
        return editor;
    }
    
    void SpinBoxDelegate::setEditorData(QWidget *editor,
                                        const QModelIndex &index) /*const*/
    {
        int value = index.model()->data(index, Qt::EditRole).toInt();
        QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
        spinBox->setValue(value);
    }
    
    void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                       const QModelIndex &index) /*const*/
    {
        QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
        spinBox->interpretText();
        int value = spinBox->value();
        model->setData(index, value, Qt::EditRole);
    }
    
    void SpinBoxDelegate::updateEditorGeometry(QWidget *editor,
        const QStyleOptionViewItem &option, const QModelIndex &/* index */) /*const*/
    {
        editor->setGeometry(option.rect);
    }
    
    ComboBoxDelegate::ComboBoxDelegate(QObject *parent)
    : QStyledItemDelegate(parent)
    {
    }
    
    QWidget *ComboBoxDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem &/* option */,
    const QModelIndex &/* index */) const
    {
    QComboBox *editor = new QComboBox(parent);
    QStringList list ;
    list << "srikanth" << "dilip";
    editor->addItems(list);
    //editor->installEventFilter(const_cast<ComboBoxDelegate*>(this));
    
    return editor;
    }
    
    void ComboBoxDelegate::setEditorData(QWidget *editor,
    const QModelIndex &index) const
    {
    QString value = index.model()->data(index, Qt::DisplayRole).toString();
    
    QComboBox *comboBox = static_cast<QComboBox*>(editor);
    comboBox->addItem(value);
    }
    
    void ComboBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
    const QModelIndex &index) const
    {
    QComboBox *comboBox = static_cast<QComboBox*>(editor);
    QString value = comboBox->currentText();
    
    model->setData(index, value);
    }
    
    void ComboBoxDelegate::updateEditorGeometry(QWidget *editor,
    const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
    {
    editor->setGeometry(option.rect);
    }
    

    main.cpp file

    #include <QtGui>
    #include <notepad.h>
    int main(int argv, char **args)  {
        QApplication app(argv, args);
    	
       Notepad notepad;
     
        notepad.show();
    
        return app.exec();
    }
    
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 26 Aug 2016, 07:30 last edited by
      #2

      Hi and welcome
      in ::test()
      you have
      ComboBoxDelegate comDel;
      This will be deleted as soon as Test ends. ( running out of scope)
      So thats not so good as we want it to live longer :)

      Please try
      ComboBoxDelegate * comDel = new ComboBoxDelegate ();

      for your delegates so they outlive the function where created.

      S 1 Reply Last reply 26 Aug 2016, 07:36
      2
      • mrjjM mrjj
        26 Aug 2016, 07:30

        Hi and welcome
        in ::test()
        you have
        ComboBoxDelegate comDel;
        This will be deleted as soon as Test ends. ( running out of scope)
        So thats not so good as we want it to live longer :)

        Please try
        ComboBoxDelegate * comDel = new ComboBoxDelegate ();

        for your delegates so they outlive the function where created.

        S Offline
        S Offline
        srikanth
        wrote on 26 Aug 2016, 07:36 last edited by
        #3

        @mrjj ComboBoxDelegate comDel; and SpinBoxDelegate sdelegate;
        are the class objects , am calling here to execute on those objects .

        mrjjM 1 Reply Last reply 26 Aug 2016, 07:48
        0
        • S srikanth
          26 Aug 2016, 07:36

          @mrjj ComboBoxDelegate comDel; and SpinBoxDelegate sdelegate;
          are the class objects , am calling here to execute on those objects .

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 26 Aug 2016, 07:48 last edited by mrjj
          #4

          @srikanth
          But you set them to the view and
          void Notepad::test()
          {
          ..
          ComboBoxDelegate comDel;; <<< lives here. not in class

          Will die as soon as test() is executed and the view will point to invalid object.

          here u give it address of this local variable that will be deleted soon.
          table->setItemDelegateForColumn( column, &comDel);

          So it does NOT look right to me :)

          S 1 Reply Last reply 26 Aug 2016, 08:53
          0
          • mrjjM mrjj
            26 Aug 2016, 07:48

            @srikanth
            But you set them to the view and
            void Notepad::test()
            {
            ..
            ComboBoxDelegate comDel;; <<< lives here. not in class

            Will die as soon as test() is executed and the view will point to invalid object.

            here u give it address of this local variable that will be deleted soon.
            table->setItemDelegateForColumn( column, &comDel);

            So it does NOT look right to me :)

            S Offline
            S Offline
            srikanth
            wrote on 26 Aug 2016, 08:53 last edited by
            #5

            @mrjj so what can i do ta add delegates , actually Notepad class is to create a window with tablewidget contains 3 columns and 1 row,am using mouse event to add rows and delete rows by using ActinEvent methods, up to here everything is doing good, now i am trying to add combobox delegate to 1st column and spinbox delegate to 2nd column so am not able to do please give me the solution please...

            mrjjM 1 Reply Last reply 26 Aug 2016, 08:54
            0
            • S srikanth
              26 Aug 2016, 08:53

              @mrjj so what can i do ta add delegates , actually Notepad class is to create a window with tablewidget contains 3 columns and 1 row,am using mouse event to add rows and delete rows by using ActinEvent methods, up to here everything is doing good, now i am trying to add combobox delegate to 1st column and spinbox delegate to 2nd column so am not able to do please give me the solution please...

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 26 Aug 2016, 08:54 last edited by
              #6

              @srikanth

              you just new them instead :)
              ComboBoxDelegate * comDel = new ComboBoxDelegate ();
              Rest is 100% the same.
              except no & in
              table->setItemDelegateForColumn( column, &comDel);
              -->
              table->setItemDelegateForColumn( column, comDel);

              S VRoninV 2 Replies Last reply 26 Aug 2016, 09:07
              1
              • mrjjM mrjj
                26 Aug 2016, 08:54

                @srikanth

                you just new them instead :)
                ComboBoxDelegate * comDel = new ComboBoxDelegate ();
                Rest is 100% the same.
                except no & in
                table->setItemDelegateForColumn( column, &comDel);
                -->
                table->setItemDelegateForColumn( column, comDel);

                S Offline
                S Offline
                srikanth
                wrote on 26 Aug 2016, 09:07 last edited by
                #7

                @mrjj but again same problem raising.

                mrjjM 1 Reply Last reply 26 Aug 2016, 09:28
                0
                • mrjjM mrjj
                  26 Aug 2016, 08:54

                  @srikanth

                  you just new them instead :)
                  ComboBoxDelegate * comDel = new ComboBoxDelegate ();
                  Rest is 100% the same.
                  except no & in
                  table->setItemDelegateForColumn( column, &comDel);
                  -->
                  table->setItemDelegateForColumn( column, comDel);

                  VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on 26 Aug 2016, 09:13 last edited by
                  #8

                  @mrjj The view does not take ownership of the delegate so you have to give a parent to comDel or it will leak

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  mrjjM 1 Reply Last reply 26 Aug 2016, 09:26
                  1
                  • VRoninV VRonin
                    26 Aug 2016, 09:13

                    @mrjj The view does not take ownership of the delegate so you have to give a parent to comDel or it will leak

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 26 Aug 2016, 09:26 last edited by mrjj
                    #9

                    @VRonin
                    Thanks. I thought setItemDelegateForColumn would - so thats a very good point;
                    (Docs clearly states it do not so assumption is the mother of all fups :)

                    1 Reply Last reply
                    1
                    • S srikanth
                      26 Aug 2016, 09:07

                      @mrjj but again same problem raising.

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 26 Aug 2016, 09:28 last edited by
                      #10

                      @srikanth
                      Hi
                      You changed to use new?
                      So what is the exact issue?
                      No deletegate is shown, or ?

                      S 1 Reply Last reply 26 Aug 2016, 10:42
                      0
                      • mrjjM mrjj
                        26 Aug 2016, 09:28

                        @srikanth
                        Hi
                        You changed to use new?
                        So what is the exact issue?
                        No deletegate is shown, or ?

                        S Offline
                        S Offline
                        srikanth
                        wrote on 26 Aug 2016, 10:42 last edited by
                        #11

                        @mrjj the error is showing like this "Unhandled exception at 0x778e3560 in add or remove colmns.exe:0xC00000FD:Stack overflow. "
                        and i make changes like this as you said

                        void Notepad::test() 
                        {	
                        	QTableWidgetItem* tableItem = new QTableWidgetItem();
                        	
                        	table->setRowCount(1);
                        	table->setColumnCount(3);
                        	table->setItem(0,0,new QTableWidgetItem());
                        	table->setItem(0,1,new QTableWidgetItem());
                        	table->setItem(0,2,new QTableWidgetItem());
                        
                        	table->setMouseTracking(true);
                            table->viewport()->setMouseTracking(true);
                            table->installEventFilter(this);
                            table->viewport()->installEventFilter(this);
                        
                            table->setSelectionBehavior(QAbstractItemView::SelectRows);
                            table->setSelectionMode(QAbstractItemView::SingleSelection);
                        	
                        	QStandardItemModel model((table->rowCount()),(table->columnCount()));
                        	//SpinBoxDelegate sdelegate;
                        	SpinBoxDelegate *sdelegate = new SpinBoxDelegate ();
                        	ComboBoxDelegate * comDel = new ComboBoxDelegate ();
                        	//ComboBoxDelegate comDel;
                        	 for (int row = 0; row < 4; ++row)
                        	{
                        		QWidget *parent;
                        		QStyleOptionViewItem option;
                                for (int column = 0; column < 1; ++column)
                        		{
                        			
                        			table->setItemDelegateForColumn( column, comDel);
                        			QModelIndex index = model.index(row, column, QModelIndex());
                                    model.setData(index, QVariant((row + 1) * (column + 1)));
                                }
                        		for (int column = 1; column < 2; ++column) 
                        		{
                        		
                        		table->setItemDelegateForColumn( column, sdelegate  );
                        		QModelIndex index = model.index(row, column, QModelIndex());
                                model.setData(index, QVariant((row + 1) * (column + 1)));
                        		}
                        	}
                        
                        
                        	table->setHorizontalHeaderItem(0, new QTableWidgetItem("combobox"));
                        	table->setHorizontalHeaderItem(1, new QTableWidgetItem("spinbox"));
                        	table->setHorizontalHeaderItem(2, new QTableWidgetItem("lineEdit"));
                        	tableItem->setFlags(tableItem->flags() ^ Qt::ItemIsEditable);
                        	table->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
                        	setCentralWidget(table);
                        	
                        }
                        
                        1 Reply Last reply
                        0
                        • mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 26 Aug 2016, 11:11 last edited by
                          #12

                          Hi
                          That is a bug in your code, most likely.

                          Please use debugger and single step to find the line
                          that gives it.

                          Its very hard to guess by looking at code.

                          You get a Stack overflow - which often is a infinite loop or something like that.

                          S 2 Replies Last reply 29 Aug 2016, 04:59
                          1
                          • mrjjM mrjj
                            26 Aug 2016, 11:11

                            Hi
                            That is a bug in your code, most likely.

                            Please use debugger and single step to find the line
                            that gives it.

                            Its very hard to guess by looking at code.

                            You get a Stack overflow - which often is a infinite loop or something like that.

                            S Offline
                            S Offline
                            srikanth
                            wrote on 29 Aug 2016, 04:59 last edited by
                            #13
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • mrjjM mrjj
                              26 Aug 2016, 11:11

                              Hi
                              That is a bug in your code, most likely.

                              Please use debugger and single step to find the line
                              that gives it.

                              Its very hard to guess by looking at code.

                              You get a Stack overflow - which often is a infinite loop or something like that.

                              S Offline
                              S Offline
                              srikanth
                              wrote on 29 Aug 2016, 05:02 last edited by
                              #14

                              @mrjj 0_1472446858318_Untitled.jpg

                              am getting error like this am not able to find where the error is , please help me.

                              mrjjM 1 Reply Last reply 29 Aug 2016, 06:14
                              0
                              • S srikanth
                                29 Aug 2016, 05:02

                                @mrjj 0_1472446858318_Untitled.jpg

                                am getting error like this am not able to find where the error is , please help me.

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 29 Aug 2016, 06:14 last edited by
                                #15

                                @srikanth
                                Most likely in your delegate.
                                You can insert break point in each function and single step when you reach it.
                                That way you can find where it crashes.
                                No way i can just guess it, sadly.

                                if you think it crash in Notepad::test()
                                single step should find it.

                                S 1 Reply Last reply 29 Aug 2016, 06:58
                                0
                                • J Offline
                                  J Offline
                                  Jan-Willem
                                  wrote on 29 Aug 2016, 06:52 last edited by
                                  #16

                                  Just wondering, but it seems you add a columnDelegate for every row you pass through. If I'm not mistaken, you should add a columnDelegate just once for the entire column.

                                  And you seem to use a for-statement for setting the columDelegate, while you only execute it once. That doesn't make sense to me.

                                  I'm not sure if this would fix anything of your problem, but I think you're code would benefit from it if you if you fixed this.

                                  S 1 Reply Last reply 29 Aug 2016, 07:07
                                  2
                                  • mrjjM mrjj
                                    29 Aug 2016, 06:14

                                    @srikanth
                                    Most likely in your delegate.
                                    You can insert break point in each function and single step when you reach it.
                                    That way you can find where it crashes.
                                    No way i can just guess it, sadly.

                                    if you think it crash in Notepad::test()
                                    single step should find it.

                                    S Offline
                                    S Offline
                                    srikanth
                                    wrote on 29 Aug 2016, 06:58 last edited by
                                    #17

                                    @mrjj i did debug by using break points, everything is working fine , in .cpp file up to return app.exec(); in main.cpp , here it is getting crash and showing this error.

                                    mrjjM 1 Reply Last reply 29 Aug 2016, 07:08
                                    1
                                    • J Jan-Willem
                                      29 Aug 2016, 06:52

                                      Just wondering, but it seems you add a columnDelegate for every row you pass through. If I'm not mistaken, you should add a columnDelegate just once for the entire column.

                                      And you seem to use a for-statement for setting the columDelegate, while you only execute it once. That doesn't make sense to me.

                                      I'm not sure if this would fix anything of your problem, but I think you're code would benefit from it if you if you fixed this.

                                      S Offline
                                      S Offline
                                      srikanth
                                      wrote on 29 Aug 2016, 07:07 last edited by
                                      #18

                                      @Jan-Willem thanks a lot the error is fix, when i put for loop in a comment , now how can i assign ComboBoxDelegate for 1st column and SpinBoxDelegate to 2nd cloumn.

                                      1 Reply Last reply
                                      0
                                      • S srikanth
                                        29 Aug 2016, 06:58

                                        @mrjj i did debug by using break points, everything is working fine , in .cpp file up to return app.exec(); in main.cpp , here it is getting crash and showing this error.

                                        mrjjM Offline
                                        mrjjM Offline
                                        mrjj
                                        Lifetime Qt Champion
                                        wrote on 29 Aug 2016, 07:08 last edited by
                                        #19

                                        @srikanth
                                        hi
                                        Sounds like you crash when close down then/cleaning up.
                                        I think
                                        @Jan-Willem has a point of you setting multiple times.
                                        setItemDelegateForColumn( column, comDel);
                                        It might delete it multiple times.
                                        So please try set only once. (for test)

                                        J 1 Reply Last reply 29 Aug 2016, 07:17
                                        2
                                        • mrjjM mrjj
                                          29 Aug 2016, 07:08

                                          @srikanth
                                          hi
                                          Sounds like you crash when close down then/cleaning up.
                                          I think
                                          @Jan-Willem has a point of you setting multiple times.
                                          setItemDelegateForColumn( column, comDel);
                                          It might delete it multiple times.
                                          So please try set only once. (for test)

                                          J Offline
                                          J Offline
                                          Jan-Willem
                                          wrote on 29 Aug 2016, 07:17 last edited by
                                          #20

                                          In addidtion to @mrjj, I would suggest before or after the entire

                                          for (int row = 0; row < 4; ++row)
                                          
                                          S 1 Reply Last reply 29 Aug 2016, 09:10
                                          1

                                          1/30

                                          26 Aug 2016, 07:24

                                          • Login

                                          • Login or register to search.
                                          1 out of 30
                                          • First post
                                            1/30
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved