qt4

GUI program can't allocate a console in Qt's debugger

点点圈 提交于 2019-12-11 07:08:47
问题 I have a GUI program that opens a Windows console in a separate window to display output and accept user input. My development environment is Qt 4.7.1 with mingw. The console works fine, until I try to run the program in Qt's debugger (gdb); then, although AllocConsole succeeds, and GetStdHandle appears to return a valid handle (0x000000d8), any attempt to use the handle causes Windows error 6 (invalid handle). So I can't debug my program. Which is a pain, because it has some serious bugs.

exploiting poppler in Qt creator - help

删除回忆录丶 提交于 2019-12-11 06:59:39
问题 I am trying to compile a Qt project that uses poppler library for pdf (linux). I put #include in the mainwindow.cpp I put poppler folder in my project folder besides mainwindow.cpp poppler-qt4.h is in poppler-0.16.7/qt4/src I do not need to recompile poppler, I just need to link the library through its headers but I do not know how to do. If compilation is necessary I can do it, but I tried ./configure and it said "./configure not found". I searched for other similar threads but they were not

Add icon from array to QListWidget item

这一生的挚爱 提交于 2019-12-11 06:56:39
问题 I've written a loop which adds some items to my QListWidget . Now I want them to have an icon from my qrc file. For this I would use a loop in which I add a unique icon to each item. void Test::Query() { ui->listWidget_Available->clear(); QString CmdList[4] = {"kcmshell4 --list|grep -q kcm_grub2", "kcmshell4 --list|grep -q kcm_networkmanagement", "which pastebunz", "[ -z $ink3_ver ]"}; QString NameList[4] = {"kcm_grub2", "kcm_networkmanagement", "pastebunz", "Shellmenu"}; QString IconList[4]

Qt creating new translation (ts) using Visual gives error - (ExitCode 1)

岁酱吖の 提交于 2019-12-11 06:56:08
问题 I am using QTranslator in VS 2010. When using the process below I get an error saying the add-on has exited with an error (Exitcode 1). I have been through the whole process (code to executable with translations working) using Qt Linguist and Qt Creator. However, I cannot even create the ts file in Visual Studio (add on menus all where they should be). Anyone any ideas why please? Creating Qt Translation Files for the Project To add a new translation file to the project, select Qt|Create New

How to add item in a QGraphicsScene?

南楼画角 提交于 2019-12-11 06:54:21
问题 I am trying to add some custom QGraphicsItems in a QGraphicsScene on mouse click and at mouse cursor coordinates. But the items are not added at the same coordinates as the mouse cursor's. renderArea::renderArea(QWidget *parent): QGraphicsView(parent) { scene = new QGraphicsScene(this); scene->setItemIndexMethod(QGraphicsScene::NoIndex); scene->setSceneRect(0, 0, 850, 480); setScene(scene); setCacheMode(CacheBackground); setViewportUpdateMode(BoundingRectViewportUpdate); setRenderHint

QThread::finished() is never emitted?

梦想的初衷 提交于 2019-12-11 06:35:49
问题 I don't have a forever loop like this question, but it still doesn't emit the finished() signal, In the constructor of a class: connect (&thread, SIGNAL(started()), SLOT(threadFunc())); connect (&thread, SIGNAL(finished()), SLOT(finished())); In the finished() function, void XX::finished() { qDebug() << "Completed"; } void XX::threadFunc() { qDebug() << "Thread finished"; // only single line, finishes immediately } But I never see the finished() get called, everytime before I start the thread

Custom QGraphicsItems not compiling and gives “object is private” error

匆匆过客 提交于 2019-12-11 06:33:18
问题 I am trying to create a Custom QGraphicsItem button as shown by Fred here. The code which he posted can be found here. The problem is when I try and compile the code I get the following two errors: /usr/include/qt4/QtGui/qgraphicsitem.h ‘QGraphicsItem::QGraphicsItem(const QGraphicsItem&)’ is private /usr/include/qt4/QtCore/qobject.h ‘QObject::QObject(const QObject&)’ is private Here is the code snippet which essentially is the same as that in the sample above. The error is on the class

How to tell QThread to wait until work is done ,and then finish?

拥有回忆 提交于 2019-12-11 06:29:34
问题 I have a simple application that uses one worker thread. This worker thread is started and initializes DownloadManager, which is responsible for downloading files from the net. In my main application class I have the finished() SIGNAL on the thread that is emitted before the DownloadManager finishes. My question is how to make the worker thread wait until the DownloadManager finishes its work. Here is example code : class Main { m_DownloadWorker = new DownloadWorker(this); QObject::connect(pm

HowTo draw border for QTableWidget row?

♀尐吖头ヾ 提交于 2019-12-11 05:18:14
问题 I'm trying to make a border for rows in QTableWidget with different ways, but all solutions don't respond my requirements. All that I want, is to draw a rectangle around a whole row . I had try QStyledItemDelegate class, but that is not my way, because delegates are used only for item[ row, column ], not for the whole rows or columns. Here is wrong solution: /// @brief Рисуем границу вокруг строки. class DrawBorderDelegate : public QStyledItemDelegate { public: DrawBorderDelegate( QObject*

Remove editable item from QListWidget if empty

隐身守侯 提交于 2019-12-11 05:08:28
问题 I'm using Qt 4.8.6. I have a QListWidget . When the user click on an Add button, a new item is inserted at the end of the list and edition of the item's text is initiated: void slot_add_item() { auto* item = new QListWidgetItem(QString()); item->setFlags(item->flags() | Qt::ItemIsEditable); listWidget->addItem(item); listWidget->setCurrentItem(item); listWidget->editItem(item); } Based on this comment, I'm listening to the commitData signal to catch when the user has finished editing the item