Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • QLabel subclass and stylesheet Qtcreator

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    gfxxG
    @J.Hilk Your method is fine if you do not use QT Creator for style ... the best thing is to use it in GuiThread ... with these subclass I have a ToggledQLabel var ... so in mainwindow: if(ToggledQLabel){ ui->myToggledQLabel1->setstylesheet("ToggledQLabel{..............};");} else{ ui->myToggledQLabel1->setstylesheet("ToggledQLabel{......other style........};");} but I try to have I do not think that you are using a good approach, you have to use dynamic stylesheet properties, Using Dynamic properties with stylesheet You can add custom properties : you have to do things like that : simply I did not know it existed or their name .... the link on my abstracbutton addressed.
  • QSyntaxHighlighter with parser

    Unsolved
    1
    0 Votes
    1 Posts
    651 Views
    No one has replied
  • The problem of a .qs file when creating a shortcut

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    tomyT
    @J.Hilk sometime ago I was using Qt Creator 5.5.1. But when mrjj suggested using 5.7, I uninstalled 5.5.1 and installed 5.7. The program is built rand run using 5.7. Do you mean that I should uninstall 5.7 and install 5.8?
  • How to start text from down in QTextEdit

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    mrjjM
    @ARASHz4 Well its a sample for "how to move the cursor" you must look at the doc and understand the code.... Then it will work :) Thank you to @J-Hilk for doing it for you :)
  • I get the wrong color in paint function.

    Solved
    3
    0 Votes
    3 Posts
    748 Views
    joeQJ
    @matthew.kuiash Excellent, Your memory is good! Thank u very much.
  • 0 Votes
    11 Posts
    4k Views
    A
    By calling "prepareGeometryChange()" and then changing the fundamental parameters that are used in my overload of boundingRect()
  • How to add QJsonArray to QJsonObject ?

    Solved
    4
    0 Votes
    4 Posts
    17k Views
    H
    @Paul-Colby thank you for answer it was work :)
  • Trouble with compilator after modify a flag

    Solved compilator help flag
    4
    0 Votes
    4 Posts
    1k Views
    jsulmJ
    @Massimiliano No, you do not drop it in your app directory! You just need to call it in a terminal window and pass the path to your binary as parameter. Please read the documentation: "The tool can be found in QTDIR/bin/windeployqt. It takes an .exe file or a directory that contains an .exe file as an argument, and scans the executable for dependencies."
  • QFileDialog error message

    Unsolved
    2
    0 Votes
    2 Posts
    440 Views
    dheerendraD
    Your first argument type may be wrong. It accepts qwidget type. You must be passing different type
  • Get containts of website from QWebView using Qt 5.5.1

    Unsolved
    3
    0 Votes
    3 Posts
    643 Views
    AmrCoderA
    @Chris-Kawa Thanks for this hint and this what i tried MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->webView->load(QUrl("https://www.login.com")); // load page that have user name and password field QWebPage *page = ui->webView->page(); // get the current page manager = page->networkAccessManager(); // get the access manager from this page } MainWindow::~MainWindow() { delete ui; } // get button void MainWindow::on_pushButton_clicked() { reply = manager->get(QNetworkRequest(QUrl("https://www.login.com"))); // make get now after login connect(reply, SIGNAL(readyRead()),this,SLOT(readyRead())); connect(reply, SIGNAL(finished()),this, SLOT(finish())); } void MainWindow::readyRead() { QString str = QString::fromUtf8(reply->readAll()).trimmed(); // read the data ui->plainTextEdit->appendPlainText(str); } but i get the data of the first page without the login i want to get the page content after login please give me any hint or what i should do Thanks
  • erreur de compilation

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    SGaistS
    You have to many backslashes, remove the ones that are on leaf lines. Then as @mostefa suggested, try to build a default application and if that succeed, try again using QString somewhere in it. If these two succeed, then there's something fishy with your code.
  • QPainterPath to QPixmapItem

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    S
    @mrjj Thank you. That could do the job.
  • On the way of making an app installable

    Unsolved
    49
    0 Votes
    49 Posts
    15k Views
    tomyT
    Please read my previous edited post. I changed the name of Cal.exe file.
  • Question on initialization of mainwindow

    Unsolved
    2
    0 Votes
    2 Posts
    775 Views
    Chris KawaC
    There are 4 pointers in that class: textEdit, customerList, paragraphsList and viewMenu. All of them need to be initialized somewhere. The first one is initialized in the initialization list of the class constructor as you mentioned. Using initialization list doesn't require you to init the member via a parameter. It can be initialized from any value, in this case it's a new statement. For example: class Foo { public: Foo() : bar(42) {} //initializing bar via value Foo(int param) : bar(param) {} //initializing bar via param Foo() { initBar(); } //initializing bar via member function private: void initBar() { bar = 42; } int bar; }; The example uses the first type of initialization for textEdit. All the other pointer members are initialized in the MainWindow::createDockWindows() which is called from the constructor's body. It's the third type of initialization from the example above.
  • How to access QSqlRelationalModel from function?

    Solved
    32
    0 Votes
    32 Posts
    8k Views
    mrjjM
    @Panoss Np. Thats why i lurk around here :)
  • Qt quit both c++ and UI

    Unsolved
    12
    0 Votes
    12 Posts
    5k Views
    SGaistS
    Calling qApp->quit() before exec() won't have any effect since the event loop isn't even started.
  • My debugger/compiler does not see Qt classes/modules.

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    mrjjM
    @Waxta well remove all qt. Install the 5.8 one. Maybe the Qt plugin for visual studio. It should just work. https://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-windows-x86-msvc2015_64-5.8.0.exe.mirrorlist
  • Strategy for storing an array of thousands of objects read from JSON

    Solved
    3
    0 Votes
    3 Posts
    550 Views
    kshegunovK
    QVector for sequential access. QHash/QSet (basically the same thing) for non-sequential access but you need to provide a hashing function.
  • Compiler Problems

    Unsolved
    4
    0 Votes
    4 Posts
    761 Views
    mrjjM
    @goktug1415 When installing the Qt mingw packet then mingw is included. Not in the Creator download. Just try a new Defualt GUI project via the new project menu. If it runs. all is good :)
  • Qt installer framework: place MaintenanceTool in separate folder

    Unsolved
    1
    1 Votes
    1 Posts
    338 Views
    No one has replied