Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.2k Posts
  • Kill QThreadPool

    4
    0 Votes
    4 Posts
    9k Views
    G
    Ok. Thanks for your suggestions.
  • QTableWidget drag and drop

    3
    0 Votes
    3 Posts
    3k Views
    M
    Hi I do need to override, as I need some custom behaviour of the drag and drop. I need to swap the elements inside a table using drag and drop... Still, why is mimeData() returning null if I provide a correct list? Is this bug known?
  • Limitations of the Qt Designer

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Signal slots not working when QApplication.exec

    14
    0 Votes
    14 Posts
    8k Views
    B
    Updated the BSP and the problem magically disappears! THANK GOD :)
  • Does Qt has this control?

    6
    0 Votes
    6 Posts
    2k Views
    G
    [quote author="lloydqt" date="1337747153"]Thanks. Will it be able to supports 1000s of cells? Isn't it better to implement in a windows paint event?[/quote] That depends :-) How many cells do you need? How often do you update them? In theory, QTableView supports this number of cells. But it depends on update frequency, hardware you run on etc to make that decission. Surely, you can do it in a more optimzed way by implementing a special widget by hand but it will also cost more :-)
  • QNetworkAccessManager in QThread

    3
    0 Votes
    3 Posts
    3k Views
    M
    Why are you putting the QNetworkAccessManager in its own thread? It is already asynchronous.
  • [Solved] Qt Border Color

    5
    0 Votes
    5 Posts
    25k Views
    S
    Kindly edit your first post and set the title as [Solved]. Thanks
  • How to fix the treeview on left hand side of main window.

    2
    0 Votes
    2 Posts
    6k Views
    B
    bq. Each widget returns a QSizePolicy that describes the horizontal and vertical resizing policy it prefers when being laid out. You can change this for a specific widget by changing its "QWidget::sizePolicy":http://qt-project.org/doc/qt-4.8/qwidget.html#sizePolicy-prop property. QSizePolicy contains two independent "QSizePolicy::Policy":http://qt-project.org/doc/qt-4.8/qsizepolicy.html#Policy-enum values and two stretch factors; one describes the widgets's horizontal size policy, and the other describes its vertical size policy. It also contains a flag to indicate whether the height and width of its preferred size are related. "source":http://qt-project.org/doc/qt-4.8/QSizePolicy.html
  • Q_NO_USING_KEYWORD

    5
    0 Votes
    5 Posts
    2k Views
    C
    Q_NO_USING_KEYWORD controls the use of the C++ "using" keyword for compilers that do not support, or incorrectly support, it. In this particular instance it affects the implementation, but not the availability, of indexOf() and lastIndexof() in QStringList. Q_NO_USING_KEYWORD is set for some truly ancient versions of GCC only. What GCC version are you running (gcc -v)? Exactly what errors or warnings do you get? See "src/corelib/global/qglobal.h" and "src/corelib/tools/qstringlist.h"
  • [Solved] Qt - CheckBox color

    2
    0 Votes
    2 Posts
    9k Views
    M
    Look "here":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html for examples on how to use stylesheets for a variety of different widgets.
  • 0 Votes
    7 Posts
    16k Views
    N
    Oh okay, thanks!! I also found that doing @help(QtCore)@ for example on a python command line returns the versions of all. or windows: @c:\python32\python configure.py --version@ :) Hopefully this is helpful for someone
  • Linguist problem

    13
    0 Votes
    13 Posts
    6k Views
    S
    "Forums > International > Persian":http://qt-project.org/forums/viewforum/40/
  • Link against a widget library

    2
    0 Votes
    2 Posts
    927 Views
    D
    In short, you should not use plugin in such a way, though it will work if you have exported symbols properly. BTY, you had better distinguish widget library(whether you widget located) and designer plugin(used only by your designer). Don't mix them together.
  • QAbstractScrollArea scrolled rect

    1
    0 Votes
    1 Posts
    989 Views
    No one has replied
  • 0 Votes
    7 Posts
    4k Views
    S
    Hi, today I tried to run my sender process with QProcess::startDetached() and it worked without any problems. Starting the same sender process as a normal QProcess with the start method results in a segmentation fault after receiving a few packets. I post the corresponding code, maybe somebody got an idea what I am doing wrong. I am not sure if it makes any difference, but I am running that program under Linux. Line 49 is the one that works if I comment out line 48 instead. Any comments are appreciated! Thanks in advance! P.S.: I am quiet sure that line 46 is not necessay but as I am running out of ideas I also tried this. @ void ReceiverGui::startReceiver() { if (!settingsOk()) { return; } toogleStartStopButton(); //! Start network setupAndStartNetwork(); //! Determine receiver executable and working directory QString receiverFilePath = this->settings->value("receiverLocation").toString(); QString receiverWorkingDirectory; QStringList receiverPathParts = receiverFilePath.split("/"); for (int i = 0; i < receiverPathParts.size()-1; i++) { receiverWorkingDirectory.append(receiverPathParts.at(i)); receiverWorkingDirectory.append("/"); } QString receiverExecutableFile = "./" + receiverPathParts.at(receiverPathParts.size()-1); QStringList arguments; //! Start the receiver if (this->ui.settingsTabWidget->getLastSelectedMode() == SettingsTabWidget::EXTERNAL || this->ui.settingsTabWidget->getLastSelectedMode() == SettingsTabWidget::FILE) { //! determine file to decode QString inputFilePath; if (this->ui.settingsTabWidget->getLastSelectedMode() == SettingsTabWidget::EXTERNAL) { inputFilePath = this->ui.settingsTabWidget->getInputFileNonEvaluationPath(); } else if(this->ui.settingsTabWidget->getLastSelectedMode() == SettingsTabWidget::FILE) { inputFilePath = this->ui.settingsTabWidget->getInputFileEvaluationPath(); } inputFilePath = inputFilePath.left(inputFilePath.size()-6); arguments << inputFilePath; // determine plp number int plpNumber = this->ui.settingsTabWidget->getPlpNumber(); arguments << QString::number(plpNumber); // determine xml config file QString configFilePath = this->settings->value("receiverConfigLocation").toString(); arguments << configFilePath; //! start the process receiverProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); receiverProcess->setWorkingDirectory(receiverWorkingDirectory); receiverProcess->start(receiverExecutableFile, arguments, QIODevice::ReadOnly); // QProcess::startDetached(receiverExecutableFile, arguments, receiverWorkingDirectory); //! works } else if (this->ui.settingsTabWidget->getLastSelectedMode() == SettingsTabWidget::REAL_TIME) { // ... } } @
  • How to handle click event on node of Treeview

    2
    0 Votes
    2 Posts
    3k Views
    V
    Third parameter of connect must be pointer to object which contain slot, so for you it must be pointer for MainWindow object, if you doing connect in MainWindow object you can use this.
  • Context menu on tree view

    11
    0 Votes
    11 Posts
    10k Views
    K
    [quote author="Rajveer" date="1337681154"]Hi In my case if i right click on root node it will not enter the below if condition @ QModelIndex index = view->currentIndex(); if(view->rootIndex() == index) { } @ And how to check for child nodes?[/quote] Well if you haven't set a root node, then of course the check performed by the first if condition will return false. And if you care to read my last post you will see that I already told you how to check for child nodes. You might want to put some effort into this yourself.
  • Qwidget as modal

    2
    0 Votes
    2 Posts
    10k Views
    sierdzioS
    Using: @ setWindowModality(Qt::WindowModal); @ in MyObj's constructor does not work?
  • Show only Icon for push button without text[solved]

    7
    0 Votes
    7 Posts
    13k Views
    V
    Hello Andre and Mabrouk, I managed to solve this problem by using QStyleOptionButton, as follows @if(!icon ().isNull ()){ QStyleOptionButton option; initStyleOption(&option); option.text = QString(""); // set the empty string so that only icon is drawn and not the text, when we specify both icon and text. if(m_mouseOverButton == true){ option.icon = icon().pixmap ( iconSize(), QIcon::Active); }else{ option.icon = icon().pixmap ( iconSize(), QIcon::Normal); } QPainter painter(this); style()->drawControl(QStyle::CE_PushButton, &option, &painter, this); //event->ignore (); }else{ QPushButton::paintEvent (event); }@ Thus when the icon is present, set the option text to empty string. This way, the original string is preserved. Thanks a lot for all the help...
  • Testing designed widgets

    5
    0 Votes
    5 Posts
    3k Views
    S
    This looks like to be a better solution. I'm going to convert project to that structure. Thank you :)