urmila
29th August 2014, 10:43
I have QStandardItemModel with QCombobox and QTextedit as items. There are three PushButtons selector, next and previous to view the different row items to be selected. But instead of using Push buttons when I select directly the from the drop down menu the text edit is not automatically viewed with correct row item.
My code is:
QStringList detectorMethodLists;
detectorMethodLists << tr("ORB") << tr("SURF") << tr("SIFT") << tr("FAST") << tr("BRISK") << tr("AKAZE");
detectorListModel_ = new QStringListModel(detectorMethodLists, this);
detectorModel_ = new QStandardItemModel(6, 3, this);
QStringList detectorParameterLists;
QString ORBString, SURFString, SIFTString, FASTString, BRISKString, KAZEString;
ORBString = "nFeatures=2000, scaleFactor=1.2, nLevels=8, EdgeThreshold=31, Firstlevel=0, WTA_K=2, ScoreType=0, PatchSize=31";
SURFString = "HessianThreshold=500.00, nOctaves=4, nOctaveLayers=2,extended = true,upright = false";
SIFTString = "nFeatures=0, nOctaveLayers=3, ContrastThreshold=0.04, EdgeThreshold=10.0, Sigma=1.6 ";
FASTString = "Threshold=10, nonmaxSuppression=true, type=TYPE_9_16";
BRISKString = "Thresh=30, Octaves=3, PatternScale=1.0";
KAZEString = " ";
detectorParameterLists << ORBString << SURFString << SIFTString << FASTString << BRISKString << KAZEString;
QStringList detectorTypes;
detectorTypes << "0" << "1" << "2" << "3" << "4" << "5";
for (int detectorRow = 0; detectorRow < 6; ++detectorRow) {
QStandardItem *featureItem = new QStandardItem(detectorTypes[detectorRow]);
detectorModel_->setItem(detectorRow, 0, featureItem);
featureItem = new QStandardItem(detectorParameterLists[detectorRow]);
detectorModel_->setItem(detectorRow, 1, featureItem);
For example when I directly select(without using PushButton) from ORB to SURF in combobox the textedit string SURFString is not viewed but I view the ORB String.
Anyone can help me to solve this problem. I think I have to add a code of connecting signal slot.
My code is:
QStringList detectorMethodLists;
detectorMethodLists << tr("ORB") << tr("SURF") << tr("SIFT") << tr("FAST") << tr("BRISK") << tr("AKAZE");
detectorListModel_ = new QStringListModel(detectorMethodLists, this);
detectorModel_ = new QStandardItemModel(6, 3, this);
QStringList detectorParameterLists;
QString ORBString, SURFString, SIFTString, FASTString, BRISKString, KAZEString;
ORBString = "nFeatures=2000, scaleFactor=1.2, nLevels=8, EdgeThreshold=31, Firstlevel=0, WTA_K=2, ScoreType=0, PatchSize=31";
SURFString = "HessianThreshold=500.00, nOctaves=4, nOctaveLayers=2,extended = true,upright = false";
SIFTString = "nFeatures=0, nOctaveLayers=3, ContrastThreshold=0.04, EdgeThreshold=10.0, Sigma=1.6 ";
FASTString = "Threshold=10, nonmaxSuppression=true, type=TYPE_9_16";
BRISKString = "Thresh=30, Octaves=3, PatternScale=1.0";
KAZEString = " ";
detectorParameterLists << ORBString << SURFString << SIFTString << FASTString << BRISKString << KAZEString;
QStringList detectorTypes;
detectorTypes << "0" << "1" << "2" << "3" << "4" << "5";
for (int detectorRow = 0; detectorRow < 6; ++detectorRow) {
QStandardItem *featureItem = new QStandardItem(detectorTypes[detectorRow]);
detectorModel_->setItem(detectorRow, 0, featureItem);
featureItem = new QStandardItem(detectorParameterLists[detectorRow]);
detectorModel_->setItem(detectorRow, 1, featureItem);
For example when I directly select(without using PushButton) from ORB to SURF in combobox the textedit string SURFString is not viewed but I view the ORB String.
Anyone can help me to solve this problem. I think I have to add a code of connecting signal slot.