clean up
This commit is contained in:
parent
333659404a
commit
c3af2de74e
|
@ -90,12 +90,12 @@ namespace
|
||||||
}
|
}
|
||||||
case FileDialog:
|
case FileDialog:
|
||||||
{
|
{
|
||||||
auto file = qskDialog->selectFile( "select file", QDir::currentPath() );
|
qskDialog->selectFile( "select file", QDir::currentPath() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FolderDialog:
|
case FolderDialog:
|
||||||
{
|
{
|
||||||
auto file = qskDialog->selectDirectory( "select directory", QDir::currentPath() );
|
qskDialog->selectDirectory( "select directory", QDir::currentPath() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FontDialog:
|
case FontDialog:
|
||||||
|
@ -105,8 +105,7 @@ namespace
|
||||||
}
|
}
|
||||||
case MessageDialog:
|
case MessageDialog:
|
||||||
{
|
{
|
||||||
auto action = qskDialog->message( "message", "The quick brown fox jumps over the lazy dog" );
|
qskDialog->message( "message", "The quick brown fox jumps over the lazy dog" );
|
||||||
qDebug() << "got message action" << action;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -37,8 +37,8 @@ class QskColorPicker : public QskBoundedControl
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void valueChanged( qreal );
|
void valueChanged( qreal );
|
||||||
void selectedColorChanged() const;
|
void selectedColorChanged();
|
||||||
void positionChanged() const;
|
void positionChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updateLayout() override;
|
void updateLayout() override;
|
||||||
|
|
|
@ -18,10 +18,6 @@ namespace
|
||||||
class ColorPaneNode : public QskPaintedNode
|
class ColorPaneNode : public QskPaintedNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColorPaneNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void paint( QPainter* p, const QSize& size, const void* nodeData ) override
|
void paint( QPainter* p, const QSize& size, const void* nodeData ) override
|
||||||
{
|
{
|
||||||
const Q* q = static_cast< const Q* >( nodeData );
|
const Q* q = static_cast< const Q* >( nodeData );
|
||||||
|
|
|
@ -32,15 +32,13 @@ class QskColorPickerSkinlet : public QskSkinlet
|
||||||
QRectF subControlRect( const QskSkinnable*,
|
QRectF subControlRect( const QskSkinnable*,
|
||||||
const QRectF&, QskAspect::Subcontrol ) const override;
|
const QRectF&, QskAspect::Subcontrol ) const override;
|
||||||
|
|
||||||
QColor selectedColor() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QSGNode* updateSubNode( const QskSkinnable*,
|
QSGNode* updateSubNode( const QskSkinnable*,
|
||||||
quint8 nodeRole, QSGNode* ) const override;
|
quint8 nodeRole, QSGNode* ) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
QSGNode* updateColorPaneNode( const QskColorPicker*, QSGNode* ) const;
|
QSGNode* updateColorPaneNode( const QskColorPicker*, QSGNode* ) const;
|
||||||
|
|
||||||
private:
|
|
||||||
QRectF cursorRect( const QskSkinnable*, const QRectF&, int index ) const;
|
QRectF cursorRect( const QskSkinnable*, const QRectF&, int index ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,22 +12,15 @@
|
||||||
#include "QskSelectionSubWindow.h"
|
#include "QskSelectionSubWindow.h"
|
||||||
#include "QskSelectionWindow.h"
|
#include "QskSelectionWindow.h"
|
||||||
|
|
||||||
#include "QskBoxBorderColors.h"
|
|
||||||
#include "QskBoxBorderMetrics.h"
|
|
||||||
#include "QskColorSelectionWindow.h"
|
#include "QskColorSelectionWindow.h"
|
||||||
#include "QskFileSelectionWindow.h"
|
#include "QskFileSelectionWindow.h"
|
||||||
#include "QskFontSelectionWindow.h"
|
#include "QskFontSelectionWindow.h"
|
||||||
#include "QskEvent.h"
|
|
||||||
#include "QskFunctions.h"
|
|
||||||
|
|
||||||
#include "QskFocusIndicator.h"
|
#include "QskFocusIndicator.h"
|
||||||
|
|
||||||
#include <qfontmetrics.h>
|
|
||||||
#include <qfilesystemmodel.h>
|
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
#include <qpointer.h>
|
#include <qpointer.h>
|
||||||
#include <qquickwindow.h>
|
#include <qquickwindow.h>
|
||||||
#include <qtimer.h>
|
|
||||||
|
|
||||||
#include <qpa/qplatformdialoghelper.h>
|
#include <qpa/qplatformdialoghelper.h>
|
||||||
|
|
||||||
|
@ -65,10 +58,6 @@ static QskDialog::DialogCode qskExec( QskDialogWindow* dialogWindow )
|
||||||
return dialogWindow->exec();
|
return dialogWindow->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static QQuickWindow* qskSomeQuickWindow()
|
static QQuickWindow* qskSomeQuickWindow()
|
||||||
{
|
{
|
||||||
// not the best code ever, but as it is a fallback only
|
// not the best code ever, but as it is a fallback only
|
||||||
|
@ -123,7 +112,6 @@ static void qskSetupWindow(
|
||||||
window->setModality( transientParent ? Qt::WindowModal : Qt::ApplicationModal );
|
window->setModality( transientParent ? Qt::WindowModal : Qt::ApplicationModal );
|
||||||
|
|
||||||
const QSize size = window->sizeConstraint();
|
const QSize size = window->sizeConstraint();
|
||||||
qDebug() << "sc:" << size;
|
|
||||||
|
|
||||||
if ( window->parent() )
|
if ( window->parent() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include "QskGlobal.h"
|
#include "QskGlobal.h"
|
||||||
|
|
||||||
#include <qrgb.h>
|
#include <qcolor.h>
|
||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ QskFontSelectionWindow< W >::QskFontSelectionWindow( QObject* parent, const QStr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setupControls( outerBox );
|
setupControls( outerBox );
|
||||||
loadFontInfo();
|
connectSignals();
|
||||||
|
|
||||||
Inherited::setContentItem( outerBox );
|
Inherited::setContentItem( outerBox );
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ void QskFontSelectionWindow< W >::setupControls( QQuickItem* parentItem )
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename W >
|
template< typename W >
|
||||||
void QskFontSelectionWindow< W >::loadFontInfo()
|
void QskFontSelectionWindow< W >::connectSignals()
|
||||||
{
|
{
|
||||||
const auto families = QFontDatabase::families();
|
const auto families = QFontDatabase::families();
|
||||||
m_data->familyView->setEntries( families );
|
m_data->familyView->setEntries( families );
|
||||||
|
|
|
@ -23,7 +23,7 @@ class QskFontSelectionWindow : public QskWindowOrSubWindow< W >
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupControls( QQuickItem* );
|
void setupControls( QQuickItem* );
|
||||||
void loadFontInfo();
|
void connectSignals();
|
||||||
|
|
||||||
class PrivateData;
|
class PrivateData;
|
||||||
std::unique_ptr< PrivateData > m_data;
|
std::unique_ptr< PrivateData > m_data;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "QskDialogButtonBox.h"
|
#include "QskDialogButtonBox.h"
|
||||||
#include "QskFocusIndicator.h"
|
#include "QskFocusIndicator.h"
|
||||||
|
|
||||||
|
// copied from QskDialog.cpp:
|
||||||
static QskDialog::Action qskActionCandidate( const QskDialogButtonBox* buttonBox )
|
static QskDialog::Action qskActionCandidate( const QskDialogButtonBox* buttonBox )
|
||||||
{
|
{
|
||||||
// not the fastest code ever, but usually we always
|
// not the fastest code ever, but usually we always
|
||||||
|
|
Loading…
Reference in New Issue