Skip to content
QtWS25 Last Chance
  • 0 Votes
    12 Posts
    1k Views
    M
    @Serafim-Rafail I think you go the wrong way. Simply add extra margins to the left by adding some spaces to the text of the tab and draw the number of notifs here.
  • 0 Votes
    3 Posts
    264 Views
    T
    @ChrisW67 Yes, i use QPrinter sending to a virtual PDF printer,but no effect. I will have a try by QPdfWriter::setResolution.
  • 0 Votes
    6 Posts
    541 Views
    timob256T
    @ mrjj why can't I get a full circle ??? #include "krug_qt.h" Krug_qt::Krug_qt(QWidget *parent) : QMainWindow(parent) { R = 90.0; q = 24; p = 24; kol_toch = 180; } Krug_qt::~Krug_qt() { } void Krug_qt::fillVertexArray() { float grad = 360.0/kol_toch; float grad_kol_toch = 0.0; // градусы*M_PI/180 = радианы int j; for (j = 0; j <= kol_toch; ++j){ integerVector.append(R * cos(grad_kol_toch*M_PI/180.0)); integerVector.append(R * sin(grad_kol_toch*M_PI/180.0)); grad_kol_toch = grad_kol_toch + grad; } } void Krug_qt::paintEvent(QPaintEvent *event) { integerVector.clear(); QPainter painter(this); // Создаём объект отрисовщика QPen pen_abris(Qt::black, 2, Qt::SolidLine, Qt::FlatCap); // кисть обрисовки (компаса) painter.setRenderHint(QPainter::Antialiasing); // убираем резкие кубики painter.setPen(pen_abris); // Устанавливаем кисть обрисовки fillVertexArray(); // Набираем массив painter.translate(this->width()/2, this->height()/2); // смещение отрисовки qDebug() << integerVector.size(); int f = 0; for(int i =0; i<integerVector.size()/2; i++) { i++; f++; painter.drawPoint(QPointF(integerVector[--i],integerVector[i])); qDebug() << "f :"<<f; // painter.drawPoint(QPointF(integerVector[i],integerVector[i++])); // i++; } } [image: b782ea31-6cc8-4d5e-815c-3a70041efd3d.png]
  • 0 Votes
    9 Posts
    1k Views
    mrjjM
    @sachinrd You are welcome. Do notice this way of printing it only works when it can fit on one page. if it has many rows, it will not be optimal :)
  • 1 Votes
    4 Posts
    577 Views
    mrjjM
    @Another-Qt-Beginner Hi Did you try setting https://doc.qt.io/qt-5/qgraphicsview.html#ViewportUpdateMode-enum to FullViewportUpdate to see if that reduces the issues.
  • Paint Event and Zoomed In Image Problem

    Unsolved General and Desktop paint event painter zoom size qlabel
    4
    0 Votes
    4 Posts
    1k Views
    N
    @mrjj I tried your code, here's the result: [image: 0a2df4f3-38c9-4f54-affe-c60ba74d14c0.png]
  • Delegate that paint entire widget area

    Unsolved General and Desktop modelview delegate painter
    4
    0 Votes
    4 Posts
    2k Views
    mrjjM
    Hi Mr @VRonin suggested we looked at http://doc.qt.io/qt-5/qabstractscrollarea.html#maximumViewportSize so maybe yo u need to subclass view and return full area.
  • 0 Votes
    5 Posts
    3k Views
    L
    @SGaist Just a simple lined border. At present, this border applies behind the background and isn't visible. There's also the issue of the existing dotted border that I'd want to remove/replace.
  • Element color in custom style

    Solved General and Desktop style qproxystyl qstyle painter color
    3
    0 Votes
    3 Posts
    2k Views
    gabodevG
    @mrjj Thank you very much! I have researched and been able to do what I was looking for. Here's what I did: def drawPrimitive(self, element, opt, painter, widget): if element == QStyle.PE_PanelButtonTool: pressed = (opt.state & STATE_SUNKEN | opt.state & STATE_ON) color = QColor("#323232") if pressed: color = QColor("#222222") elif opt.state & STATE_ENABLED and opt.state & STATE_MOUSEOVER: color = QColor("#4e4e4e") painter.fillRect(opt.rect, color) elif element == QStyle.PE_IndicatorArrowDown or \ element == QStyle.PE_IndicatorArrowUp: r = opt.rect size = min(r.height(), r.width()) image = QImage(size, size, QImage.Format_ARGB32_Premultiplied) image.fill(Qt.transparent) image_painter = QPainter(image) image_painter.setPen(QColor("#bdbfc0")) image_painter.setBrush(QColor("#bdbfc0")) polygon = QPolygon() polygon.append(QPoint(0, r.width() * 0.5)) if element == QStyle.PE_IndicatorArrowDown: polygon.append(QPoint(size, size * 0.6)) polygon.append(QPoint(size / 2, size * 0.1)) else: polygon.append(QPoint(size, size * 0.5)) polygon.append(QPoint(size / 2, size * 0.9)) image_painter.drawPolygon(polygon) image_painter.end() pixmap = QPixmap.fromImage(image) painter.drawPixmap(r.x() + (r.width() - size) / 2, r.y() + (r.height() - size) / 2, pixmap) else: QProxyStyle.drawPrimitive(self, element, opt, painter, widget) Regards!
  • Draggable and scrollable timeline

    Unsolved General and Desktop painter drag scroll timeline
    3
    0 Votes
    3 Posts
    2k Views
    D
    @SGaist Thanks Champion! I will try !
  • QListViewDelegate paint issue

    Solved General and Desktop delegate painter qlistview
    14
    0 Votes
    14 Posts
    8k Views
    raven-worxR
    just for addition: see this So i ncase you draw anti-aliased, the border-offset would just be the half of the border-width.
  • 0 Votes
    1 Posts
    738 Views
    No one has replied