qt4

QObject::connect: Cannot connect (null)::mySignal() to (null)::mySlot()

非 Y 不嫁゛ 提交于 2019-12-08 10:48:58
问题 I'm missing the point while trying to connect signal/slots between plugins. Considering this question I've made the following. I'll be presenting the full source code of 3 Qt projects: pluginTCP: A plugin pluginRaw: Another plugin platform: The platform using the plugins pluginTcp.pro TEMPLATE = lib CONFIG += plugin CONFIG(debug, debug | release) { DESTDIR = debug } else { DESTDIR = release } OBJECTS_DIR = $$DESTDIR MOC_DIR = $$DESTDIR RCC_DIR = $$DESTDIR UI_DIR = $$DESTDIR QMAKE_CXXFLAGS +=

How to Get Many QComboBoxes' Text from QTableWidget

安稳与你 提交于 2019-12-08 10:45:42
问题 i have inserted lots of QComboBox into a QTableWidget with setCellWidget (I don't know the number of qcomboboxes because it's coming from MySQL). But when I want to get its text from table with self.table.item(0,1).itemText() or self.table.item(0,1).text() or self.table.item(0,1).currentText() it doesn't work . Normally I can get text with combobox.currentText() but table has many comboboxes and I don't know the row and column (x, y) info. So I should use something like .item(14,1).text() 回答1

Customize QSplitter handle color

久未见 提交于 2019-12-08 10:42:09
问题 How to change the color of QSplitter handle m_pSplitMainWin->setHandleWidth(10); m_pSplitMainWin->setStyleSheet("QSplitter::handle:background-color: rgb(55, 100, 110);"); This is not working, PLease give your valuable input 回答1: Works for me: QSplitter::handle { background-color: rgb(255, 255, 255); } More complex example: QSplitter#editorViewSplitter::handle:horizontal { border-left: 1px solid lightGray; } QSplitter#editorViewSplitter::handle:vertical { border-bottom: 1px solid lightGray; }

Qt version is invalid

☆樱花仙子☆ 提交于 2019-12-08 09:54:35
问题 I am working on Linux and I have installed Qt Creator 2.5.2, Qt libraries 4.7.4 and 4.4.3 all from sources. I cannot install the binaries directly for incompatibility between versions. The installation processes for both Qt 4.7.4 and Qt 4.4.3 were the same. The issue I am facing is that Qt Creator recognizes Qt 4.7.4 but not Qt 4.4.3, with the error The Qt version is invalid : Could not determine the path to the binaries of the Qt installation, maybe the path is wrong. Well each library is

ld returned 1 exit status

谁说胖子不能爱 提交于 2019-12-08 08:34:48
问题 This is the code that i'm trying to run: #include <QApplication> #include <QPushButton> int main(int argc,char *argv[]) { QApplication app(argc,argv); return app.exec(); } And this is the error that i'm getting: :-1: error: collect2: ld returned 1 exit status 回答1: If you read the error message carefully, you will see the problem. ...ld.exe: cannot open output file ... The linker is trying to write the generated executable file ( debug.exe ) to disk, but is not allowed to ( Permission denied )

QPrintPreviewDialog incorrect preview

瘦欲@ 提交于 2019-12-08 08:04:21
问题 Using QPrintPreviewDialog to preview the print, I use the following code QPrinter printer; printer.setResolution(QPrinter::HighResolution); printer.setPaperSize(QPrinter::A4); printer.setOrientation(QPrinter::Portrait); QPrintPreviewDialog *pd = new QPrintPreviewDialog(&printer); connect(pd,SIGNAL(paintRequested(QPrinter*)),this,SLOT(print(QPrinter*))); pd->exec(); void Class::print(QPrinter *p) { QTextEdit *ted = new QTextEdit; ted->insertHtml("<center><img src='"+QString(":/img/logo.png")+"

Manipulating QT Ui with different source files

天大地大妈咪最大 提交于 2019-12-08 07:26:10
问题 I searched for some hours now but I'm not able to find a solution. My setup is as follows: Widget.h Widget.cpp Widget.ui Function.h Function.cpp I wrote a function in my Function.cpp which adds some entries to a QListWidget in my Widget.ui. It's just a trial and error project: I already included widget.h and ui_widget.h so I can access the classes. The Widget is the QWidget template which you can create with the QtDesigner. In there is a QListWidget and a QButton. If I click the QButton then

Can't seem to get pyqt countdown timer to work

半世苍凉 提交于 2019-12-08 07:09:17
问题 I've searched internet for days but can figure out how to put this code to work. It's a very simple gui (made on Qt Designer) with a lcd and a button. I want it to on the press of the button to start the countdown from 180 seconds back. In the first moment i was able to make to button decrease in one the value but after trying so many different things nothing is working. Can someone help me please? Probably is something very simple. Thank you. # -*- coding: utf-8 -*- import sys import time

QMYSQL driver not loaded

本小妞迷上赌 提交于 2019-12-08 06:52:54
问题 I have compiled qmysql driver plugin and placed debug and release .dll and .lib files in \plugins\sqldrivers . But when i try qDebug() << QSqlDatabase::drivers(); it still get ("QSQLITE", "QODBC3", "QODBC", "QPSQL7", "QPSQL") and QMYSQL driver is not available.Any idea? Qt version : 4.8.4 Compiler : MSVC2010 OS : windows vista (64bit) 回答1: Your application needs libmysql.dll which you can find in the MySQL installation directory. You can copy it to the Qt bin directory or in the same

How to draw on the top of an inherited widget (VlcVideoWidget)?

别说谁变了你拦得住时间么 提交于 2019-12-08 05:59:20
问题 How can I draw something on a VLC Video Widget? I'm using VLC-Qt library to play video on a widget in my Qt application. My application requires drawing a text (or something like) on all videos. I already tried subclassing VlcWidgetVideo and reimplementing paintEvent . The method works when no video is playing. Though immadiately after starting to play, my paintings disappear. It looks like they are under VLC's video... The code: class TrackerWidgetVideo : public VlcWidgetVideo{ // Blah blah