Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, March 2007
layout warning from designer for custom plugin


Message 1 in thread

Hi,

I have designed a custom plugin which contains two tables arranged 
vertically. The custom plugin is working as designed.The problem here is 
when ever I add this plugin on to a dialog in a designer I keep getting 
this message when I save the dialog.

"No entry for 0x87705d8 (mainLayout, QVBoxLayout) found in MetaDataBase"

and I keep on getting this message when I run the program which uses 
this plugin and the dialog was  designed in the designer using the 
custom plugin.

"QLayout "testdiamondtableLayout" added to QgtDiamondTable 
"testdiamondtable", which already has a layout"

With out a layout in the plugin for the tables the table doesn't get 
displayed  in a dialog.

Should I use the parents layout ?
Let say I am using the parents, then there may be a chance that the 
parent is not yet layouted during designing.


below is a small piece of code for the Custom plugin and there one 
layout intialized in the custom plugin which is done in this constructor.




QgtDiamondTable::
QgtDiamondTable(QWidget *parent ,
            const char *name,
            int pnumColumns ):  QWidget( parent, name ),
                              spreadshtname( name )
   {                       
    
        mainlayout = new QVBoxLayout( this );
        mainlayout->setMargin( 0 );
       
       
        variableTable =new QTable( this , ( spreadshtname + "var" ) );
        variableTable->hide();
        variableTable->setLeftMargin( 0 );   
        variableTable->setTopMargin( 0 );
        variableTable->setSizePolicy( preferred );

        //set the table
        mainTable = new CustomTable( this , spreadshtname );
        mainTable->hide();
        mainTable->setLeftMargin( 0 );   
        mainTable->setTopMargin( 0 );
        mainTable->setSelectionMode( QTable::SingleRow );
        mainTable->setFocusStyle( QTable::FollowStyle );
        mainTable->setShowGrid( false );
        //mainTable->setSizePolicy(expand);
   
        Initialize();
       
        Draw();
               
        //add table to the layout
        mainlayout->addWidget( variableTable );
        mainlayout->addWidget( mainTable );
       
       
        connect( mainTable, SIGNAL( clicked (int, int , int , const 
QPoint&) ),
                     this, SLOT(loadRowToEdit() ));
                                      
         
        variableTable->show();
        mainTable->show();
       
        Draw( );
} // spread sheet ends here

-- 
 [ signature omitted ]