Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • Transferring project from qt to visual studio

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    M
    ok i was able to figure it out. If anyone find this the issue is that the ui which pop ups in the qt designer has to have that specific name. Such as i had to have a plot that says customplot or it would give me an error. Also when switching over it is best to take out qcustomplot.h and qcustomplot.cpp and just link the whole folder
  • semi Transparent qlabel background

    Solved
    6
    0 Votes
    6 Posts
    9k Views
    mrjjM
    @QT-static-prgm QLabel seems to refuse by it self but inside widget, i get this [image: QF5b2o.png] #include <QtWidgets/QApplication> #include <qlabel.h> int main(int argc, char* argv[]) { QApplication a(argc, argv); QLabel* label = new QLabel; label->setAttribute(Qt::WA_ShowWithoutActivating); label->setGeometry(320, 200, 750, 360); label->setAlignment(Qt::AlignTop | Qt::AlignLeft); label->setText("Hello World!"); QWidget* w = new QWidget; label->setParent(w); w->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::SplashScreen); label->setStyleSheet("border: solid 10px grey; background-color: rgba(255, 0, 0,127); color:rgb(0,255,0)"); w->setAttribute(Qt::WA_TranslucentBackground); w->setWindowFlags(Qt::FramelessWindowHint); label->show(); w->show(); return a.exec(); }
  • Delete message after x seconds

    Solved qtimer label remove text
    25
    0 Votes
    25 Posts
    12k Views
    QT-static-prgmQ
    @mrjj as i told you in the thread, it looks the same as on your picture. But it should be transparent, so you can see the code lines from the editor below in your case. But let's continue that in the other thread
  • Relative path to absolute path

    Solved
    3
    0 Votes
    3 Posts
    11k Views
    Gianluca86G
    It doesn't work. That gives me only " . " I found my solution: QDir TestDir("/Home/User/TestDir"); QString AbsolutePath = TestDir.cleanPath(TestDir.absoluteFilePath("../AnotherDir")); I don't know if it's the right way, but it works. Thanks anyway for the Answer VRonin.
  • QTest test case description

    Unsolved
    3
    0 Votes
    3 Posts
    808 Views
    T
    @VRonin said in QTest test case description: You can (ab)use the data driven Test framework, just add 1 row with the description in it http://doc.qt.io/qt-5/qttestlib-tutorial2-example.html Thanks for the suggestion. I'll take a look at using that.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Set make flag for all projects

    Unsolved make qmake
    4
    0 Votes
    4 Posts
    3k Views
    K
    @Pamplemousse-MK-2 When you are entering this on each machine where the creator is used, it will apply to all projects on that machine. Eventually you need to check whether it is updated for all projects already loaded in created. New projects are taking over those system environment settings.
  • QAbstractItemModel::match bug?

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    K
    @VRonin said in QAbstractItemModel::match bug?: can you consider manual matching? void MyComboBox::setValor(const QVariant& myValue, int column = 0, int role = Qt::DisplayRole, const QModelIndex& parent=QModelIndex()) { if(myValue.isNull()) return; const int rowCount= model()->rowCount(parent); for(int i=0;i<rowCount;++i){ const QVariant currVal = model()->index(i,column,parent ).data(role ); if(currVal.isNull()) continue; if(currVal == myValue) return setCurrentIndex(i); } } yes, it seems to be the approach. thanks
  • Program failing at Run time

    Unsolved
    4
    0 Votes
    4 Posts
    844 Views
    mrjjM
    @Luism -i f I try to insert a layout by right clicking I don't get the same menu as you, the layouts are all greyed out. You must first place a widget (any) , then its not grey any more. :) Yes, its a bit tricky. :( ui->verticalLayout->addWidget(&mCpuWidget); Is not what you want., its a floating layout :) The right click is the way in most cases.
  • 0 Votes
    4 Posts
    2k Views
    mrjjM
    @vishnu Hi Just as note http://www.drmemory.org/ But i never tried it on a Qt project.
  • Can we mark a text in QTextEdit as hyperlink

    Unsolved
    5
    0 Votes
    5 Posts
    4k Views
    mrjjM
    @jsulm I think he dreams about something like QTextBrowser::anchorClicked() One way that might work is mouse events ( for Pos) and QTextEdit::anchorAt() http://doc.qt.io/qt-5/qtextedit.html#anchorAt But im only guessing :)
  • How to show QListView..?

    Unsolved
    10
    0 Votes
    10 Posts
    4k Views
    VRoninV
    Edited the code above, now it should spawn a window containing the image for each file, could you check if the windows work correctly?
  • CSS

    Solved
    3
    0 Votes
    3 Posts
    885 Views
    Y
    Thank's for your answer Qt support all selector CSS2, some properties of CSS3, and she has these own properties
  • How to set the color of the selected QTreeWidgetItem?

    Unsolved
    13
    0 Votes
    13 Posts
    14k Views
    J.HilkJ
    @opengpu2 You can always disable the default focus of your listwidget widget->setFocusPolicy(Qt::NoFocus); And "create your own 'focusHanlder' " connect(widget, &QListWidget::clicked, [=](QModelIndex index){ //Do Custom Stuff with clicked item });
  • QT5.8 multimeadia module mediaplay failed

    Unsolved
    15
    0 Votes
    15 Posts
    3k Views
    jsulmJ
    @JiujiuTong You can easily check with: file libactivemq-cpp.so in a terminal. Default is actually 64bit on a 64bit system.
  • QSettings with QDateTime changes between 5..3.2 and 5.8

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    jsulmJ
    @Richard I would use http://doc.qt.io/qt-5/qdatetime.html#toString and specify format. This way you do not depend on how Qt is serializing QDateTime. And it is readable by humans :-)
  • passing model class

    Moved Unsolved
    3
    0 Votes
    3 Posts
    492 Views
    VRoninV
    why passing a double pointer instead of just the QStandardItemModel* ?
  • QTimeedit set color

    Unsolved
    4
    0 Votes
    4 Posts
    994 Views
    M
    @mrjj said in QTimeedit set color: Hi Small note. There is no reason to new the palette QPalette palette; ... yourtimeedit->setPalette(palette); Works just fine The setPalette makes copy. Also, with new you must then delete palette; to avoid to leak. Good point @mrjj , Delete palette was obvious for me , but you are right , QPalette palette; Already does the job, Thank you for your answer !
  • QGraphicsDropShadowEffect and QResizeEvent

    Solved qgraphicsdropsh qresizeevent qlabel shadow
    3
    0 Votes
    3 Posts
    2k Views
    J.HilkJ
    Ok, I'll mark this as solved. I wasn't able to do it with QGraphicsDropShadowEffect, and creating all images twice and including them in the rcs-file is simply a no go. Therefore I create a function, that draws a shadow - all 4 sides - around the the QImages, either at startup or during runtime. Here it is, in case anyone else needs something like it. QImage drawShadow(QImage img) { //Condition img allready has a transparent border 4 Pixel in this case //Create new Img with same Size QImage imgBGround(img.size(), img.format()); //Fill it with transparency QPainter p(&imgBGround); QPen pen; pen.setStyle(Qt::NoPen); p.setPen(pen); p.setRenderHint(QPainter::Antialiasing); p.fillRect(QRect(0,0,img.width(), img.height()), QColor(255,255,255,0)); //Draw Rounded Rectangle as Shadow QPainterPath path; path.addRoundedRect(QRect(0,0,img.width(), img.height()),15,15); p.fillPath(path,QColor(110,152,226)); p.drawPath(path); //Draw Original Img over background p.drawImage(0,0,img); return imgBGround; }
  • QToolTip StyleSheet with padding produces additional padding

    Solved
    6
    1 Votes
    6 Posts
    4k Views
    S
    Hi, I have committed a new bug report. https://bugreports.qt.io/browse/QTBUG-59119 regards Oliver