Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]How to disable Scrollbars on QWidget
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]How to disable Scrollbars on QWidget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 11.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aashish.lg
    wrote on 26 Mar 2012, 08:58 last edited by
    #1

    I am using QWebView to display some html content on it I have defined the geometry of my webview that exactly fits wiht html content geometry, but when it renders the html content it draws horizontal and vertical scrollbars on it. I have given the buggy code below.

    @
    QWebView * webView = new QWebView();
    webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);

     QString str = "<html><body topmargin=\"0\" leftmargin=\"0\"><embed type=\"application/x-shockwave-flash\"     src=\"http://catanista.eu/flash/logo.swf\"  type=\"application/x-shockwave-flash\"  data=\"/flash/logo.swf\"  height=\"200\"  width=\"190\"  PARAM=\"\"  quality=\"high\"  wmode=\"opaque\"  swfversion=\"6.0.65.0\"  expressinstall=\"Scripts/expressInstall.swf\"></body></html>";
    
    
     webView->setHtml(str);
     webView->setWindowFlags(Qt::FramelessWindowHint);
     webView->setGeometry(0,0, 190,200);
    
     QSizePolicy objSize(QSizePolicy::Fixed, QSizePolicy::Fixed);
     webView->setSizePolicy(objSize);
    
     webView->show();
    

    @

    I tried to use SizePolicy as fixed also but not luck!!!
    Please help where it is going wrong.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jake007
      wrote on 26 Mar 2012, 14:38 last edited by
      #2

      @webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
      webView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);@

      Regards,
      Jake


      Code is poetry

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aashish.lg
        wrote on 16 Apr 2012, 04:59 last edited by
        #3

        Thanks Jake it worked for me...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved