merry
10th December 2007, 09:21
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);
Combo_SelectDrive->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
}
Pls tell me wat to do now?
Thanx
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);
Combo_SelectDrive->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
}
Pls tell me wat to do now?
Thanx