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. QGraphicsView sizeIncrement
Forum Updated to NodeBB v4.3 + New Features

QGraphicsView sizeIncrement

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 999 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.
  • O Offline
    O Offline
    OrlySedl
    wrote on last edited by
    #1

    I hope you can help me. I couldn't resize the QGraphicsView incremental 20.
    main.cpp
    #include <QApplication>
    #include <QGraphicsView>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QGraphicsView *view = new QGraphicsView();
    view->setSizeIncrement(20, 20);
    view->show();
    return a.exec();
    }

    I tried to create a View class and inherit from QGraphicsView, for function overloading
    void View::resizeEvent(QResizeEvent event)
    I was thinking of doing it so
    this->resize(20
    std::round(this->width()/20), 20*std::round(this->height()/20));
    BUT I can't do anything.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What OS are you running ?

      Did you notice the warning in the sizeIncrement property documentation ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OrlySedl
        wrote on last edited by
        #3

        I use Ubuntu 16.04. Yes, I watched the documentation. I'm interested in how you can implement similar functionality as sizeIncrement yourself, or something like that.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You'll have to check that with the Window Manager used by your Linux distribution.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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