Files
xtree/src/application/xqmainwindow.h

90 lines
2.1 KiB
C
Raw Normal View History

2025-08-22 22:57:06 +02:00
/***************************************************************************
source::worx xtree
Copyright © 2024-2025 c.holzheuer
christoph.holzheuer@gmail.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***************************************************************************/
#ifndef XQMAINWINDOW_H
#define XQMAINWINDOW_H
#include <QMainWindow>
#include <ui_xqmainwindow.h>
#include <xqdocumentstore.h>
#include <xqmainmodel.h>
#include <xqchildmodel.h>
#include <xqappdata.h>
class XQMainWindow : public QMainWindow, public Ui_XQMainWindow
{
Q_OBJECT
public:
XQMainWindow( QWidget* parent = nullptr );
virtual ~XQMainWindow() = default;
void initMainWindow();
public slots:
2025-09-02 16:58:56 +02:00
virtual void onMyFirz(XQItem& item)
{
qDebug() << " --- myFirz: " << item.text();
}
2025-08-22 22:57:06 +02:00
void onUndo();
void onRedo();
void onCreateDocument();
void onOpenDocument();
void onSaveDocument();
void onSaveDocumentAs();
void onCloseDocument();
void onAbout();
void onExit();
void onTreeViewItemClicked( const XQItem& item );
2025-09-03 17:23:52 +02:00
void onTreeViewItemChanged( const XQItem& item );
void onChildViewTabClicked( int index );
2025-08-22 22:57:06 +02:00
//void onItemCreated( XQItem* item );
void onSectionCreated( const XQModelSection& section);
void onSectionToggled( const XQModelSection& section );
void setChildTabByName( const QString& key );
2025-09-15 16:37:35 +02:00
// fixme implement
//void showDocument( const QString& key ){}
void loadDocument( const QString& fileName, bool useQML=false );
void loadDocumentQML( const QString& fileName );
void saveDocument( const QString& fileName );
2025-08-26 17:45:06 +02:00
static void setupWorkingDir();
2025-08-22 22:57:06 +02:00
2025-09-15 16:37:35 +02:00
2025-08-22 22:57:06 +02:00
protected:
2025-09-15 16:37:35 +02:00
XQNodePtr createDataTree( const QString& fileName );
XQChildModel* createChildModel( const XQNodePtr& contentRoot );
2025-08-22 22:57:06 +02:00
QUndoStack _undoStack;
XQDocumentStore _documentStore;
2025-09-02 16:58:56 +02:00
XQMainModel _mainModel;
2025-08-22 22:57:06 +02:00
XQItem* _currentProjectItem{};
//XQChildModel* _currentChildModel{};
2025-08-22 22:57:06 +02:00
};
#endif // XQMAINWINDOW_H