fix failed assertions in wxqt from newer wx library code
This commit is contained in:
committed by
Vadim Zeitlin
parent
4e1ddab3ad
commit
8be71bd900
@@ -74,7 +74,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name )
|
const wxString& name )
|
||||||
{
|
{
|
||||||
return Create( parent, id, pos, size, choices.size(), &choices[ 0 ], style,
|
return Create( parent, id, pos, size, choices.size(), choices.size() ? &choices[ 0 ] : NULL, style,
|
||||||
validator, name );
|
validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#include "wx/qt/private/converter.h"
|
#include "wx/qt/private/converter.h"
|
||||||
#include "wx/qt/private/utils.h"
|
#include "wx/qt/private/utils.h"
|
||||||
|
|
||||||
|
#include <QtGui/QScreen>
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
static void SetPenColour( QPainter *qtPainter, QColor col )
|
static void SetPenColour( QPainter *qtPainter, QColor col )
|
||||||
{
|
{
|
||||||
@@ -124,7 +126,10 @@ int wxQtDCImpl::GetDepth() const
|
|||||||
|
|
||||||
wxSize wxQtDCImpl::GetPPI() const
|
wxSize wxQtDCImpl::GetPPI() const
|
||||||
{
|
{
|
||||||
return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY());
|
QScreen *srn = QApplication::screens().at(0);
|
||||||
|
qreal dotsPerInch = (qreal)srn->logicalDotsPerInch();
|
||||||
|
return wxSize(round(dotsPerInch), round(dotsPerInch));
|
||||||
|
// return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxQtDCImpl::SetFont(const wxFont& font)
|
void wxQtDCImpl::SetFont(const wxFont& font)
|
||||||
|
@@ -115,7 +115,9 @@ int wxQtEventLoopBase::DispatchTimeout(unsigned long timeout)
|
|||||||
|
|
||||||
void wxQtEventLoopBase::WakeUp()
|
void wxQtEventLoopBase::WakeUp()
|
||||||
{
|
{
|
||||||
QAbstractEventDispatcher::instance()->wakeUp();
|
QAbstractEventDispatcher *instance = QAbstractEventDispatcher::instance();
|
||||||
|
if(instance)
|
||||||
|
instance->wakeUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxQtEventLoopBase::DoYieldFor(long eventsToProcess)
|
void wxQtEventLoopBase::DoYieldFor(long eventsToProcess)
|
||||||
|
@@ -562,9 +562,8 @@ void wxWindowQt::SetScrollbar( int orientation, int pos, int thumbvisible, int r
|
|||||||
void wxWindowQt::SetScrollPos( int orientation, int pos, bool WXUNUSED( refresh ))
|
void wxWindowQt::SetScrollPos( int orientation, int pos, bool WXUNUSED( refresh ))
|
||||||
{
|
{
|
||||||
wxScrollBar *scrollBar = QtGetScrollBar( orientation );
|
wxScrollBar *scrollBar = QtGetScrollBar( orientation );
|
||||||
wxCHECK_RET( scrollBar, "Invalid scrollbar" );
|
if(scrollBar)
|
||||||
|
scrollBar->SetThumbPosition( pos );
|
||||||
scrollBar->SetThumbPosition( pos );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxWindowQt::GetScrollPos( int orientation ) const
|
int wxWindowQt::GetScrollPos( int orientation ) const
|
||||||
|
Reference in New Issue
Block a user