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. QGraphicsScene retina support for QWidgets
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene retina support for QWidgets

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.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.
  • H Offline
    H Offline
    Hasmik
    wrote on last edited by
    #1

    The retina support does not work when qt widget is added to QGraphicsScene?

    Below is the code i am working on.

    @
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    QGraphicsView view;
    QGraphicsScene *scene = new QGraphicsScene(0, 0, 500, 500, &view);
    scene->setBackgroundBrush(Qt::green);
    view.setScene(scene);
    
    QWidget *widget = new QWidget();
    QVBoxLayout *lay = new QVBoxLayout();
    widget->setLayout(lay);
    
    QSlider *slider = new QSlider(Qt::Horizontal);
    lay->addWidget(slider);
    scene->addWidget(widget);
    
    view.show();
    
    return a.exec();
    

    }
    @

    After changing slider's position the icon is disappeared. Someone know if it possible to fix it and how?

    [fixed typo in title, Eddy]

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Hi,

      Welcome to the forum.

      Your code works for me. There must be something else going on.
      Can you show us the code of your MainWindow class?

      Also, what OS you're on, which Qt version?

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hasmik
        wrote on last edited by
        #3

        I used Qt5.2.0
        I test it on my Max OS X 10.8 and 10.9.1. and its does not work.
        In my MainWindow nothing extra.

        Are you sure that you tested it on retina display?
        Thanks for such soon respond

        @
        #include "mainwindow.h"
        #include "ui_mainwindow.h"

        MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
        {
        ui->setupUi(this);
        }

        MainWindow::~MainWindow()
        {
        delete ui;
        }
        @

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          I misunderstood the environment you are working in. I thought you didn't see the slider movable part. I tested on windows 7. There it works fine.

          Maybe someone else on os x can test it for you.

          Can you elaborate on the "icon dissappearing" part? Maybe a screenshot?

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hasmik
            wrote on last edited by
            #5

            I use Mac OS X 10.8.4 and Mac OS X 10.9.1.
            In normal display it works fine but in retina display the movable part of slider disappears. Sometimes even the whole slider is not visible.

            I put the links of screen shot bellow:

            "Before":http://www.dropbox.com/s/7hwh6vvc3mo566t/Screen1.png
            "After":http://www.dropbox.com/s/2ptitofnp87rut1/Screen2.png

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              You can check also on "JIRA":https://bugreports.qt-project.org/secure/Dashboard.jspa for a reported bug with Retina . In case you cannot find anything reported there, please file a bug report.

              If you put a link to this thread there, all info here can be easily found. Please add the bug report number here as a tag for easy finding it back.

              Qt Certified Specialist
              www.edalsolutions.be

              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