Hi all
Working on Qt4.2 .
Actually I am having problem with the QCombobox
I am trying to insert list of drives in my system at runtime.
All the list of drives are inserted in the QComboBox ,but if the item is one ,it displays the space for two items , and if the items are two ,it displays the space for four items ,
I dont understand why it is so:
I had done like this:
void ShowDrivesinCombo()
{
Combo_SelectDrive->clear();
DriveInfo *m_pDriveInfo = NULL;
m_pDriveInfo = pDriveListStart;
while(m_pDriveInfo)
{
m_strDrivesInfoList<< tr((const char *) m_pDriveInfo->DisplayLable);
m_pDriveInfo = m_pDriveInfo->next;
}
Combo_SelectDrive->addItems(m_strDrivesInfoList);
Combo_SelectDrive->setEditable(false);
}
void ShowDrivesinCombo()
{
Combo_SelectDrive->clear();
DriveInfo *m_pDriveInfo = NULL;
m_pDriveInfo = pDriveListStart;
while(m_pDriveInfo)
{
m_strDrivesInfoList<< tr((const char *) m_pDriveInfo->DisplayLable);
m_pDriveInfo = m_pDriveInfo->next;
}
Combo_SelectDrive->addItems(m_strDrivesInfoList);
Combo_SelectDrive->setEditable(false);
Combo_SelectDrive->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
}
To copy to clipboard, switch view to plain text mode
Pls tell me wat to do now?
Thanx
Bookmarks