ImagingTools Core SDK
Classes
imtauthgui Namespace Reference

Authentication UI Components Module. More...

Classes

class  CAccountInfoEditorComp
 
class  CAddressEditorComp
 
class  CContactInfoEditorComp
 
class  CPersonalAccessTokenManagerGuiComp
 
class  CServerConnectionEditorComp
 

Detailed Description

Authentication UI Components Module.

The imtauthgui module provides Qt-based user interface components for authentication and authorization, including login screens, user management interfaces, role editors, and account settings dialogs.

Overview

This module provides ready-to-use UI components for authentication:

Architecture

Design Patterns

Model-View-Controller (MVC):

Observer Pattern:

Delegate Pattern:

Component Pattern (ACF):

Core Components

The module provides authentication UI components:

Login Components:

CStandardLoginGuiComp (iqtgui::TDesignerGuiCompBase)
├─ User/password login form
├─ Superuser password entry
├─ Connection status display
├─ Wait indicator for async operations
└─ Login log message display
└─ CRemoteStandardLoginGuiComp
├─ Remote authentication via GraphQL
├─ Server connection configuration
└─ Network error handling

Account Management:

CAccountInfoEditorComp (iqtgui::TDesignerGuiCompBase)
├─ Edit user account details
├─ Name, email, password fields
├─ Account status and permissions
└─ Data validation and persistence
├─ CAccountInfoViewDelegateComp - View delegate for accounts
└─ CStandardAccountMenuComp - Account menu widget

Contact Information:

CContactInfoEditorComp (iqtgui::TDesignerGuiCompBase)
├─ Edit contact details
├─ Phone, email, social media
├─ Multiple contact methods
└─ Validation and formatting
└─ CContactInfoViewDelegateComp - View delegate for contacts

Address Management:

CAddressEditorComp (iqtgui::TDesignerGuiCompBase)
├─ Street, city, postal code fields
├─ Country and region selection
├─ Address validation
└─ Google Maps integration

Server Configuration:

CServerConnectionEditorComp (iqtgui::TDesignerGuiCompBase)
├─ Edit server connection settings
├─ Host, port, protocol configuration
├─ SSL/TLS settings
└─ Connection testing

Administration Interfaces:

CAdministrationObserverQmlComp
├─ QML-based administration observer
├─ Real-time admin event monitoring
├─ User action notifications
└─ System status display

Usage Examples

Login Screen Setup

Standard Login Screen:**

// Create login GUI
auto loginGui = CStandardLoginGuiComp::CreateInstance();
// Configure login service
auto loginService = CLoginServiceComp::CreateInstance();
loginGui->SetAttribute("Login", loginService.get());
// Configure superuser provider
auto superuserProvider = CSuperuserProviderComp::CreateInstance();
loginGui->SetAttribute("SuperuserProvider", superuserProvider.get());
// Configure connection status provider
auto connectionStatus = CConnectionStatusProviderComp::CreateInstance();
loginGui->SetAttribute("ConnectionStatusProvider", connectionStatus.get());
// Show login window
loginGui->Show();
// Connect to login success signal
connect(loginGui, &CStandardLoginGuiComp::LoginSuccessful,
this, &MyApp::OnLoginSuccess);

Remote Login

Remote Login with GraphQL:**

