Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • How to make a window/widget keep showing?

    7
    0 Votes
    7 Posts
    13k Views
    G
    thank you very much Zlatomir and VC15
  • Does QSystemTrayIcon support QDropEvent?

    3
    0 Votes
    3 Posts
    3k Views
    A
    Yes, apparently you have to use native API.
  • Qt4. Why no sizePolicy virtual method in QLayoutItem?

    11
    0 Votes
    11 Posts
    5k Views
    N
    When I create 5000 widgets, for example in QScrollView, it's so slow (redrawing). When I create a same number of my controls redraws flow smoothly. I write app for a desktop.
  • 0 Votes
    3 Posts
    3k Views
    Q
    Perfect! Thanks for the suggestion. After switching to QProcess the balloon message appears and the text box updates as the program is being executed. @ myProcess = new QProcess(this); connect(myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(updateTextBox())); connect(myProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(endProcess(int,QProcess::ExitStatus))); QSystemTrayIcon::MessageIcon icon; icon = QSystemTrayIcon::MessageIcon(1); trayIcon->showMessage(tr(""), tr("Process started."), icon, 5000); myProcess->start(file, options); void My_GUI::updateTextBox() { QByteArray result = myProcess->readAllStandardOutput(); textBox->insertPlainText(result); } void My_GUI::endProcess(int exitCode, QProcess::ExitStatus exitStatus) { myProcess->close(); QSystemTrayIcon::MessageIcon icon; icon = QSystemTrayIcon::MessageIcon(1); trayIcon->showMessage(tr(""), tr("Process completed."), icon, 5000); } @
  • Hardware Serial NUmber

    7
    0 Votes
    7 Posts
    5k Views
    T
    AFAIK there is no Qt-API to get to those IDs. You will need OS specific code to do that (for all OSes you want to support). You might even end up with vendor specific code to get the BIOS data... but I am not 100% sure there.
  • QT MinGW (GCC 4.5.0)

    3
    0 Votes
    3 Posts
    4k Views
    J
    Corrected the thread... Looks like I was drunk while i wrote it.
  • Difference between 4.7 GIT and 4.7 RC1 ?

    8
    0 Votes
    8 Posts
    4k Views
    A
    Tobias, I'm sorry:)
  • Disambiguation: QPainter, OpenGL, "backend" and "engine"

    2
    0 Votes
    2 Posts
    4k Views
    J
    Qt implements its painter interface using OpenGL, which is slightly different to when you actually use the gl* commands yourself then you are talking directly to whatwever gl implementation there is on your machine. It is possible to set up qt to use OpenGL to draw its entire interface (using the -opengl command line flag, among other methods), so when a QPainter is opened on a widget and draws lines etc, it is then itself using the Qt OpenGL API. Hope that helps?
  • GraphicsView background that independs from zoom and scrolling

    9
    0 Votes
    9 Posts
    5k Views
    I
    no pleasure
  • How to run "Network chat client example" in QT demos ?

    6
    0 Votes
    6 Posts
    5k Views
    I
    [quote author="chetankjain" date="1281140654"]when I tried, all machines were on the same subnet and using the same dhcp server for all network configuration, so some other issue[/quote] This isn't firewall settings. Your firewall (such default windows firewall) might be blocking UDP traffic. If you using other OSes check their firewall settings
  • QSqlQuery and ORACLE style value binding

    7
    0 Votes
    7 Posts
    6k Views
    I
    sure, ORACLE style value appliable for ORACLE and PostreSQL. I can use this name-style only for this databases.
  • QtOpenCL

    2
    0 Votes
    2 Posts
    3k Views
    A
    Yes, of course, I'm going to use OpenCL for my project.
  • QTabWidget/QTabBar

    5
    0 Votes
    5 Posts
    6k Views
    ?
    [quote author="filipv" date="1284636041"]I want to add an different image to each of the tabs of my tab widget. I could do the setting of an image using style sheets : @QTabBar::tab { background-image: url(:/Images/medication.png); }@ But this applies to all tabs. How do I select each tab of a tabbar separately?[/quote] Your original question was it to set background image to each tab page or is it to set individual icons for each tab page?
  • Looking for advice on how to make one widget be displayed over another

    7
    0 Votes
    7 Posts
    21k Views
    ?
    [quote author="TwoGunBerg" date="1284555514"]How do add two widgets to the same position when you are using a QVBoxlayout? doesn't a QVBoxlayout by nature put each widget added at a different position? [/quote] You can set the second one as the child of the first anytime. This code shows how to do it.. would that solve your problem? @ QVBoxLayout *vboxlayout = new QVBoxLayout; ui->frame->setLayout(vboxlayout); // lbl occupies whole frame QLabel *lbl = new QLabel("Picture Label!"); vboxlayout->addWidget(lbl); // lbltop is the child of lbl QLabel *lbltop = new QLabel("Picture Info Label!", lbl); lbltop->setGeometry(50,50,50,50); lbltop->show(); qDebug() << "Picture Label: " << lbl->rect() << ", " << lbl->size(); qDebug() << "Picture Info Label: " << lbltop->pos(); @
  • Problem with QObject::dumpObjectTree() on ubuntu 9.10

    10
    0 Votes
    10 Posts
    7k Views
    T
    I tried with 4.7.0 RC1 binary and it didn't work. Below is my hand altered Makefile where I pointed everything to the newly installed Qt. @ ############################################################################# Makefile for building: qobject Generated by qmake (2.01a) (Qt 4.5.2) on: Thu Sep 16 08:14:35 2010 Project: qobject.pro Template: app Command: /usr/bin/qmake -unix -o Makefile qobject.pro ############################################################################# ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_DEBUG -DQT_CORE_LIB CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/home/ben/Qt/qtsdk-2010.05/qt/mkspecs/linux-g++ -I. -I../../../Qt/qtsdk-2010.05/qt/include/QtCore -I/usr/include/qt4 -I. -I../../../Qt/qtsdk-2010.05/qt/include -I. LINK = g++ LFLAGS = -Wl,-O1 LIBS = $(SUBLIBS) -L/home/ben/Qt/qtsdk-2010.05/lib -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /home/ben/Qt/qtsdk-2010.05/qt/bin/qmake TAR = tar -cf COMPRESS = gzip -9f COPY = cp -f SED = sed COPY_FILE = $(COPY) COPY_DIR = $(COPY) -r INSTALL_FILE = install -m 644 -p INSTALL_DIR = $(COPY_DIR) INSTALL_PROGRAM = install -m 755 -p DEL_FILE = rm -f SYMLINK = ln -sf DEL_DIR = rmdir MOVE = mv -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p ####### Output directory OBJECTS_DIR = ./ ####### Files SOURCES = main.cpp Personna.cpp OBJECTS = main.o Personna.o DIST = /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/g++.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/unix.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/linux.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/qconfig.pri ...... /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/lex.prf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/include_source_dir.prf qobject.pro QMAKE_TARGET = qobject DESTDIR = TARGET = qobject ...... ####### Build rules all: Makefile $(TARGET) $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) Makefile: qobject.pro /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/linux-g++/qmake.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/g++.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/unix.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/linux.conf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/qconfig.pri /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/qt_functions.prf ...... /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/lex.prf /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/include_source_dir.prf /home/ben/Qt/qtsdk-2010.05/qt/lib/libQtGui.prl /home/ben/Qt/qtsdk-2010.05/qt/lib/libQtCore.prl $(QMAKE) -unix -o Makefile qobject.pro /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/g++.conf: /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/unix.conf: /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/common/linux.conf: /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/qconfig.pri: ...... /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/lex.prf: /home/ben/Qt/qtsdk-2010.05/qt/mkspecs/features/include_source_dir.prf: /home/ben/Qt/qtsdk-2010.05/qt/lib/libQtGui.prl: /home/ben/Qt/qtsdk-2010.05/qt/lib/libQtCore.prl: qmake: FORCE @$(QMAKE) -unix -o Makefile qobject.pro dist: @$(CHK_DIR_EXISTS) .tmp/qobject1.0.0 || $(MKDIR) .tmp/qobject1.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qobject1.0.0/ && $(COPY_FILE) --parents Personna.h .tmp/qobject1.0.0/ && $(COPY_FILE) --parents main.cpp Personna.cpp .tmp/qobject1.0.0/ && (cd dirname .tmp/qobject1.0.0 && $(TAR) qobject1.0.0.tar qobject1.0.0 && $(COMPRESS) qobject1.0.0.tar) && $(MOVE) dirname .tmp/qobject1.0.0/qobject1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qobject1.0.0 clean:compiler_clean -$(DEL_FILE) $(OBJECTS) -$(DEL_FILE) *~ core *.core ####### Sub-libraries distclean: clean -$(DEL_FILE) $(TARGET) -$(DEL_FILE) Makefile mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all compiler_moc_header_make_all: compiler_moc_header_clean: compiler_rcc_make_all: compiler_rcc_clean: compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: compiler_uic_make_all: compiler_uic_clean: compiler_yacc_decl_make_all: compiler_yacc_decl_clean: compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: compiler_clean: ####### Compile main.o: main.cpp Personna.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp Personna.o: Personna.cpp Personna.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Personna.o Personna.cpp ####### Install install: FORCE uninstall: FORCE FORCE: @
  • Strange behaviour with double numbers

    3
    0 Votes
    3 Posts
    2k Views
    P
    Thanks! Alexander
  • How do I create an In Process COM server?

    4
    0 Votes
    4 Posts
    6k Views
    D
    I appear to have the build working now but when the DLL gets built it cannot be registered. Also running regsvr32 does not register the dll as loadlibrary fails! The output from the build from qt creator is as follows Running build steps for project simple... Configuration unchanged, skipping qmake step. Starting: "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w mingw32-make: Entering directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Release all mingw32-make[1]: Entering directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQAXSERVER -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.04\qt\include\QtCore" -I"c:\Qt\2010.04\qt\include\QtGui" -I"c:\Qt\2010.04\qt\include" -I"c:\Qt\2010.04\qt\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\simple" -I"c:\Program Files\Microsoft Visual Studio\VC98\include" -I"." -I"c:\Qt\2010.04\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\simple\main.cpp -o tmp\moc\release_shared\main.moc g++ -c -O2 -w -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DQAXSERVER -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.04\qt\include\QtCore" -I"c:\Qt\2010.04\qt\include\QtGui" -I"c:\Qt\2010.04\qt\include" -I"c:\Qt\2010.04\qt\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\simple" -I"c:\Program Files\Microsoft Visual Studio\VC98\include" -I"." -I"c:\Qt\2010.04\qt\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o ..\simple\main.cpp windres -i c:\Qt\2010.04\qt\src\activeqt\control\qaxserver.rc -o tmp\obj\release_shared\qaxserver_res.o --include-dir=c:/Qt/2010.04/qt/src/activeqt/control g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -shared -mthreads -Wl -Wl,--out-implib,release\libsimpleax.a -Wl,C:/Qt/2010.04/qt/src/activeqt/control/qaxserver.def -o release\simpleax.dll tmp/obj/release_shared/main.o -L"c:\Qt\2010.04\qt\lib" -L"c:\Qt\2010.04\qt\lib" -lQAxServer tmp\obj\release_shared\qaxserver_res.o -luser32 -lole32 -loleaut32 -lgdi32 -luuid -lQtGui4 -lQtCore4 Creating library file: release\libsimpleax.a c:\Qt\2010.04\qt\bin\idc.exe release\simpleax.dll /idl tmp\obj\release_shared/simpleax.idl -version 1.0 midl tmp\obj\release_shared/simpleax.idl /nologo /tlb tmp\obj\release_shared/simpleax.tlb c:\Qt\2010.04\qt\bin\idc.exe release\simpleax.dll /tlb tmp\obj\release_shared/simpleax.tlb c:\Qt\2010.04\qt\bin\idc.exe release\simpleax.dll /regserver tmp\obj\release_shared\simpleax.idl process_begin: CreateProcess(NULL, midl tmp\obj\release_shared/simpleax.idl /nologo /tlb tmp\obj\release_shared/simpleax.tlb, ...) failed. make (e=2): The system cannot find the file specified. mingw32-make[1]: [release\simpleax.dll] Error 2 (ignored) Couldn't open tmp\obj\release_shared\simpleax.tlb for read mingw32-make[1]: [release\simpleax.dll] Error 4 (ignored) mingw32-make[1]: Leaving directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug all Failed to register server! mingw32-make[1]: [release\simpleax.dll] Error 1 (ignored) mingw32-make[1]: Entering directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQAXSERVER -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.04\qt\include\QtCore" -I"c:\Qt\2010.04\qt\include\QtGui" -I"c:\Qt\2010.04\qt\include" -I"c:\Qt\2010.04\qt\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\simple" -I"c:\Program Files\Microsoft Visual Studio\VC98\include" -I"." -I"c:\Qt\2010.04\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\simple\main.cpp -o tmp\moc\debug_shared\main.moc g++ -c -g -w -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DQAXSERVER -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.04\qt\include\QtCore" -I"c:\Qt\2010.04\qt\include\QtGui" -I"c:\Qt\2010.04\qt\include" -I"c:\Qt\2010.04\qt\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\simple" -I"c:\Program Files\Microsoft Visual Studio\VC98\include" -I"." -I"c:\Qt\2010.04\qt\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o ..\simple\main.cpp windres -i c:\Qt\2010.04\qt\src\activeqt\control\qaxserver.rc -o tmp\obj\debug_shared\qaxserver_res.o --include-dir=c:/Qt/2010.04/qt/src/activeqt/control g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -mthreads -Wl -Wl,--out-implib,debug\libsimpleax.a -Wl,C:/Qt/2010.04/qt/src/activeqt/control/qaxserver.def -o debug\simpleax.dll tmp/obj/debug_shared/main.o -L"c:\Qt\2010.04\qt\lib" -L"c:\Qt\2010.04\qt\lib" -lQAxServerd tmp\obj\debug_shared\qaxserver_res.o -luser32 -lole32 -loleaut32 -lgdi32 -luuid -lQtGuid4 -lQtCored4 Creating library file: debug\libsimpleax.a c:\Qt\2010.04\qt\bin\idc.exe debug\simpleax.dll /idl tmp\obj\debug_shared/simpleax.idl -version 1.0 midl tmp\obj\debug_shared/simpleax.idl /nologo /tlb tmp\obj\debug_shared/simpleax.tlb c:\Qt\2010.04\qt\bin\idc.exe debug\simpleax.dll /tlb tmp\obj\debug_shared/simpleax.tlb c:\Qt\2010.04\qt\bin\idc.exe debug\simpleax.dll /regserver mingw32-make[1]: Leaving directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' mingw32-make: Leaving directory C:/qt/2010.04/qt/examples/activeqt/simple-build-desktop' tmp\obj\debug_shared\simpleax.idl process_begin: CreateProcess(NULL, midl tmp\obj\debug_shared/simpleax.idl /nologo /tlb tmp\obj\debug_shared/simpleax.tlb, ...) failed. make (e=2): The system cannot find the file specified. mingw32-make[1]: [debug\simpleax.dll] Error 2 (ignored) Couldn't open tmp\obj\debug_shared\simpleax.tlb for read mingw32-make[1]: [debug\simpleax.dll] Error 4 (ignored) Failed to register server! mingw32-make[1]: [debug\simpleax.dll] Error 1 (ignored) The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited normally.
  • Delete whole line : QTextEdit

    5
    0 Votes
    5 Posts
    10k Views
    Y
    It was working on 4.6.2 perfectly. Yea I'll post bugs. Just want to make sure it just happening with me or others also having same issue.
  • Blinking button using stylesheets

    5
    0 Votes
    5 Posts
    15k Views
    F
    Thanks for this tip. That could become a problem for me too... Up till now, I was developing on a Linux host. But the final target of the software is an embedded device. So, it might be a good idea to continue looking for another solution... Anyone any other ideas ?
  • [QTextEdit] How get images from document resources?

    2
    0 Votes
    2 Posts
    8k Views
    I
    Please write, that you solved this problem "here":http://www.linux.org.ru/forum/development/5325251?lastmod=1284317250215 Updated: Oh, sorry, not saw that.