KexiTemplateSelectionPage::KexiTemplateSelectionPage(QWidget* parent) : KexiAssistantPage(i18n("New Project"), i18n("Kexi will create a new database project. Select blank database or template."), parent) { m_templatesList = new KexiCategorizedView; setFocusWidget(m_templatesList); m_templatesList->setFrameShape(QFrame::NoFrame); m_templatesList->setContentsMargins(0, 0, 0, 0); int margin = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, 0) + KDialog::marginHint(); //m_templatesList->setCategorySpacing(5 + margin); //not needed in grid: m_templatesList->setSpacing(margin); m_templatesList->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); connect(m_templatesList, SIGNAL(clicked(QModelIndex)), this, SLOT(slotItemClicked(QModelIndex))); KexiTemplateCategoryInfoList templateCategories; KexiTemplateCategoryInfo templateCategory; templateCategory.name = "blank"; templateCategory.caption = i18n("Blank Projects"); KexiTemplateInfo info; info.name = "blank"; info.caption = i18n("Blank database"); info.description = i18n("Database project without any objects"); info.icon = KIcon(KexiDB::defaultFileBasedDriverIconName()); //"x-office-document"); templateCategory.addTemplate(info); templateCategories.append(templateCategory); #ifdef KEXI_SHOW_UNIMPLEMENTED templateCategory = KexiTemplateCategoryInfo(); templateCategory.name = "office"; templateCategory.caption = i18n("Office Templates"); info = KexiTemplateInfo(); info.name = "contacts"; info.caption = i18n("Contacts"); info.description = i18n("Database for collecting and managing contacts"); info.icon = koIcon("view-pim-contacts"); templateCategory.addTemplate(info); info = KexiTemplateInfo(); info.name = "movie"; info.caption = i18n("Movie catalog"); info.description = i18n("Database for collecting movies"); info.icon = koIcon("video-x-generic"); templateCategory.addTemplate(info); templateCategories.append(templateCategory); #endif // KEXI_SHOW_UNIMPLEMENTED KexiTemplatesProxyModel* proxyModel = new KexiTemplatesProxyModel(m_templatesList); KexiTemplatesModel* model = new KexiTemplatesModel(templateCategories); proxyModel->setSourceModel(model); m_templatesList->setModel(proxyModel); kDebug() << "templatesCategoryDrawer:" << m_templatesList->categoryDrawer(); setContents(m_templatesList); }
KexiMainWelcomePage::KexiMainWelcomePage( KexiWelcomeAssistant* assistant, QWidget* parent) : KexiAssistantPage(i18n("Welcome to Kexi"), i18n("Select one of the recently used projects to open."), parent) , m_assistant(assistant) { QWidget* contents = new QWidget; QHBoxLayout* contentsLyr = new QHBoxLayout(contents); m_recentProjects = new KexiCategorizedView; // do not alter background palette QPalette pal(m_recentProjects->palette()); pal.setColor(QPalette::Disabled, QPalette::Base, pal.color(QPalette::Normal, QPalette::Base)); m_recentProjects->setPalette(pal); contentsLyr->addWidget(m_recentProjects, 1); //m_recentProjects->setItemDelegate(new KFileItemDelegate(this)); setFocusWidget(m_recentProjects); m_recentProjects->setFrameShape(QFrame::NoFrame); m_recentProjects->setContentsMargins(0, 0, 0, 0); int margin = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, 0) + KDialog::marginHint(); //not needed in grid: m_recentProjects->setSpacing(margin); m_recentProjects->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); connect(m_recentProjects, SIGNAL(clicked(QModelIndex)), this, SLOT(slotItemClicked(QModelIndex))); m_statusBar = new KexiWelcomeStatusBar; contentsLyr->addWidget(m_statusBar); setContents(contents); QTimer::singleShot(100, this, SLOT(loadProjects())); }
int AboutBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotTimeout(); break; case 1: slotItemClicked(); break; default: ; } _id -= 2; } return _id; }
KoResourceItemView::KoResourceItemView(QWidget *parent) : KoTableView(parent) { connect(this, SIGNAL(clicked(QModelIndex)), SLOT(slotItemClicked(QModelIndex))); }