Permalink
Browse files

Enabling multi-touch on Qt widgets (for multi-touch screens)

  • Loading branch information...
scazan committed Jun 11, 2015
1 parent f504490 commit 5e4d18cf199e1e8be971e250e7acc787b2d44af6
@@ -28,6 +28,7 @@ QcButton::QcButton():
QtCollider::Style::Client(this),
currentState(0)
{
setAttribute(Qt::WA_AcceptTouchEvents);
connect( this, SIGNAL(clicked()), this, SLOT(doAction()) );
}
@@ -76,6 +76,7 @@ QcGraph::QcGraph() :
setFocusPolicy( Qt::StrongFocus );
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
setAttribute(Qt::WA_AcceptTouchEvents);
connect( &_model, SIGNAL(removed(QcGraphElement*)), this, SLOT(onElementRemoved(QcGraphElement*)) );
}
@@ -39,6 +39,7 @@ QcKnob::QcKnob() :
{
setFocusPolicy( Qt::StrongFocus );
setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
setAttribute(Qt::WA_AcceptTouchEvents);
}
void QcKnob::setValue( double val )
@@ -49,6 +49,8 @@ QcMultiSlider::QcMultiSlider() :
{
setFocusPolicy( Qt::StrongFocus );
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
setAttribute(Qt::WA_AcceptTouchEvents);
connect( this, SIGNAL(modified()), this, SLOT(update()) );
connect( this, SIGNAL(interacted()), this, SLOT(doAction()) );
}
@@ -56,6 +56,8 @@ QcNumberBox::QcNumberBox()
setLocked( true );
setAttribute(Qt::WA_AcceptTouchEvents);
connect( this, SIGNAL( editingFinished() ),
this, SLOT( onEditingFinished() ) );
connect( this, SIGNAL( valueChanged() ),
@@ -41,6 +41,7 @@ QcRangeSlider::QcRangeSlider() :
{
setFocusPolicy( Qt::StrongFocus );
setOrientation( Qt::Vertical );
setAttribute(Qt::WA_AcceptTouchEvents);
}
void QcRangeSlider::setOrientation( Qt::Orientation o )
@@ -43,6 +43,7 @@ QC_DECLARE_FACTORY( QcScrollWidget, QcScrollWidgetFactory );
QcScrollWidget::QcScrollWidget( QWidget *parent ) : QcCanvas( parent )
{
setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
setAttribute(Qt::WA_AcceptTouchEvents);
}
QSize QcScrollWidget::sizeHint() const
@@ -36,6 +36,7 @@ QcSlider::QcSlider() :
{
setFocusPolicy( Qt::StrongFocus );
setOrientation( Qt::Vertical );
setAttribute(Qt::WA_AcceptTouchEvents);
}
double QcSlider::pixelStep()
@@ -39,6 +39,7 @@ QcSlider2D::QcSlider2D() :
{
setFocusPolicy( Qt::StrongFocus );
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
setAttribute(Qt::WA_AcceptTouchEvents);
}
void QcSlider2D::incrementX( double factor )
@@ -40,6 +40,8 @@ QC_DECLARE_FACTORY( QcTextEdit, QcTextEditFactory );
QcTextEdit::QcTextEdit() : _interpretSelection(true)
{
setAttribute(Qt::WA_AcceptTouchEvents);
connect( this, SIGNAL(interpret(QString)),
qApp, SLOT(interpret(QString)),
Qt::QueuedConnection );
@@ -37,6 +37,8 @@ QC_DECLARE_FACTORY( QcTreeWidget, QcTreeWidgetFactory );
QcTreeWidget::QcTreeWidget()
{
setAttribute(Qt::WA_AcceptTouchEvents);
// Forward signals to argument-less versions connectable from SC.
connect( this, SIGNAL( itemActivated(QTreeWidgetItem*, int) ),
this, SIGNAL( action() ) );
@@ -49,6 +49,8 @@ WebView::WebView( QWidget *parent ) :
// get in the way of rendering web pages
setPalette( style()->standardPalette() );
setAttribute(Qt::WA_AcceptTouchEvents);
page->action( QWebPage::Copy )->setShortcut( QKeySequence::Copy );
page->action( QWebPage::Paste )->setShortcut( QKeySequence::Paste );

0 comments on commit 5e4d18c

Please sign in to comment.