Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Bug? - Moving QFrame - not working when setVisible(false)

    3
    0 Votes
    3 Posts
    2k Views
    M
    How my QFrame is created : @ //// ---------------------- Test Achievement Window -------------------------- frameAchievement = new QFrame(ui->widget_allSpeedo); frameAchievement->setAttribute(Qt::WA_TransparentForMouseEvents,true); frameAchievement->setFocusPolicy(Qt::NoFocus); frameAchievement->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); frameAchievement->setFixedSize(250, 150); frameAchievement->setObjectName("frameAchievement"); frameAchievement->setStyleSheet("QFrame#frameAchievement { background-color : rgba(1,1,1,240); " "border: 4px solid gray; }" "QLabel { color: white; }"); QGridLayout *gridAchievement = new QGridLayout(frameAchievement); QFont fontBold; fontBold.setPointSize(10); fontBold.setBold(true); labelIcon = new QLabel(frameAchievement); labelIcon->setMinimumHeight(64); labelIcon->setMaximumHeight(64); labelIcon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); labelIcon->setObjectName("labelIcon"); labelIcon->setStyleSheet("image: url(:/image/icon/trophy)"); QLabel *labelAchievementReceived = new QLabel(frameAchievement); labelAchievementReceived->setMinimumHeight(20); labelAchievementReceived->setMaximumHeight(20); labelAchievementReceived->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); labelAchievementReceived->setAlignment(Qt::AlignBottom | Qt::AlignRight); labelAchievementReceived->setAttribute(Qt::WA_TransparentForMouseEvents,true); labelAchievementReceived->setText(tr("New Achievement!")); labelAchievementReceived->setFont(fontBold); labelAchievementName = new QLabel(frameAchievement); labelAchievementName->setMinimumHeight(20); labelAchievementName->setMaximumHeight(20); labelAchievementName->setMaximumWidth(400); labelAchievementName->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); labelAchievementName->setAlignment(Qt::AlignBottom | Qt::AlignRight); labelAchievementName->setAttribute(Qt::WA_TransparentForMouseEvents,true); labelAchievementName->setText(tr("Name here!")); labelAchievementName->setFont(fontBold); gridAchievement->addWidget(labelIcon, 0, 0, 2, 1); gridAchievement->addWidget(labelAchievementReceived, 0, 1); gridAchievement->addWidget(labelAchievementName, 1, 1); QGridLayout *glayout = static_cast<QGridLayout*>( ui->widget_allSpeedo->layout() ); glayout->addWidget(frameAchievement, 0, 0, 0, 0); frameAchievement->setAttribute(Qt::WA_TransparentForMouseEvents,true); timerRemoveAnimation = new QTimer(this); timerAnimationCompleted = new QTimer(this); connect (timerRemoveAnimation, SIGNAL(timeout()), this, SLOT(removeAchievementAnimation()) ); connect (timerAnimationCompleted, SIGNAL(timeout()), this, SLOT(lastAchievementAnimationDone()) ); achievementCurrentlyPlaying = false; firstTimePlayAchievement = true; /// Hide achievement window /// Not working to move position manually here.. // frameAchievement->setVisible(true); // QPoint currentPoint = frameAchievement->pos(); // frameAchievement->setProperty("pos", QPoint(currentPoint.x()-250, currentPoint.y())); frameAchievement->setVisible(false); @
  • Setting up UI for movie player

    3
    0 Votes
    3 Posts
    903 Views
    A
    How can I set up the button shapes like d shape of picture viewer..it there any widget similar to it?
  • 0 Votes
    3 Posts
    1k Views
    N
    Hello Hasmik, I found in qtbase/src/widgets/styles/qmacstyle_mac.mm line 2066 (Qt 5.3.1) that it defaults to large icon size: @ case PM_ToolBarIconSize: ret = proxy()->pixelMetric(PM_LargeIconSize); break; @ But I noticed that it uses the proxy() so my own fix was to make a custom QProxyStyle that uses PM_SmallIconSize instead: @ #include <QProxyStyle> class MacStyle : public QProxyStyle { public: MacStyle() : QProxyStyle("Macintosh") { } int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget * widget = 0) const { if (metric == PM_ToolBarIconSize) { return proxy()->pixelMetric(PM_SmallIconSize); } return QProxyStyle::pixelMetric(metric, option, widget); } }; @ Then right before creating the QApplication you would do: @ QApplication::setStyle(new MacStyle); @
  • How to create a QImage from an average of ten others

    5
    0 Votes
    5 Posts
    2k Views
    A
    [quote author="Jeroentje@home" date="1408540940"]Just for my curiosity, but what do you mean with average of 10 images?[/quote] 10 frames captured on command from streaming video, each frame converted to QImage.
  • 0 Votes
    5 Posts
    2k Views
    S
    https://bugreports.qt-project.org/browse/QTBUG-40863
  • 0 Votes
    8 Posts
    2k Views
    B
    Yes, I could provide a small Python/PyQt app + qt_pt.qm. The app would display a QErrorMessage of type Debug, whose translation is also bad (it's not just the Mac application menu, and not just on OSX.) But is that necessary, since if it it looks wrong in Linguist on any platform, one can say it is a wrong translation? Example: open Qt Linguist on qt_pt.ts from the repository. Look at the source text "Debug Message" in the context "QErrorMessage". The translated text wrongly has capital letters in the middle of words (which I think is wrong in most words of most Latin languages, except for proper names like McTavish.) (This example would rarely be noticed. The example for the MAC_APPLICATION_MENU context is more important.) It's not just the Portuguese translation either, there are examples in the French translation.
  • [SOLVED] Matrix division

    7
    0 Votes
    7 Posts
    2k Views
    A
    I found also a performance test comparing diferent libraries and the armadillo looks like one of the bests, so i will try it. Ok thanks so much for help me!
  • QComboBox confusion

    3
    0 Votes
    3 Posts
    826 Views
    Chris KawaC
    Something like this should work: @ ui->comboBox->setEditable(true); ui->comboBox->setInsertPolicy(QComboBox::NoInsert); connect(ui->comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [=](int index){ emit setZoom(getZoomFromText(ui->comboBox->itemText(index))); }); connect(ui->comboBox->lineEdit(), &QLineEdit::returnPressed, ={ emit setZoom(getZoomFromText(ui->comboBox->lineEdit()->text())); }); @ Edit ups, too slow :)
  • Qt5.1: Return a list of available QML types

    2
    0 Votes
    2 Posts
    640 Views
    p3c0P
    Hi, May be you should have a look at what qmlplugindump does.
  • Build error but no error message

    2
    0 Votes
    2 Posts
    641 Views
    K
    You did not give an alternative text while embedding the picture. I have fixed this for you.
  • Qt Creator on the Mac

    6
    0 Votes
    6 Posts
    2k Views
    B
    Brian: I use Qt creator on osx, ubuntu (both native and virtualbox on my mba), and windows (likewise native/ vbox+mba). All work fine, just be aware of the keyboard awkwardness. I also use pycharm extensively on all platforms as well - also works great, but I have put a little effort into configuring both creator and pycharm to have somewhat related keymaps. -bms20
  • Example Web API w Qt5.3

    2
    0 Votes
    2 Posts
    1k Views
    dheerendraD
    Welcome to the forum. Did you a get a chance to look at webkitswidgets examples under 'examples' directory of Qt installation ?
  • Qprinter take receipt

    9
    0 Votes
    9 Posts
    3k Views
    SGaistS
    Then you should ask the status of this on the bug report
  • Weird crash with QSystemTrayIcon on OSX

    11
    0 Votes
    11 Posts
    3k Views
    SGaistS
    I don't know, I don't work for Digia, however you can find information about the CI "here":http://qt-project.org/wiki/CI_Overview But like I said, test with the 64 bit prebuilt package. Creating a minimal compilable example that reproduce the behavior will help creating a patch.
  • Change drawARC starting position

    4
    0 Votes
    4 Posts
    1k Views
    R
    Finally figured it out. Order is important. @void MainWindow::displayARC(int angle) { QPixmap pix(61,61); pix.fill(Qt::transparent); QPen pen; pen.setWidth(3); pen.setColor(QColor(220,220,0,255)); pix.fill(Qt::transparent); QPainter painter(&pix); painter.setRenderHint(QPainter::Antialiasing); painter.translate(pix.width()/2.0,pix.height()/2.0); painter.rotate(130.0); // Zero is 3:00 position painter.setPen(pen); painter.drawArc(-19, -19, 38, 38, 0,(int)angle * -16); ui->labelARC->setPixmap(pix); } void MainWindow::displayMark(qreal angle) { QPixmap pix(61,61); pix.fill(Qt::transparent); QPen pen; pen.setWidth(3); pen.setColor(QColor(22,22,255,255)); QPainter painter(&pix); painter.setRenderHint(QPainter::Antialiasing); painter.translate(pix.width()/2.0,pix.height()/2.0); painter.rotate(angle +130.0); // Zero is 3:00 position painter.setPen(pen); painter.drawLine(23.5, 0.0, 3.0, 0.0); painter.drawArc(-19, -19, 38, 38, 0,(int)angle * 16); ui->label->setPixmap(pix); } @
  • Qt statical build

    4
    0 Votes
    4 Posts
    2k Views
    A
    Show me a screenshot of the app with bad looking fonts (the one you did the install on) and a screenshot of the app with normal looking fonts. That way I can see what kind of font issues you are dealing with. Also, any information about your operating system would be great. What X11 are you using, what window manager, versions of these. Version of Ubuntu.
  • [QNetwork] issues with files served by PHP

    1
    0 Votes
    1 Posts
    464 Views
    No one has replied
  • 0 Votes
    9 Posts
    4k Views
    SGaistS
    Like I said, you are going against linux standards for library handling "Here":http://www.ibm.com/developerworks/linux/library/l-shlibs/index.html are more informations about that
  • QNetworkAccessManager returning empty results

    4
    0 Votes
    4 Posts
    3k Views
    SGaistS
    Hi, @m_NetworkManager = new QNetworkAccessManager(this);@ Should be in RestClientCore constructor. You are creating a new QNAM each time you call ConnectToServer and never delete the old one.
  • How to paint a constellation mapping using Qt.

    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    There are several possibilities, keep a list of your points, update it and redraw them all. Use a QPixmap, draw each new point on it then just draw this pixmap in your widget. Or look at e.g. Qwt which provides facilities for that kind of drawing.