// Create remote login GUI
auto loginGui = CRemoteStandardLoginGuiComp::CreateInstance();
// Configure server connection
auto serverConnection = CServerConnectionInterfaceParamComp::CreateInstance();
serverConnection->SetHost("auth.example.com");
serverConnection->SetHttpPort(443);
serverConnection->SetConnectionFlags(
loginGui->SetAttribute("ServerConnection", serverConnection.get());
// Configure remote login service
auto remoteLogin = CRemoteLoginServiceComp::CreateInstance();
loginGui->SetAttribute("Login", remoteLogin.get());
// Show login window
loginGui->Show();
@ CF_SECURE
Secure connection with SSL/TLS encryption (HTTPS, WSS)

Account Editor Dialog

Edit User Account:**

// Create account editor
auto accountEditor = CAccountInfoEditorComp::CreateInstance();
// Load user account
auto userCollection = GetUserCollection();
auto userId = GetCurrentUserId();
auto userInfo = userCollection->GetObject(userId);
// Set account for editing
accountEditor->SetAccountInfo(userInfo.get());
// Show editor dialog
if (accountEditor->ShowDialog() == QDialog::Accepted) {
// User clicked OK - save changes
userCollection->UpdateObject(userInfo.get());
qDebug() << "Account updated successfully";
}

Contact Editor

Edit Contact Information:**

// Create contact editor
auto contactEditor = CContactInfoEditorComp::CreateInstance();
// Load contact info
auto contactInfo = userInfo->GetContactInfo();
contactEditor->SetContactInfo(contactInfo.get());
// Configure supported contact methods
contactEditor->EnableEmailEditing(true);
contactEditor->EnablePhoneEditing(true);
contactEditor->EnableSocialMediaEditing(true);
// Show editor
if (contactEditor->ShowDialog() == QDialog::Accepted) {
// Save contact changes
userInfo->SetContactInfo(contactInfo.get());
SaveUserInfo(userInfo.get());
}

Address Editor

Edit User Address:**

// Create address editor
auto addressEditor = CAddressEditorComp::CreateInstance();
// Load address
auto address = userInfo->GetAddress();
addressEditor->SetAddress(address.get());
// Configure address validation
addressEditor->EnablePostalCodeValidation(true);
addressEditor->EnableCountrySelection(true);
// Show editor
if (addressEditor->ShowDialog() == QDialog::Accepted) {
// Save address changes
userInfo->SetAddress(address.get());
SaveUserInfo(userInfo.get());
}

Server Configuration Dialog

Configure Server Connection:**

// Create server connection editor
auto serverEditor = CServerConnectionEditorComp::CreateInstance();
// Load current connection settings
auto serverConnection = LoadServerConnectionSettings();
serverEditor->SetServerConnection(serverConnection.get());
// Show configuration dialog
if (serverEditor->ShowDialog() == QDialog::Accepted) {
// Test connection
if (serverEditor->TestConnection()) {
// Save new settings
SaveServerConnectionSettings(serverConnection.get());
qDebug() << "Server connection configured successfully";
} else {
QMessageBox::warning(nullptr, "Connection Failed",
"Failed to connect to server with provided settings");
}
}

Account Menu Widget

User Account Menu:**

// Create account menu widget
auto accountMenu = CStandardAccountMenuComp::CreateInstance();
// Configure current user
auto currentUser = GetCurrentUserInfo();
accountMenu->SetUserInfo(currentUser.get());
// Add to toolbar or menu bar
ui->toolBar->addWidget(accountMenu->GetWidget());
// Connect to menu actions
connect(accountMenu, &CStandardAccountMenuComp::EditProfileRequested,
this, &MyApp::OnEditProfile);
connect(accountMenu, &CStandardAccountMenuComp::LogoutRequested,
this, &MyApp::OnLogout);
connect(accountMenu, &CStandardAccountMenuComp::SettingsRequested,
this, &MyApp::OnShowSettings);

Integration Patterns

MVC Integration

Pattern: User Management UI:**

class CUserManagementWidgetComp : public ACF_COMPONENT(IUserManagementWidget)
{
// Model
I_REFERENCE(IObjectCollection, m_userCollection)
// View components
QTableView* m_usersTable;
QPushButton* m_addButton;
QPushButton* m_editButton;
QPushButton* m_deleteButton;
// Editors
IAccountInfoEditorComp* m_accountEditor;
public:
void InitializeUI()
{
// Setup table view
m_usersTable = new QTableView();
// Create model from collection
auto model = new QStandardItemModel();
LoadUsersIntoModel(model);
m_usersTable->setModel(model);
// Setup buttons
m_addButton = new QPushButton("Add User");
m_editButton = new QPushButton("Edit User");
m_deleteButton = new QPushButton("Delete User");
// Connect signals
connect(m_addButton, &QPushButton::clicked,
this, &CUserManagementWidgetComp::OnAddUser);
connect(m_editButton, &QPushButton::clicked,
this, &CUserManagementWidgetComp::OnEditUser);
connect(m_deleteButton, &QPushButton::clicked,
this, &CUserManagementWidgetComp::OnDeleteUser);
// Create account editor
m_accountEditor = CAccountInfoEditorComp::CreateInstance();
}
void OnAddUser()
{
// Create new user
auto newUser = CUserInfo::CreateInstance();
// Show editor for new user
m_accountEditor->SetAccountInfo(newUser.get());
if (m_accountEditor->ShowDialog() == QDialog::Accepted) {
// Add to collection
m_userCollection->AddObject(newUser.get());
// Refresh view
RefreshUsersTable();
}
}
void OnEditUser()
{
// Get selected user
QModelIndex index = m_usersTable->currentIndex();
if (!index.isValid()) return;
QByteArray userId = GetUserIdFromIndex(index);
auto userInfo = m_userCollection->GetObject(userId);
// Show editor
m_accountEditor->SetAccountInfo(userInfo.get());
if (m_accountEditor->ShowDialog() == QDialog::Accepted) {
// Update collection
m_userCollection->UpdateObject(userInfo.get());
// Refresh view
RefreshUsersTable();
}
}
void OnDeleteUser()
{
// Confirm deletion
auto reply = QMessageBox::question(nullptr, "Confirm Delete",
"Are you sure you want to delete this user?",
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) {
QModelIndex index = m_usersTable->currentIndex();
QByteArray userId = GetUserIdFromIndex(index);
// Delete from collection
m_userCollection->DeleteObject(userId);
// Refresh view
RefreshUsersTable();
}
}
};

QML Integration

Pattern: QML Administration Observer:**

// Create QML administration observer
auto adminObserver = CAdministrationObserverQmlComp::CreateInstance();
// Configure user collection for monitoring
adminObserver->SetAttribute("UserCollection", userCollection.get());
// Register with QML engine
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("adminObserver",
adminObserver->GetQmlObject());
// Load QML file
engine.load(QUrl("qrc:/qml/AdministrationPanel.qml"));

QML Usage:**

// AdministrationPanel.qml
import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
ListView {
model: adminObserver.userListModel
delegate: ItemDelegate {
text: model.userName
onClicked: adminObserver.selectUser(model.userId)
}
}
Connections {
target: adminObserver
function onUserAdded(userId, userName) {
console.log("User added:", userName)
}
function onUserModified(userId, userName) {
console.log("User modified:", userName)
}
function onUserDeleted(userId) {
console.log("User deleted:", userId)
}
}
}

Best Practices

Input Validation

Security in UI

User Experience

Integration with Other Modules

With imtauth (Core Authentication):

With imtauthgql (GraphQL API):

With imtcom (Server Communication):

With imtgui (Core GUI):

References

Related Modules:

ACF Interfaces:

External Documentation: