parentItem->appendRows(itemList1);, а так:
for (int i = 0; i < 3; ++i)
{
item1 = new QStandardItem;
item1->setText("item1-" + QString::number(i));
parentItem->appendRow(item1);
for (int i = 0; i < 3; ++i)
{
item2 = new QStandardItem;
item2->setText("item2-" + QString::number(i));
item1->appendRow(item2);
for (int i = 0; i < 3; ++i)
{
item3 = new QStandardItem;
item3->setText("item3-" + QString::number(i));
item2->appendRow(item3);
}
}
}
bool Widget::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::FocusOut)
{
if (object == this)
{
qDebug() << "Здесь ловим событие focus Out!";
this->isActive = false;
this->update(); // из-за этой строчки я потерял 1,5 часа)
}
}
return false;
}
#include <iostream>
#include <windows.h>
using namespace std;
VOID LogicalToPhysical(TCHAR *szDrive)
{
LPCTSTR szPhysical; // was CString
HANDLE h = CreateFile(szDrive, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (INVALID_HANDLE_VALUE != h)
{
STORAGE_DEVICE_NUMBER sd = { 0 };
DWORD dwRet;
if (DeviceIoControl(h, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &sd, sizeof(STORAGE_DEVICE_NUMBER), &dwRet, NULL))
{
cout << "Physical disk: " << sd.DeviceNumber;
}
else {
cout << GetLastError();
}
CloseHandle(h);
}
else {
cout << "Invalid handle value\n";
}
}
int main(int argc, char *argv[])
{
LogicalToPhysical(TEXT("\\\\.\\\\E:"));
return 0;
}
android:launchMode="singleTop"
@Override
public void onNewIntent(Intent intent) {
String query = null;
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
query = intent.getStringExtra(SearchManager.QUERY);
Log.i(TAG, "Received a new search query: " + query);
}
}