Forum
Sign Up
× DataGrid for Qt.C++

add column assert!!

10 years 7 months ago #1 by Kwangho Kim
i use QtitanDataGrid 3.3.2 and i'm very disappoint qtitandatagrid's bugs.

In all examples, Qtitandatagrid was setModel with autocreatecolumn = true. Then, no problem.

but, when setModel with autocreatecolumn = false, addcolumn assert. ( In GridBandedTableView, not GridTableView )


CManageUnapproveSWUI::CManageUnapproveSWUI( QWidget* parent /*= 0 */ )
: QDialog( parent, Qt::FramelessWindowHint )
{
ui.setupUi( this );

ui.tblUnapproveSW->setViewType( Qtitan::Grid::BandedTableView );
auto tblAmalgamation = ui.tblUnapproveSW->view< Qtitan::GridBandedTableView >();
auto& tblOptions = tblAmalgamation->options();

tblAmalgamation->setModel( &_amalgamationItemModel, QModelIndex(), false );

tblOptions.setGroupsHeader( false );
tblOptions.setBandsHeader( false );
tblOptions.setColumnAutoWidth( true );
tblOptions.setRowAutoHeight( true );

_amalgamationItemModel.init( tblAmalgamation );
_amalgamationItemModel.createColumns();
}

void CManageUnapproveSWModel::createColumns()
{
if( m_view == NULLPTR )
return;

if( m_view->getColumnCount() > 0 )
return;

Qtitan::GridBandedTableView* spView = qobject_cast<Qtitan::GridBandedTableView*>(m_view);

spView->removeColumns();

auto spProcessBand = spView->addBand( tr( "??????" ) );
auto spBlockInfoBand = spView->addBand( tr( "????" ) );
auto spApproveInfoBand = spView->addBand( tr( "????" ) );

spProcessBand->setBandIndex( 0 );
spBlockInfoBand->setBandIndex( 1 );
spApproveInfoBand->setBandIndex( 2 );

colBase = spView->addColumn( 0 ); // assert!!
if( colBase == NULLPTR )
return;

colBase->setBandIndex( 0 );
colBase->setRowIndex( 0 );
colBase->setRowSpan( 2 );

}
---

attchments 1 - when GridViewAutoUpdater destroy, assert
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #2 by Developer Machines
Thanks for this bug report. To fix this issue with banded view please do the following:
    spView ->beginUpdate();
    colBase = spView->addColumn(0);
    colBase->setBandIndex(0);
    ...............
    ...............
    view->endUpdate();
Last edit: 10 years 7 months ago by Developer Machines.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.149 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )