Installation and getting started with first app
-
[quote author="Thomas Kennedy" date="1301584395"]you mean like this ??
@for(int i=0 ; i<roots.count() ; ++i)
{
treeChildItems = new QTreeWidgetItem(treeItems);
QFileInfo fiDrives = roots.at(i);
QString strDrive = fiDrives.absoluteFilePath();
treeChildItems->setText(i,strDrive);
}@
[/quote]You can try it to get the answer :-)
-
tried...it added an 'empty item' at 0th position,and 'c:' at 1st..and no more :-(
-
So... you need to aquire some debugging skills... Just try to follow what happens in your code. Don't guess: measure instead. Try for instance to insert statements like this at every relevant point in your function, and look at the output:
@
qDebug() << LINE;
@ -
:-)) ok..will do that..
-
Of course you must have an empty first entry, because you create this one outside your loop (line 21 in your original code snippet).
This is the compactified working version:
@
void FancyClass::populate() {
ui->treeWidget->setColumnCount(1);
QStringList headers;
headers << "Storage Device";
ui->treeWidget->setHeaderLabels(headers);QTreeWidgetItem *rootItem = new QTreeWidgetItem(ui->treeWidget); rootItem->setText(0, "SystemDevice"); foreach(QFileInfo drive, QDir::drives()) { QTreeWidgetItem *driveItem = new QTreeWidgetItem(rootItem); driveItem->setText(0, drive.absoluteFilePath()); }
}
@ -
thanks a lot...I will try with QFileSystemModel too..
-
"The program can't start because mingwm10.dll is missing from your computer.Try reinstalling the program to fix this problem."
..i am getting this error when i tried running my application in stand alone mode...any help ??
-
YOu are startin g without QtCreator, right?
Did you try to search the forum for answers?
see this "post":http://developer.qt.nokia.com/forums/viewthread/4869
-
yes Gerolf..I searched..everybody says that we need to set the invironment varioables..I did that too but of no use..
-
I have set the PATH environment variable..but it says QtCode4.dll is missing !!
-
sorry..that was typo..QtCore4.dll is correct..but where will this DLL reside ?
-
excellent Gerolf..it is working now..but my icons on buttons and Toolbar are missing in standalone application..
-
[quote author="Thomas Kennedy" date="1301650049"]excellent Gerolf..it is working now..but my icons on buttons and Toolbar are missing in standalone application..[/quote]
Could be some missing image format plugins. Please look in the forum search for "imageformats plugins", it was discussed recently with some hints about how to resolve this issue.
-
yep...now I understood how to create .qrc file..many thanks..
-
i have 7 strings with me..I would like to show them in a text editor line by line...how would i do that ??