#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
-#include <QWebView>
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ #include <QWebView>
+#else
+ #include <QWebEngineView>
+#endif
#include <QProcess>
+// RNV:
+// Since from Qt 5.6.0 version QtWebKit tool was removed,
+// QtxWebBroswer is ported on QtWebEngine. So if it is built with Qt-5.6.0
+// and newer, it uses QtWebEngine. But for Qt-5.5.1 and Qt4 QtWebKit tool
+// is used, to provide backward compatibility.
+
namespace
{
bool isLocalFile( const QUrl& url )
class QtxWebBrowser::Searcher : public QtxSearchTool::Searcher
{
public:
- Searcher( QWebView* );
+ Searcher( WebView* );
~Searcher();
bool find( const QString&, QtxSearchTool* );
bool findLast( const QString&, QtxSearchTool* );
private:
- QWebView* myView;
+ WebView* myView;
};
/*!
\param view web view
\internal
*/
-QtxWebBrowser::Searcher::Searcher( QWebView* view ) : myView( view )
+QtxWebBrowser::Searcher::Searcher( WebView* view ) : myView( view )
{
}
*/
bool QtxWebBrowser::Searcher::find( const QString& text, QtxSearchTool* st )
{
- QWebPage::FindFlags fl = 0;
- if ( st->isCaseSensitive() ) fl = fl | QWebPage::FindCaseSensitively;
- if ( st->isSearchWrapped() ) fl = fl | QWebPage::FindWrapsAroundDocument;
+ WebPage::FindFlags fl = 0;
+ if ( st->isCaseSensitive() ) fl = fl | WebPage::FindCaseSensitively;
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ if ( st->isSearchWrapped() ) fl = fl | WebPage::FindWrapsAroundDocument;
return myView->findText( text, fl );
+#else
+ myView->findText( text, fl, [this](bool found) { return found; });
+#endif
}
/*!
*/
bool QtxWebBrowser::Searcher::findPrevious( const QString& text, QtxSearchTool* st )
{
- QWebPage::FindFlags fl = QWebPage::FindBackward;
- if ( st->isCaseSensitive() ) fl = fl | QWebPage::FindCaseSensitively;
- if ( st->isSearchWrapped() ) fl = fl | QWebPage::FindWrapsAroundDocument;
+ WebPage::FindFlags fl = WebPage::FindBackward;
+ if ( st->isCaseSensitive() ) fl = fl | WebPage::FindCaseSensitively;
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ if ( st->isSearchWrapped() ) fl = fl | WebPage::FindWrapsAroundDocument;
return myView->findText( text, fl );
+#else
+ myView->findText( text, fl, [this](bool found) { return found; });
+#endif
}
/*!
QWidget* frame = new QWidget( this );
- myWebView = new QWebView( frame );
-
- myWebView->pageAction( QWebPage::Copy )->setShortcut( QKeySequence::Copy );
- myWebView->addAction( myWebView->pageAction( QWebPage::Copy ) );
- myWebView->pageAction( QWebPage::OpenLinkInNewWindow )->setVisible( false );
- myWebView->pageAction( QWebPage::Back )->setText( tr( "Go Back" ) );
- myWebView->pageAction( QWebPage::Forward )->setText( tr( "Go Forward" ) );
- myWebView->pageAction( QWebPage::Reload )->setText( tr( "Refresh" ) );
-
- myWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
-
+ myWebView = new WebView( frame );
+
+ myWebView->pageAction( WebPage::Copy )->setShortcut( QKeySequence::Copy );
+ myWebView->addAction( myWebView->pageAction( WebPage::Copy ) );
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
+ myWebView->pageAction( WebPage::OpenLinkInNewWindow )->setVisible( false );
+#endif
+ myWebView->pageAction( WebPage::Back )->setText( tr( "Go Back" ) );
+ myWebView->pageAction( WebPage::Forward )->setText( tr( "Go Forward" ) );
+ myWebView->pageAction( WebPage::Reload )->setText( tr( "Refresh" ) );
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ myWebView->page()->setLinkDelegationPolicy( WebPage::DelegateAllLinks );
+#endif
+
myFindPanel = new QtxSearchTool( frame, myWebView,
- QtxSearchTool::Basic | QtxSearchTool::Case | QtxSearchTool::Wrap,
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ QtxSearchTool::Basic | QtxSearchTool::Case | QtxSearchTool::Wrap,
+#else
+ QtxSearchTool::Basic | QtxSearchTool::Case,
+#endif
Qt::Horizontal );
myFindPanel->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
myFindPanel->setActivators( QtxSearchTool::SlashKey );
myFindPanel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
QToolBar* toolbar = addToolBar( tr( "Navigation" ) );
- toolbar->addAction( myWebView->pageAction( QWebPage::Back ) );
- toolbar->addAction( myWebView->pageAction( QWebPage::Forward ) );
- toolbar->addAction( myWebView->pageAction( QWebPage::Reload ) );
+ toolbar->addAction( myWebView->pageAction( WebPage::Back ) );
+ toolbar->addAction( myWebView->pageAction( WebPage::Forward ) );
+ toolbar->addAction( myWebView->pageAction( WebPage::Reload ) );
QMenu* fileMenu = menuBar()->addMenu( tr( "&File" ) );
fileMenu->addAction( QPixmap( ":/images/open.png" ), tr( "&Open..." ),
this, SLOT( open() ),
QKeySequence( QKeySequence::Open ) );
fileMenu->addSeparator();
- fileMenu->addAction( myWebView->pageAction( QWebPage::Back ) );
- fileMenu->addAction( myWebView->pageAction( QWebPage::Forward ) );
- fileMenu->addAction( myWebView->pageAction( QWebPage::Reload ) );
+ fileMenu->addAction( myWebView->pageAction( WebPage::Back ) );
+ fileMenu->addAction( myWebView->pageAction( WebPage::Forward ) );
+ fileMenu->addAction( myWebView->pageAction( WebPage::Reload ) );
fileMenu->addSeparator();
fileMenu->addAction( tr( "&Find in text..." ),
myFindPanel, SLOT( find() ),
main->setSpacing( 3 );
connect( myWebView, SIGNAL( titleChanged( QString ) ), SLOT( adjustTitle() ) );
- connect( myWebView, SIGNAL( loadFinished( bool ) ), SLOT( finished( bool ) ) );
- connect( myWebView, SIGNAL( linkClicked( QUrl ) ), SLOT( linkClicked( QUrl ) ) );
+ connect( myWebView, SIGNAL( loadFinished( bool ) ), SLOT( finished( bool ) ) );
+
+ connect( myWebView->pageAction( WebPage::DownloadLinkToDisk ), SIGNAL( triggered() ),
+ SLOT( linkAction() ) );
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ //QtWebKit case:
+ connect( myWebView, SIGNAL( linkClicked( QUrl ) ), SLOT( linkClicked( QUrl ) ) );
connect( myWebView->page(), SIGNAL( linkHovered( QString, QString, QString ) ),
SLOT( linkHovered( QString, QString, QString ) ) );
- connect( myWebView->pageAction( QWebPage::DownloadLinkToDisk ), SIGNAL( triggered() ),
+ disconnect( myWebView->pageAction( WebPage::OpenLink ), 0, 0, 0 );
+ connect( myWebView->pageAction( WebPage::OpenLink ), SIGNAL( triggered() ),
SLOT( linkAction() ) );
- disconnect( myWebView->pageAction( QWebPage::OpenLink ), 0, 0, 0 );
- connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( triggered() ),
+#else
+ //QtWebEngine (Qt-5.6.0) case:
+ connect( myWebView->page(), SIGNAL( linkHovered( QString ) ),
+ SLOT( linkHovered( QString ) ) );
+ disconnect( myWebView->pageAction( WebPage::OpenLinkInThisWindow ), 0, 0, 0 );
+ connect( myWebView->pageAction( WebPage::OpenLinkInThisWindow ), SIGNAL( triggered() ),
SLOT( linkAction() ) );
-
+#endif
setCentralWidget( frame );
setFocusProxy( myWebView );
setWindowIcon( QPixmap( ":/images/appicon.png" ) );
*/
void QtxWebBrowser::linkClicked( const QUrl& url )
{
- myWebView->page()->setLinkDelegationPolicy( QWebPage::DontDelegateLinks );
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ myWebView->page()->setLinkDelegationPolicy( WebPage::DontDelegateLinks );
+#endif
myWebView->load( url );
- myWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ myWebView->page()->setLinkDelegationPolicy( WebPage::DelegateAllLinks );
+#endif
}
/*!
\param content provides text within the link element, e.g., text inside an HTML anchor tag
\internal
*/
+
void QtxWebBrowser::linkHovered( const QString& link, const QString& /*title*/, const QString& /*context*/ )
+{
+ linkHovered(link);
+}
+
+void QtxWebBrowser::linkHovered( const QString& link)
{
QUrl url = link;
if ( !link.isEmpty() && isLocalFile( url ) ) myLastUrl = url;
- statusBar()->showMessage( link );
+ statusBar()->showMessage( link );
}
/*!
void QtxWebBrowser::linkAction()
{
QObject* s = sender();
- if ( s == myWebView->pageAction( QWebPage::DownloadLinkToDisk ) ) {
+ if ( s == myWebView->pageAction( WebPage::DownloadLinkToDisk ) ) {
saveLink( myLastUrl.path() );
}
- else if ( s == myWebView->pageAction( QWebPage::OpenLink ) ) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
+ if ( s == myWebView->pageAction( WebPage::OpenLink ) ) {
+#else
+ if ( s == myWebView->pageAction( WebPage::OpenLinkInThisWindow ) ) {
+#endif
QString fileName = myLastUrl.path();
QString extension = QFileInfo( fileName ).suffix();
if ( extension != "html" && extension != "htm" ) {
Use Style_Salome::apply() static function to set SALOME style to the application.
*/
-Style_Salome::Style_Salome()
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- : QWindowsStyle()
-#else
- : QCommonStyle()
-#endif
+Style_Salome::Style_Salome() : BaseStyle()
{
// initialize SALOME style resources
Q_INIT_RESOURCE( Style );
*/
void Style_Salome::polish ( QApplication* app )
{
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::polish( app );
-#else
- QCommonStyle::polish( app );
-#endif
-
+ BaseStyle::polish( app );
+
if ( checkDebugLevel(1) ) {
return;
}
void Style_Salome::polish ( QWidget* w )
{
if ( checkDebugLevel(2) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::polish( w );
-#else
- QCommonStyle::polish( w );
-#endif
+ BaseStyle::polish( w );
return;
}
qobject_cast<QMenuBar*>(w) || qobject_cast<QDockWidget*>(w) )
w->setAttribute( Qt::WA_Hover );
}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::polish( w );
-#else
- QCommonStyle::polish( w );
-#endif
+ BaseStyle::polish( w );
}
/*!
void Style_Salome::unpolish( QWidget* w )
{
if ( checkDebugLevel(3) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::unpolish( w );
-#else
- QCommonStyle::unpolish( w );
-#endif
+ BaseStyle::unpolish( w );
return;
}
qobject_cast<QMenuBar*>(w) || qobject_cast<QDockWidget*>(w) )
w->setAttribute( Qt::WA_Hover, false );
}
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::unpolish( w );
-#else
- QCommonStyle::unpolish( w );
-#endif
+ BaseStyle::unpolish( w );
}
/*!
QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(4) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
-#else
- QCommonStyle::drawComplexControl( cc, opt, p, w );
-#endif
+ BaseStyle::drawComplexControl( cc, opt, p, w );
return;
}
if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
QStyleOptionSlider tmpSlider = *slider;
tmpSlider.subControls = SC_SliderGroove;
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl(cc, &tmpSlider, p, w);
-#else
- QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w);
-#endif
+ BaseStyle::drawComplexControl(cc, &tmpSlider, p, w);
}
if (slider->subControls & SC_SliderTickmarks) {
QStyleOptionSlider tmpSlider = *slider;
if (w && ( qobject_cast<QToolBar *>(w->parentWidget() ) ||
( toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) )
) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
-#else
- QCommonStyle::drawComplexControl( cc, opt, p, w );
-#endif
+ BaseStyle::drawComplexControl( cc, opt, p, w );
return;
}
int aMinDelta = (int)model()->widgetRounding( Style_Model::ButtonRadius );
}
}
case CC_TitleBar: {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
-#else
- QCommonStyle::drawComplexControl( cc, opt, p, w );
-#endif
+ BaseStyle::drawComplexControl( cc, opt, p, w );
break;
}
case CC_GroupBox:
break;
}
case CC_Dial: {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
-#else
- QCommonStyle::drawComplexControl( cc, opt, p, w );
-#endif
+ BaseStyle::drawComplexControl( cc, opt, p, w );
break;
}
default:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
-#else
- QCommonStyle::drawComplexControl( cc, opt, p, w );
-#endif
+ BaseStyle::drawComplexControl( cc, opt, p, w );
}
}
void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
QPainter* p, const QWidget* w ) const
{
- if ( checkDebugLevel(5) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawControl( ce, opt, p, w );
-#else
- QCommonStyle::drawControl( ce, opt, p, w );
-#endif
+ if ( checkDebugLevel(5) ) {
+ BaseStyle::drawControl( ce, opt, p, w );
return;
}
break;
}
case CE_Splitter: {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawControl( ce, opt, p, w );
-#else
- QCommonStyle::drawControl( ce, opt, p, w );
-#endif
+ BaseStyle::drawControl( ce, opt, p, w );
QRect r = opt->rect;
bool horiz = r.width() > r.height();
int aLen = model()->splitHandleLength();
}
QStyleOptionTab* copyTab = (QStyleOptionTab*)tab;
copyTab->rect = oldRect;
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawControl( ce, copyTab, p, w );
-#else
- QCommonStyle::drawControl( ce, copyTab, p, w );
-#endif
+ BaseStyle::drawControl( ce, copyTab, p, w );
}
else
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawControl( ce, opt, p, w );
-#else
- QCommonStyle::drawControl( ce, opt, p, w );
-#endif
+ BaseStyle::drawControl( ce, opt, p, w );
break;
}
case CE_MenuBarItem:
break;
}
default:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawControl( ce, opt, p, w );
-#else
- QCommonStyle::drawControl( ce, opt, p, w );
-#endif
+ BaseStyle::drawControl( ce, opt, p, w );
break;
}
}
QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(6) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
return;
}
break;
}
else
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
}
break;
case PE_FrameFocusRect: {
aBrdTopCol, aBrdBotCol, false, false, isHover, true );
}
else {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
}
break;
}
break;
}
case PE_Widget: {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
+
if ( !w )
break;
if( w->parent() && !qobject_cast<QMenuBar*>((QWidget*)w) )
= qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast &&
tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
break;
}
QRect aSelRect = tbb->selectedTabRect;
aPal.setBrush( QPalette::AlternateBase, QBrush( gr_alt ) );
aWdg->setPalette( aPal );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
break;
}
default:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
-#else
- QCommonStyle::drawPrimitive( pe, opt, p, w );
-#endif
+ BaseStyle::drawPrimitive( pe, opt, p, w );
}
}
const QWidget* w ) const
{
if ( checkDebugLevel(7) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::pixelMetric( metric, opt, w );
-#else
- return QCommonStyle::pixelMetric( metric, opt, w );
-#endif
+ return BaseStyle::pixelMetric( metric, opt, w );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- int aRes = QWindowsStyle::pixelMetric( metric, opt, w );
-#else
- int aRes = QCommonStyle::pixelMetric( metric, opt, w );
-#endif
+ int aRes = BaseStyle::pixelMetric( metric, opt, w );
switch( metric ) {
case PM_SliderLength: {
aRes += (int)((double)model()->sliderSize()/2);
const QSize& contentsSize, const QWidget* w ) const
{
if ( checkDebugLevel(8) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::sizeFromContents( ct, opt,contentsSize, w );
-#else
- return QCommonStyle::sizeFromContents( ct, opt,contentsSize, w );
-#endif
+ return BaseStyle::sizeFromContents( ct, opt,contentsSize, w );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QSize sz = QWindowsStyle::sizeFromContents( ct, opt, contentsSize, w );
-#else
- QSize sz = QCommonStyle::sizeFromContents( ct, opt, contentsSize, w );
-#endif
+ QSize sz = BaseStyle::sizeFromContents( ct, opt, contentsSize, w );
switch (ct) {
case CT_TabBarTab:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
QRect res = QRect( 0, 0, sz.width(), sz.height() );
int aHalfRect = (int)Style_Tools::getMaxRect( res,
(int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect old_arrow = QWindowsStyle::subControlRect( CC_ComboBox, cmb,
+
+ QRect old_arrow = BaseStyle::subControlRect( CC_ComboBox, cmb,
SC_ComboBoxArrow, w );
-#else
- QRect old_arrow = QCommonStyle::subControlRect( CC_ComboBox, cmb,
- SC_ComboBoxArrow, w );
-#endif
int aDelta = res.height() - old_arrow.width(); // right value
if ( cmb->editable )
aDelta += aHalfRect; // for right of line edit internal
const QWidget *w) const
{
if ( checkDebugLevel(9) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::standardPixmap( stPixmap, opt, w );
-#else
- return QCommonStyle::standardPixmap( stPixmap, opt, w );
-#endif
+ return BaseStyle::standardPixmap( stPixmap, opt, w );
}
switch ( stPixmap )
case SP_TitleBarMinButton:
return QPixmap( minimize_xpm );
default:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::standardPixmap( stPixmap, opt, w );
-#else
- return QCommonStyle::standardPixmap( stPixmap, opt, w );
-#endif
+ return BaseStyle::standardPixmap( stPixmap, opt, w );
}
}
{
if ( checkDebugLevel(10) ) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+ return BaseStyle::standardIconImplementation( standardIcon, opt, w );
#else
return QCommonStyle::standardIcon( standardIcon, opt, w );
#endif
break;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+ return BaseStyle::standardIconImplementation( standardIcon, opt, w );
#else
- return QCommonStyle::standardIcon( standardIcon, opt, w );
+ return BaseStyle::standardIcon( standardIcon, opt, w );
#endif
}
QStyleHintReturn* returnData ) const
{
if ( checkDebugLevel(11) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::styleHint( hint, opt, w, returnData );
-#else
- return QCommonStyle::styleHint( hint, opt, w, returnData );
-#endif
+ return BaseStyle::styleHint( hint, opt, w, returnData );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- int aRes = QWindowsStyle::styleHint( hint, opt, w, returnData );
-#else
- int aRes = QCommonStyle::styleHint( hint, opt, w, returnData );
-#endif
+ int aRes = BaseStyle::styleHint( hint, opt, w, returnData );
switch( hint ) {
case SH_Table_GridLineColor: {
if ( opt )
SubControl sc, const QWidget* wid ) const
{
if ( checkDebugLevel(12) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::subControlRect( cc, opt, sc, wid );
-#else
- return QCommonStyle::subControlRect( cc, opt, sc, wid );
-#endif
+ return BaseStyle::subControlRect( cc, opt, sc, wid );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect res = QWindowsStyle::subControlRect( cc, opt, sc, wid );
-#else
- QRect res = QCommonStyle::subControlRect( cc, opt, sc, wid );
-#endif
+ QRect res = BaseStyle::subControlRect( cc, opt, sc, wid );
switch ( cc ) {
case CC_SpinBox: {
int x = res.x(), w = res.width(), h = res.height();
if ( sc==SC_SpinBoxUp || sc==SC_SpinBoxDown ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect frame_r = QWindowsStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
-#else
- QRect frame_r = QCommonStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
-#endif
+ QRect frame_r = BaseStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
h = frame_r.height();
res.setX( x+w-h );
res.setWidth( h );
}
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect slider_r = QWindowsStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
-#else
- QRect slider_r = QCommonStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
-#endif
+ QRect slider_r = BaseStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
int aRect = Style_Tools::getMaxRect( slider_r, (int)model()->widgetRounding( Style_Model::ButtonRadius ) );
switch( sc ) {
case SC_ScrollBarSubPage: // between top/left button and slider
const QWidget* wid ) const
{
if ( checkDebugLevel(13) ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return QWindowsStyle::subElementRect( se, opt, wid );
-#else
- return QCommonStyle::subElementRect( se, opt, wid );
-#endif
+ return BaseStyle::subElementRect( se, opt, wid );
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect res = QWindowsStyle::subElementRect( se, opt, wid );
-#else
- QRect res = QCommonStyle::subElementRect( se, opt, wid );
-#endif
+
+ QRect res = BaseStyle::subElementRect( se, opt, wid );
int aHalfRect = (int)Style_Tools::getMaxRect( res, (int)model()->widgetRounding( Style_Model::EditRadius )/2 );
int w = res.width(), h = res.height();
switch ( se ) {
case SE_ComboBoxFocusRect: {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QRect old_r = QWindowsStyle::subControlRect( CC_ComboBox,
- qstyleoption_cast<const QStyleOptionComplex*>( opt ),
- SC_ComboBoxArrow, wid );
-#else
- QRect old_r = QCommonStyle::subControlRect( CC_ComboBox,
+
+ QRect old_r = BaseStyle::subControlRect( CC_ComboBox,
qstyleoption_cast<const QStyleOptionComplex*>( opt ),
SC_ComboBoxArrow, wid );
-#endif
int old_w = old_r.width();
res.setWidth( w-h+old_w-2 );
break;