Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
kpropertysheet.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of KDWinutils, KDAB's MFC to Qt migration tool.
4**
5** Copyright (C) 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6** All rights reserved.
7**
8** This file is intended solely for use by the migration tools and services
9** provided by Klarälvdalens Datakonsult AB.
10**
11** Any other use or distribution of this software that is not otherwise agreed
12** upon in writing and signed by an authorized representative of Klarälvdalens
13** Datakonsult AB, KDAB (USA) LLC, KDAB (Deutschland) GmbH & Co. K.G.,
14** KDAB (France) SAS, KDAB (UK), Ltd., or any future subsidiary of Klarälvdalens
15** Datakonsult AB is hereby prohibited.
16**
17** Contact info@kdab.com if any conditions stated above are unclear to you.
18**
19****************************************************************************/
20
21#pragma once
22
24#include "kdialog.h"
25#include "kpropertypage.h"
26
27#include <QDialog>
28
29class QTabWidget;
30class QDialogButtonBox;
31
33
40{
41 Q_OBJECT
42
43public:
44 explicit KPropertySheet(QWidget *parent = nullptr);
45 ~KPropertySheet() override;
46
47public:
49 void AddPage(KPropertyPage *pPage);
51 int GetActiveIndex() const;
55 KPropertyPage *GetPage(int nPage) const;
57 int GetPageCount() const;
63 void RemovePage(int nPage);
65 bool SetActivePage(int nPage);
69 void SetTitle(const QString &title, uint nStyle = 0);
70
71private:
72 void pageTitleChanged(const QString &title);
73 void okButtonClicked();
74 void cancelButtonClicked();
75 void applyButtonClicked();
76 void helpButtonClicked();
77 bool changeIndex(int newIndex);
78 void updateButtons();
79
80 QList<KPropertyPage *> propertyPages() const;
81 QPushButton *applyButton() const;
82
83private:
84 QTabWidget *m_tabWidget = nullptr;
85 QDialogButtonBox *m_buttonBox = nullptr;
86 int m_previousIndex = -1;
87};
88
The KDialog class is used to replace MFC KDialog.
Definition kdialog.h:40
The KPropertyPage class is used as a page inside a KPropertySheet.
Definition kpropertypage.h:36
The KPropertySheet class is a dialog with a tab control that contains property pages.
Definition kpropertysheet.h:40
bool SetActivePage(int nPage)
Programmatically sets the active page at the given index.
void AddPage(KPropertyPage *pPage)
Adds a page to the property sheet.
void RemovePage(KPropertyPage *pPage)
Removes a page from the property sheet.
int GetPageCount() const
Retrieves the number of pages in the property sheet.
int GetPageIndex(KPropertyPage *pPage)
Retrieves the index of the specified page of the property sheet.
KPropertyPage * GetPage(int nPage) const
Retrieves a pointer to the specified page.
~KPropertySheet() override
void SetTitle(const QString &title, uint nStyle=0)
Sets the caption of the property sheet.
bool SetActivePage(KPropertyPage *pPage)
Programmatically sets the active page object.
KPropertyPage * GetActivePage() const
Returns the active page object.
KPropertySheet(QWidget *parent=nullptr)
int GetActiveIndex() const
void RemovePage(int nPage)
Removes the page at the given index from the property sheet.
#define KDWINUTILS_EXPORT
Definition kdwinutils_export.h:31
#define KDWINUTILS_BEGIN_NAMESPACE
Definition kdwinutils_global.h:27
#define KDWINUTILS_END_NAMESPACE
Definition kdwinutils_global.h:28